[Intel-gfx] [PATCH 6/8] drm/i915: Include the breadcrumb when asserting request completion

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 27 11:28:32 UTC 2019


As we explode, include the breadcrumb results in the trace for why we
choose to explode on the request completion assertion failure.

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

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 2bc25e3f83e6..ff8eb3fa3fc6 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1381,7 +1381,7 @@ static void process_csb(struct intel_engine_cs *engine)
 			 * coherent (visible from the CPU) before the
 			 * user interrupt and CSB is processed.
 			 */
-			GEM_BUG_ON(!i915_request_completed(rq));
+			assert_request_complete(rq);
 			execlists_schedule_out(rq);
 
 			GEM_BUG_ON(execlists->active - execlists->inflight >
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 5ff87c4a0cd5..5b1c638d3754 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -329,7 +329,7 @@ void i915_request_retire_upto(struct i915_request *rq)
 		  hwsp_seqno(rq));
 
 	lockdep_assert_held(&rq->i915->drm.struct_mutex);
-	GEM_BUG_ON(!i915_request_completed(rq));
+	assert_request_complete(rq);
 
 	if (list_empty(&rq->ring_link))
 		return;
diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h
index b58ceef92e20..a41791637076 100644
--- a/drivers/gpu/drm/i915/i915_request.h
+++ b/drivers/gpu/drm/i915/i915_request.h
@@ -432,4 +432,16 @@ static inline void i915_request_mark_complete(struct i915_request *rq)
 
 bool i915_retire_requests(struct drm_i915_private *i915);
 
+static inline void assert_request_complete(const struct i915_request *rq)
+{
+	u32 hwsp = hwsp_seqno(rq);
+
+	if (i915_seqno_passed(hwsp, rq->fence.seqno))
+		return;
+
+	GEM_TRACE("fence %llx:%llu incomplete, current %u\n",
+		  rq->fence.context, rq->fence.seqno, hwsp);
+	GEM_BUG_ON(!i915_seqno_passed(hwsp, rq->fence.seqno));
+}
+
 #endif /* I915_REQUEST_H */
-- 
2.20.1



More information about the Intel-gfx mailing list