summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-06-21 09:07:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-06-21 10:11:05 +0100
commit12fdaf19e05b69992502eb9c97fc3c180f797564 (patch)
tree103eae977cdb7fef929ff3cfc9631fe173a9b1a9 /drivers/gpu/drm
parentb32fa811156328aea5a3c2ff05cc096490382456 (diff)
drm/i915/execlists: Keep virtual context alive until after we kick
The call to kick_siblings() dereferences the rq->context, so we should not drop our local reference until afterwards! v2: Stick to setting ce.inflight=NULL before kicking as this is what the other threads will check to see if the context is ready for takeover. Fixes: 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190621080729.2652-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/gt/intel_lrc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index f8ad49006917..faa9a2e4e40b 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -557,9 +557,6 @@ execlists_schedule_out(struct i915_request *rq)
intel_engine_context_out(ce->inflight);
execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_OUT);
- ce->inflight = NULL;
- intel_context_put(ce);
-
/*
* If this is part of a virtual engine, its next request may
* have been blocked waiting for access to the active context.
@@ -569,8 +566,11 @@ execlists_schedule_out(struct i915_request *rq)
* request before the tasklet runs and do not need to rebuild
* each virtual tree and kick everyone again.
*/
+ ce->inflight = NULL;
if (rq->engine != ce->engine)
kick_siblings(rq, ce);
+
+ intel_context_put(ce);
}
i915_request_put(rq);