All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH 2/6] drm/i915: write only object tracking
Date: Mon, 19 Sep 2011 21:25:02 -0700	[thread overview]
Message-ID: <1316492706-31081-3-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1316492706-31081-1-git-send-email-ben@bwidawsk.net>

Add the struct member to track write only objects, and display them in
our debugfs.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c |   18 +++++++++++++-----
 drivers/gpu/drm/i915/i915_drv.h     |    2 ++
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3c395a5..b0f1964 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -138,12 +138,14 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
 	if (obj->gtt_space != NULL)
 		seq_printf(m, " (gtt offset: %08x, size: %08x)",
 			   obj->gtt_offset, (unsigned int)obj->gtt_space->size);
-	if (obj->pin_mappable || obj->fault_mappable) {
-		char s[3], *t = s;
+	if (obj->pin_mappable || obj->fault_mappable || obj->cpu_write_only) {
+		char s[4], *t = s;
 		if (obj->pin_mappable)
 			*t++ = 'p';
 		if (obj->fault_mappable)
 			*t++ = 'f';
+		if (obj->cpu_write_only)
+			*t++ = 'w';
 		*t = '\0';
 		seq_printf(m, " (%s mappable)", s);
 	}
@@ -224,8 +226,8 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 	struct drm_info_node *node = (struct drm_info_node *) m->private;
 	struct drm_device *dev = node->minor->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	u32 count, mappable_count;
-	size_t size, mappable_size;
+	u32 count, mappable_count, womap_count;
+	size_t size, mappable_size, womap_size;
 	struct drm_i915_gem_object *obj;
 	int ret;
 
@@ -263,7 +265,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 	seq_printf(m, "  %u [%u] freed objects, %zu [%zu] bytes\n",
 		   count, mappable_count, size, mappable_size);
 
-	size = count = mappable_size = mappable_count = 0;
+	size = count = mappable_size = mappable_count = womap_count = womap_size = 0;
 	list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) {
 		if (obj->fault_mappable) {
 			size += obj->gtt_space->size;
@@ -273,11 +275,17 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
 			mappable_size += obj->gtt_space->size;
 			++mappable_count;
 		}
+		if (obj->cpu_write_only) {
+			womap_size += obj->gtt_space->size;
+			++womap_count;
+		}
 	}
 	seq_printf(m, "%u pinned mappable objects, %zu bytes\n",
 		   mappable_count, mappable_size);
 	seq_printf(m, "%u fault mappable objects, %zu bytes\n",
 		   count, size);
+	seq_printf(m, "%u write-only mappable objects, %zu bytes\n",
+		   womap_count, womap_size);
 
 	seq_printf(m, "%zu [%zu] gtt total\n",
 		   dev_priv->mm.gtt_total, dev_priv->mm.mappable_gtt_total);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cee396c..c960763 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -883,6 +883,8 @@ struct drm_i915_gem_object {
 	 * reaches 0, dev_priv->pending_flip_queue will be woken up.
 	 */
 	atomic_t pending_flip;
+
+	int cpu_write_only;
 };
 
 #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
-- 
1.7.6.1

  parent reply	other threads:[~2011-09-20  4:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  4:25 [PATCH 1/6] RFCish: write only mappings (aka non-blocking) Ben Widawsky
2011-09-20  4:25 ` [PATCH 1/6] drm/i915: object CPU flush interface Ben Widawsky
2011-09-20  4:25 ` Ben Widawsky [this message]
2011-09-20  4:25 ` [PATCH 3/6] drm/i915: Support write only mappings Ben Widawsky
2011-09-20  5:29   ` Keith Packard
2011-09-20  5:37     ` Ben Widawsky
2011-09-20  8:30   ` Chris Wilson
2011-09-20  4:25 ` [PATCH 4/6] intel: write only map support Ben Widawsky
2011-09-20  4:25 ` [PATCH 5/6] write-only mappings Ben Widawsky
2011-09-20  4:25 ` [PATCH 6/6] intel: use write only maps for MapRangeBuffer Ben Widawsky
2011-09-20 11:06 ` [PATCH 1/6] RFCish: write only mappings (aka non-blocking) Daniel Vetter
2011-09-20 17:17   ` Eric Anholt
2011-09-20 19:19     ` Daniel Vetter
2011-09-21  8:19       ` [PATCH] intel: non-blocking mmaps on the cheap Daniel Vetter
2011-09-21 18:11         ` Eric Anholt
2011-09-21 19:19           ` Daniel Vetter
2011-09-22  1:47             ` [PATCH cont'd] " Ben Widawsky
2011-09-22  1:47               ` [PATCH] drm/i915: ioctl to query a bo's cache level Ben Widawsky
2011-09-22  7:35                 ` Daniel Vetter
2011-09-22 15:36                   ` Ben Widawsky
2011-09-22 15:49                     ` Chris Wilson
2011-09-22  1:47               ` [PATCH] on top of daniel Ben Widawsky
2011-09-22  7:39                 ` Daniel Vetter
2011-09-22  7:33               ` [PATCH cont'd] intel: non-blocking mmaps on the cheap Daniel Vetter
2011-09-20 21:16   ` [PATCH 1/6] RFCish: write only mappings (aka non-blocking) Chris Wilson
2011-09-21  7:02     ` Daniel Vetter
2011-09-20 22:19   ` Ben Widawsky
2011-09-21  7:07     ` Daniel Vetter

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=1316492706-31081-3-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.