mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
drm/i915/gem: Use the proto-context to handle create parameters (v5)
This means that the proto-context needs to grow support for engine configuration information as well as setparam logic. Fortunately, we'll be deleting a lot of setparam logic on the primary context shortly so it will hopefully balance out. There's an extra bit of fun here when it comes to setting SSEU and the way it interacts with PARAM_ENGINES. Unfortunately, thanks to SET_CONTEXT_PARAM and not being allowed to pick the order in which we handle certain parameters, we have think about those interactions. v2 (Daniel Vetter): - Add a proto_context_free_user_engines helper - Comment on SSEU in the commit message - Use proto_context_set_persistence in set_proto_ctx_param v3 (Daniel Vetter): - Fix a doc comment - Do an explicit HAS_FULL_PPGTT check in set_proto_ctx_vm instead of relying on pc->vm != NULL. - Handle errors for CONTEXT_PARAM_PERSISTENCE - Don't allow more resetting user engines - Rework initialization of UCONTEXT_PERSISTENCE v4 (Jason Ekstrand): - Move hand-rolled initialization of UCONTEXT_PERSISTENCE to an earlier patch v5 (Jason Ekstrand): - Move proto_context_set_persistence to this patch Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20210708154835.528166-22-jason@jlekstrand.net
This commit is contained in:
committed by
Daniel Vetter
parent
def25b7bc3
commit
d4433c7600
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,55 @@ struct i915_gem_engines_iter {
|
||||
const struct i915_gem_engines *engines;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum i915_gem_engine_type - Describes the type of an i915_gem_proto_engine
|
||||
*/
|
||||
enum i915_gem_engine_type {
|
||||
/** @I915_GEM_ENGINE_TYPE_INVALID: An invalid engine */
|
||||
I915_GEM_ENGINE_TYPE_INVALID = 0,
|
||||
|
||||
/** @I915_GEM_ENGINE_TYPE_PHYSICAL: A single physical engine */
|
||||
I915_GEM_ENGINE_TYPE_PHYSICAL,
|
||||
|
||||
/** @I915_GEM_ENGINE_TYPE_BALANCED: A load-balanced engine set */
|
||||
I915_GEM_ENGINE_TYPE_BALANCED,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct i915_gem_proto_engine - prototype engine
|
||||
*
|
||||
* This struct describes an engine that a context may contain. Engines
|
||||
* have three types:
|
||||
*
|
||||
* - I915_GEM_ENGINE_TYPE_INVALID: Invalid engines can be created but they
|
||||
* show up as a NULL in i915_gem_engines::engines[i] and any attempt to
|
||||
* use them by the user results in -EINVAL. They are also useful during
|
||||
* proto-context construction because the client may create invalid
|
||||
* engines and then set them up later as virtual engines.
|
||||
*
|
||||
* - I915_GEM_ENGINE_TYPE_PHYSICAL: A single physical engine, described by
|
||||
* i915_gem_proto_engine::engine.
|
||||
*
|
||||
* - I915_GEM_ENGINE_TYPE_BALANCED: A load-balanced engine set, described
|
||||
* i915_gem_proto_engine::num_siblings and i915_gem_proto_engine::siblings.
|
||||
*/
|
||||
struct i915_gem_proto_engine {
|
||||
/** @type: Type of this engine */
|
||||
enum i915_gem_engine_type type;
|
||||
|
||||
/** @engine: Engine, for physical */
|
||||
struct intel_engine_cs *engine;
|
||||
|
||||
/** @num_siblings: Number of balanced siblings */
|
||||
unsigned int num_siblings;
|
||||
|
||||
/** @siblings: Balanced siblings */
|
||||
struct intel_engine_cs **siblings;
|
||||
|
||||
/** @sseu: Client-set SSEU parameters */
|
||||
struct intel_sseu sseu;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct i915_gem_proto_context - prototype context
|
||||
*
|
||||
@@ -84,6 +133,15 @@ struct i915_gem_proto_context {
|
||||
/** @sched: See &i915_gem_context.sched */
|
||||
struct i915_sched_attr sched;
|
||||
|
||||
/** @num_user_engines: Number of user-specified engines or -1 */
|
||||
int num_user_engines;
|
||||
|
||||
/** @user_engines: User-specified engines */
|
||||
struct i915_gem_proto_engine *user_engines;
|
||||
|
||||
/** @legacy_rcs_sseu: Client-set SSEU parameters for the legacy RCS */
|
||||
struct intel_sseu legacy_rcs_sseu;
|
||||
|
||||
/** @single_timeline: See See &i915_gem_context.syncobj */
|
||||
bool single_timeline;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user