[Intel-gfx] [PATCH] drm/i915: Decode RING_BUFFER_HEAD in error state

Ben Widawsky ben at bwidawsk.net
Mon Apr 22 01:01:19 CEST 2013


I consistently forget how to decode the HEAD pointer. If we put it in
the error state, one doesn't need to look in docs to find the relevant
info.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e913d32..dd5a64e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -643,7 +643,10 @@ static void i915_ring_error_state(struct seq_file *m,
 {
 	BUG_ON(ring >= I915_NUM_RINGS); /* shut up confused gcc */
 	seq_printf(m, "%s command stream:\n", ring_str(ring));
-	seq_printf(m, "  HEAD: 0x%08x\n", error->head[ring]);
+	seq_printf(m, "  HEAD: 0x%08x (wraps: %d; offset: 0x%08x)\n",
+		   error->head[ring],
+		   error->head[ring] >> 21,
+		   error->head[ring] & (0x7ffff << 2));
 	seq_printf(m, "  TAIL: 0x%08x\n", error->tail[ring]);
 	seq_printf(m, "  CTL: 0x%08x\n", error->ctl[ring]);
 	seq_printf(m, "  ACTHD: 0x%08x\n", error->acthd[ring]);
-- 
1.8.2.1




More information about the Intel-gfx mailing list