[Intel-gfx] [PATCH 2/3] drm/i915: Emit final breadcrumb in request_add

Chris Wilson chris at chris-wilson.co.uk
Mon Jun 24 13:07:06 UTC 2019


With everything now known at the point of adding the request to the
context's timeline, we can move the emission of the final breadcrumb to
the request add and pull it out of the CS interrupt service handler.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_request.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 5ff87c4a0cd5..f45dd2c260d4 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -437,9 +437,6 @@ void __i915_request_submit(struct i915_request *request)
 
 	spin_unlock(&request->lock);
 
-	engine->emit_fini_breadcrumb(request,
-				     request->ring->vaddr + request->postfix);
-
 	engine->serial++;
 
 	trace_i915_request_execute(request);
@@ -1178,6 +1175,9 @@ struct i915_request *__i915_request_commit(struct i915_request *rq)
 	GEM_BUG_ON(IS_ERR(cs));
 	rq->postfix = intel_ring_offset(rq, cs);
 
+	cs = engine->emit_fini_breadcrumb(rq, cs);
+	GEM_BUG_ON(rq->ring->vaddr + rq->ring->emit != cs);
+
 	prev = __i915_request_add_to_timeline(rq);
 
 	list_add_tail(&rq->ring_link, &ring->request_list);
-- 
2.20.1



More information about the Intel-gfx mailing list