From: Brad Volkin <bradley.d.vol...@intel.com>

It provides some useful information about the buffers in
the per-ring command parser batch pools.

Signed-off-by: Brad Volkin <bradley.d.vol...@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 48 +++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 76c2572..a930313 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -564,6 +564,53 @@ static int i915_gem_pageflip_info(struct seq_file *m, void 
*data)
        return 0;
 }
 
+static int i915_gem_batch_pool_info(struct seq_file *m, void *data)
+{
+       struct drm_info_node *node = m->private;
+       struct drm_device *dev = node->minor->dev;
+       struct drm_i915_private *dev_priv = dev->dev_private;
+       struct intel_engine_cs *ring;
+       struct drm_i915_gem_object *obj;
+       int count;
+       int ret, i;
+
+       ret = mutex_lock_interruptible(&dev->struct_mutex);
+       if (ret)
+               return ret;
+
+       for_each_ring(ring, dev_priv, i) {
+               count = 0;
+
+               seq_printf(m, "%s pool:\n", ring->name);
+
+               seq_puts(m, " active:\n");
+               list_for_each_entry(obj,
+                                   &ring->batch_pool->active_list,
+                                   batch_pool_list) {
+                       seq_puts(m, "   ");
+                       describe_obj(m, obj);
+                       seq_putc(m, '\n');
+                       count++;
+               }
+
+               seq_puts(m, " inactive:\n");
+               list_for_each_entry(obj,
+                                   &ring->batch_pool->inactive_list,
+                                   batch_pool_list) {
+                       seq_puts(m, "   ");
+                       describe_obj(m, obj);
+                       seq_putc(m, '\n');
+                       count++;
+               }
+
+               seq_printf(m, " total: %d\n", count);
+       }
+
+       mutex_unlock(&dev->struct_mutex);
+
+       return 0;
+}
+
 static int i915_gem_request_info(struct seq_file *m, void *data)
 {
        struct drm_info_node *node = m->private;
@@ -3811,6 +3858,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
        {"i915_gem_hws_blt", i915_hws_info, 0, (void *)BCS},
        {"i915_gem_hws_bsd", i915_hws_info, 0, (void *)VCS},
        {"i915_gem_hws_vebox", i915_hws_info, 0, (void *)VECS},
+       {"i915_gem_batch_pool", i915_gem_batch_pool_info, 0},
        {"i915_rstdby_delays", i915_rstdby_delays, 0},
        {"i915_frequency_info", i915_frequency_info, 0},
        {"i915_delayfreq_table", i915_delayfreq_table, 0},
-- 
1.8.3.2

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

Reply via email to