[PATCH 3/3] drm/i915: Emit final breadcrumb in request_add

Chris Wilson chris at chris-wilson.co.uk
Sat Mar 9 16:46:12 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 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 9533a85cb0b3..c18666d5d256 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -438,9 +438,6 @@ void __i915_request_submit(struct i915_request *request)
 
 	spin_unlock(&request->lock);
 
-	engine->emit_fini_breadcrumb(request,
-				     request->ring->vaddr + request->postfix);
-
 	/* Transfer from per-context onto the global per-engine timeline */
 	move_to_timeline(request, &engine->timeline);
 
@@ -1036,6 +1033,8 @@ void i915_request_add(struct i915_request *request)
 	cs = intel_ring_begin(request, engine->emit_fini_breadcrumb_dw);
 	GEM_BUG_ON(IS_ERR(cs));
 	request->postfix = intel_ring_offset(request, cs);
+	cs = engine->emit_fini_breadcrumb(request, cs);
+	GEM_BUG_ON(request->ring->vaddr + request->ring->emit != cs);
 
 	/*
 	 * Seal the request and mark it as pending execution. Note that
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list