diff mbox series

[25/26] drm/i915/perf: Manually acquire engine-wakeref around use of kernel_context

Message ID 20200505083239.2428948-26-tjaalton@ubuntu.com
State New
Headers show
Series drm/i915: Backport support for VK_INTEL_performance_query extension | expand

Commit Message

Timo Aaltonen May 5, 2020, 8:32 a.m. UTC
From: Chris Wilson <chris@chris-wilson.co.uk>

BugLink: https://bugs.launchpad.net/bugs/1871957

The engine->kernel_context is a special case for request emission. Since
it is used as the barrier within the engine's wakeref, we must acquire the
wakeref before submitting a request to the kernel_context.

Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227085723.1961649-3-chris@chris-wilson.co.uk
(cherry picked from commit d236e2ac535aee1ee19684427edd3654bac143a4)
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index e6622cf6030e..0d11cafb976a 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2132,7 +2132,9 @@  static int gen8_modify_self(struct intel_context *ce,
 	struct i915_request *rq;
 	int err;
 
+	intel_engine_pm_get(ce->engine);
 	rq = i915_request_create(ce);
+	intel_engine_pm_put(ce->engine);
 	if (IS_ERR(rq))
 		return PTR_ERR(rq);