aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_request.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-01-28 13:18:11 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2019-01-28 14:07:09 -0500
commit5013eb8cd601c31e6d7d1b9d3291b24e933b77b2 (patch)
tree1078ed4c54d8457b3768ee71422970144c05c053 /drivers/gpu/drm/i915/i915_request.c
parent8ba306a6a362ef6f3c005ec8819c8890a6fadcd1 (diff)
drm/i915: Track the context's seqno in its own timeline HWSP
Now that we have allocated ourselves a cacheline to store a breadcrumb, we can emit a write from the GPU into the timeline's HWSP of the per-context seqno as we complete each request. This drops the mirroring of the per-engine HWSP and allows each context to operate independently. We do not need to unwind the per-context timeline, and so requests are always consistent with the timeline breadcrumb, greatly simplifying the completion checks as we no longer need to be concerned about the global_seqno changing mid check. One complication though is that we have to be wary that the request may outlive the HWSP and so avoid touching the potentially danging pointer after we have retired the fence. We also have to guard our access of the HWSP with RCU, the release of the obj->mm.pages should already be RCU-safe. At this point, we are emitting both per-context and global seqno and still using the single per-engine execution timeline for resolving interrupts. v2: s/fake_complete/mark_complete/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190128181812.22804-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_request.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index a076fd0b7ba6..4d58770e6a8c 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -199,6 +199,7 @@ static void __retire_engine_request(struct intel_engine_cs *engine,
199 spin_unlock(&engine->timeline.lock); 199 spin_unlock(&engine->timeline.lock);
200 200
201 spin_lock(&rq->lock); 201 spin_lock(&rq->lock);
202 i915_request_mark_complete(rq);
202 if (!i915_request_signaled(rq)) 203 if (!i915_request_signaled(rq))
203 dma_fence_signal_locked(&rq->fence); 204 dma_fence_signal_locked(&rq->fence);
204 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &rq->fence.flags)) 205 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &rq->fence.flags))
@@ -621,7 +622,7 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)
621 rq->ring = ce->ring; 622 rq->ring = ce->ring;
622 rq->timeline = ce->ring->timeline; 623 rq->timeline = ce->ring->timeline;
623 GEM_BUG_ON(rq->timeline == &engine->timeline); 624 GEM_BUG_ON(rq->timeline == &engine->timeline);
624 rq->hwsp_seqno = &engine->status_page.addr[I915_GEM_HWS_INDEX]; 625 rq->hwsp_seqno = rq->timeline->hwsp_seqno;
625 626
626 spin_lock_init(&rq->lock); 627 spin_lock_init(&rq->lock);
627 dma_fence_init(&rq->fence, 628 dma_fence_init(&rq->fence,