Commit 6ad145fe authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Give engine->kernel_context distinct timeline lock classes

Assign a separate lockclass to the perma-pinned timelines of the
kernel_context, such that we can use them from within the user timelines
should we ever need to inject GPU operations to fixup faults during
request construction.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: default avatarMatthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191008185941.15228-1-chris@chris-wilson.co.uk
parent 7c98501a
...@@ -736,6 +736,7 @@ intel_engine_init_active(struct intel_engine_cs *engine, unsigned int subclass) ...@@ -736,6 +736,7 @@ intel_engine_init_active(struct intel_engine_cs *engine, unsigned int subclass)
static struct intel_context * static struct intel_context *
create_kernel_context(struct intel_engine_cs *engine) create_kernel_context(struct intel_engine_cs *engine)
{ {
static struct lock_class_key kernel;
struct intel_context *ce; struct intel_context *ce;
int err; int err;
...@@ -751,6 +752,14 @@ create_kernel_context(struct intel_engine_cs *engine) ...@@ -751,6 +752,14 @@ create_kernel_context(struct intel_engine_cs *engine)
return ERR_PTR(err); return ERR_PTR(err);
} }
/*
* Give our perma-pinned kernel timelines a separate lockdep class,
* so that we can use them from within the normal user timelines
* should we need to inject GPU operations during their request
* construction.
*/
lockdep_set_class(&ce->timeline->mutex, &kernel);
return ce; return ce;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment