Re: [Intel-gfx] [PATCH] drm/i915/gt: Give engine->kernel_context distinct timeline lock classes

2019-10-08 Thread Matthew Auld
On Tue, 8 Oct 2019 at 19:59, Chris Wilson  wrote:
>
> 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: Chris Wilson 
> Cc: Tvrtko Ursulin 
> Cc: Matthew Auld 
Reviewed-by: Matthew Auld 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Intel-gfx] [PATCH] drm/i915/gt: Give engine->kernel_context distinct timeline lock classes

2019-10-08 Thread Chris Wilson
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: Chris Wilson 
Cc: Tvrtko Ursulin 
Cc: Matthew Auld 
---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c 
b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 7e2aa7a6bef0..5aa1371f6a0f 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -736,6 +736,7 @@ intel_engine_init_active(struct intel_engine_cs *engine, 
unsigned int subclass)
 static struct intel_context *
 create_kernel_context(struct intel_engine_cs *engine)
 {
+   static struct lock_class_key kernel;
struct intel_context *ce;
int err;
 
@@ -751,6 +752,14 @@ create_kernel_context(struct intel_engine_cs *engine)
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;
 }
 
-- 
2.23.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx