From: John Harrison <john.c.harri...@intel.com>

When there are lots and lots and even more lots of contexts (e.g. when running
with execlists) it is useful to be able to immediately see what the total
context count is.

Change-Id: If9726d4df86567100ecf53867b43f4753f08bf84
For: VIZ-1587
Signed-off-by: John Harrison <john.c.harri...@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 18dfb56..ecab9b8 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1953,6 +1953,7 @@ static int i915_context_status(struct seq_file *m, void 
*unused)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_engine_cs *ring;
        struct intel_context *ctx;
+       uint32_t count = 0;
        int ret, i;
 
        ret = mutex_lock_interruptible(&dev->struct_mutex);
@@ -1966,6 +1967,7 @@ static int i915_context_status(struct seq_file *m, void 
*unused)
 
                seq_puts(m, "HW context ");
                describe_ctx(m, ctx);
+               count++;
                for_each_ring(ring, dev_priv, i) {
                        if (ring->default_context == ctx)
                                seq_printf(m, "(default context %s) ",
@@ -1994,6 +1996,8 @@ static int i915_context_status(struct seq_file *m, void 
*unused)
                seq_putc(m, '\n');
        }
 
+       seq_printf(m, "Total: %d contexts\n", count);
+
        mutex_unlock(&dev->struct_mutex);
 
        return 0;
-- 
1.9.1

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

Reply via email to