[Intel-gfx] [PATCH] drm/i915: Assert that the engine hasn't run backwards

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 30 15:05:58 UTC 2017


One invariant on the order of requests on an engine is that they are
monotonically increasing. Assert that when we check retirement on the
ring that no request is more recent than the last submit request.

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

diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 2cb2206b2f6b..2ce37e25f623 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -1246,6 +1246,8 @@ static void engine_retire_requests(struct intel_engine_cs *engine)
 	u32 seqno = intel_engine_get_seqno(engine);
 	LIST_HEAD(retire);
 
+	GEM_BUG_ON(!i915_seqno_passed(intel_engine_last_submit(engine), seqno));
+
 	spin_lock_irq(&engine->timeline->lock);
 	list_for_each_entry_safe(request, next,
 				 &engine->timeline->requests, link) {
-- 
2.11.0



More information about the Intel-gfx mailing list