[Intel-gfx] [PATCH] drm/i915/execlists: Skip over foreign requests on the context timeline

Chris Wilson chris at chris-wilson.co.uk
Sat Oct 26 10:30:12 UTC 2019


When searching for the last active request on our timeline, we only care
about the requests matching the current context. (The context's timeline
may have barrier entries from the kernel_context for example.) Just skip
these foreign requests so we replay our own ring.

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

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 16340740139d..9978375db976 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -265,8 +265,9 @@ static struct i915_request *active_request(struct i915_request *rq)
 		if (i915_request_completed(rq))
 			break;
 
+		/* Ignore foreign requests when rewinding this context */
 		if (rq->hw_context != ce)
-			break;
+			continue;
 
 		active = rq;
 	}
@@ -3043,7 +3044,7 @@ static void __execlists_reset(struct intel_engine_cs *engine, bool stalled)
 	restore_default_state(ce, engine);
 
 out_replay:
-	GEM_TRACE("%s replay {head:%04x, tail:%04x\n",
+	GEM_TRACE("%s replay {head:%04x, tail:%04x}\n",
 		  engine->name, ce->ring->head, ce->ring->tail);
 	intel_ring_update_space(ce->ring);
 	__execlists_reset_reg_state(ce, engine);
-- 
2.24.0.rc1



More information about the Intel-gfx mailing list