[PATCH] drm/i915: Include the breadcrumb when asserting request completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---
Undo the logical inversion by adding the wrong assert to reset.
-Chris
---
 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 ce1aba3604b3..18b94fc952d8 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux