Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bradley.d.volkin@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [RFC 3/4] drm/i915: Add a batch pool debugfs file
Date: Wed, 18 Jun 2014 09:36:15 -0700	[thread overview]
Message-ID: <1403109376-23452-4-git-send-email-bradley.d.volkin@intel.com> (raw)
In-Reply-To: <1403109376-23452-1-git-send-email-bradley.d.volkin@intel.com>

From: Brad Volkin <bradley.d.volkin@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.volkin@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

  parent reply	other threads:[~2014-06-18 16:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 16:36 [RFC 0/4] Command parser batch buffer copy bradley.d.volkin
2014-06-18 16:36 ` [RFC 1/4] drm/i915: Implement a framework for batch buffer pools bradley.d.volkin
2014-06-19  9:48   ` Tvrtko Ursulin
2014-06-19 17:35     ` Volkin, Bradley D
2014-06-19 19:07       ` Daniel Vetter
2014-06-20 13:25       ` Tvrtko Ursulin
2014-06-20 15:30         ` Volkin, Bradley D
2014-06-20 15:41           ` Tvrtko Ursulin
2014-06-20 16:06             ` Volkin, Bradley D
2014-06-18 16:36 ` [RFC 2/4] drm/i915: Use batch pools with the command parser bradley.d.volkin
2014-06-18 16:52   ` Chris Wilson
2014-06-18 17:49     ` Volkin, Bradley D
2014-06-18 18:11       ` Chris Wilson
2014-06-18 19:59         ` Daniel Vetter
2014-06-18 16:36 ` bradley.d.volkin [this message]
2014-06-18 16:36 ` [RFC 4/4] drm/i915: Dispatch the shadow batch buffer bradley.d.volkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403109376-23452-4-git-send-email-bradley.d.volkin@intel.com \
    --to=bradley.d.volkin@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox