diff mbox

[45/49] drm/i915/bdw: Display context ringbuffer info in debugfs

Message ID 1395943218-7708-46-git-send-email-oscar.mateo@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

oscar.mateo@intel.com March 27, 2014, 6 p.m. UTC
From: Oscar Mateo <oscar.mateo@intel.com>

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 226b630..c52108d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1648,6 +1648,14 @@  static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 
 	return 0;
 }
+static void describe_ctx_ringbuf(struct seq_file *m, struct i915_hw_context *ctx)
+{
+	struct intel_ringbuffer *ringbuf = ctx->ringbuf;
+
+	seq_printf(m, " (ringbuffer type: %d, space: %d, head: %u, tail: %u, last head: %d)",
+			ctx->ring_id, ringbuf->space, ringbuf->head, ringbuf->tail,
+			ringbuf->last_retired_head);
+}
 
 static int i915_context_status(struct seq_file *m, void *unused)
 {
@@ -1682,6 +1690,8 @@  static int i915_context_status(struct seq_file *m, void *unused)
 				seq_printf(m, "(default context %s) ", ring->name);
 
 		describe_obj(m, ctx->obj);
+		if (dev_priv->lrc_enabled)
+			describe_ctx_ringbuf(m, ctx);
 		seq_putc(m, '\n');
 	}