All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/gma500: Add debugging info to psb_gtt_restore()
Date: Tue, 16 Apr 2013 03:19:00 +0200	[thread overview]
Message-ID: <1366075140-6750-2-git-send-email-patrik.r.jakobsson@gmail.com> (raw)

This makes it easier to see what's going on during resume/restore.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
---
 drivers/gpu/drm/gma500/gtt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index 2f12faf..01e3242 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -563,6 +563,7 @@ int psb_gtt_restore(struct drm_device *dev)
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	struct resource *r = dev_priv->gtt_mem->child;
 	struct gtt_range *range;
+	unsigned int restored = 0, total = 0, size = 0;
 
 	/* On resume, the gtt_mutex is already initialized */
 	mutex_lock(&dev_priv->gtt_mutex);
@@ -570,11 +571,17 @@ int psb_gtt_restore(struct drm_device *dev)
 
 	while (r != NULL) {
 		range = container_of(r, struct gtt_range, resource);
-		if (range->pages)
+		if (range->pages) {
 			psb_gtt_insert(dev, range, 1);
+			size += range->resource.end - range->resource.start;
+			restored++;
+		}
 		r = r->sibling;
+		total++;
 	}
 	mutex_unlock(&dev_priv->gtt_mutex);
+	DRM_DEBUG_DRIVER("Restored %u of %u gtt ranges (%u KB)", restored,
+			 total, (size / 1024));
 
 	return 0;
 }
-- 
1.8.1.2

                 reply	other threads:[~2013-04-16  1:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1366075140-6750-2-git-send-email-patrik.r.jakobsson@gmail.com \
    --to=patrik.r.jakobsson@gmail.com \
    --cc=dri-devel@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.