From: Ben Widawsky <ben@bwidawsk.net>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH] drm/i915: PPGTT dump for debug
Date: Mon, 24 Jun 2013 10:01:33 -0700 [thread overview]
Message-ID: <1372093293-27986-2-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1372093293-27986-1-git-send-email-ben@bwidawsk.net>
No users yet
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 893007a..005358f 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -99,6 +99,37 @@ static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr,
return pte;
}
+void gen6_dump_ppgtt(struct i915_hw_ppgtt *ppgtt)
+{
+ struct drm_i915_private *dev_priv = ppgtt->base.dev->dev_private;
+ gen6_gtt_pte_t __iomem *pd_addr;
+ uint32_t pd_entry;
+ int i, j;
+
+ pd_addr = (gen6_gtt_pte_t __iomem*)dev_priv->gtt.gsm +
+ ppgtt->pd_offset / sizeof(gen6_gtt_pte_t);
+
+ for (i = 0; i < ppgtt->num_pd_entries; i++) {
+ gen6_gtt_pte_t *pt_vaddr;
+ dma_addr_t pt_addr = ppgtt->pt_dma_addr[i];
+ pd_entry = readl(pd_addr + i);
+
+ if (pd_entry != (u32)(GEN6_PDE_ADDR_ENCODE(pt_addr) | GEN6_PDE_VALID))
+ DRM_ERROR("Actual PDE: %x Expected PDE: %x",
+ pd_entry,
+ (u32)(GEN6_PDE_ADDR_ENCODE(pt_addr) | GEN6_PDE_VALID));
+
+ pt_vaddr = kmap_atomic(ppgtt->pt_pages[i]);
+ for (j = 0; j < I915_PPGTT_PT_ENTRIES; j++) {
+ gen6_gtt_pte_t scratch_pte =
+ ppgtt->base.pte_encode(ppgtt->base.scratch.addr,
+ I915_CACHE_LLC);
+ if (pt_vaddr[j] != scratch_pte)
+ DRM_ERROR("\tPTE = %x (%d %d)", pt_vaddr[j], i,j);
+ }
+ kunmap_atomic(pt_vaddr);
+ }
+}
static void gen6_write_pdes(struct i915_hw_ppgtt *ppgtt)
{
--
1.8.3.1
next prev parent reply other threads:[~2013-06-24 16:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 17:01 [PATCH] drm/i915: Fix context sizes on HSW Ben Widawsky
2013-06-24 17:01 ` Ben Widawsky [this message]
2013-06-24 16:59 ` [PATCH] drm/i915: PPGTT dump for debug Ben Widawsky
2013-06-24 22:17 ` [PATCH] [v2] drm/i915: Fix context sizes on HSW Ben Widawsky
2013-06-25 21:59 ` [Intel-gfx] " Jesse Barnes
2013-06-26 4:53 ` [PATCH] [v3] " Ben Widawsky
2013-06-27 17:40 ` [Intel-gfx] " 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=1372093293-27986-2-git-send-email-ben@bwidawsk.net \
--to=ben@bwidawsk.net \
--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