drm/i915: ppgtt debugfs info
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Feb 2012 16:15:49 +0000 (17:15 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Feb 2012 20:27:06 +0000 (21:27 +0100)
This was pretty usefull for debugging, might be useful for diagnosing
issues.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c

index f3fe2f872d5a96a494004c237a7a3275efca7161..5d24581452ebcdadd6878c35b9f25221443fd477 100644 (file)
@@ -1447,6 +1447,43 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
        return 0;
 }
 
+static int i915_ppgtt_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;
+       struct intel_ring_buffer *ring;
+       int i, ret;
+
+
+       ret = mutex_lock_interruptible(&dev->struct_mutex);
+       if (ret)
+               return ret;
+       if (INTEL_INFO(dev)->gen == 6)
+               seq_printf(m, "GFX_MODE: 0x%08x\n", I915_READ(GFX_MODE));
+
+       for (i = 0; i < I915_NUM_RINGS; i++) {
+               ring = &dev_priv->ring[i];
+
+               seq_printf(m, "%s\n", ring->name);
+               if (INTEL_INFO(dev)->gen == 7)
+                       seq_printf(m, "GFX_MODE: 0x%08x\n", I915_READ(RING_MODE_GEN7(ring)));
+               seq_printf(m, "PP_DIR_BASE: 0x%08x\n", I915_READ(RING_PP_DIR_BASE(ring)));
+               seq_printf(m, "PP_DIR_BASE_READ: 0x%08x\n", I915_READ(RING_PP_DIR_BASE_READ(ring)));
+               seq_printf(m, "PP_DIR_DCLV: 0x%08x\n", I915_READ(RING_PP_DIR_DCLV(ring)));
+       }
+       if (dev_priv->mm.aliasing_ppgtt) {
+               struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
+
+               seq_printf(m, "aliasing PPGTT:\n");
+               seq_printf(m, "pd gtt offset: 0x%08x\n", ppgtt->pd_offset);
+       }
+       seq_printf(m, "ECOCHK: 0x%08x\n", I915_READ(GAM_ECOCHK));
+       mutex_unlock(&dev->struct_mutex);
+
+       return 0;
+}
+
 static int
 i915_debugfs_common_open(struct inode *inode,
                         struct file *filp)
@@ -1788,6 +1825,7 @@ static struct drm_info_list i915_debugfs_list[] = {
        {"i915_context_status", i915_context_status, 0},
        {"i915_gen6_forcewake_count", i915_gen6_forcewake_count_info, 0},
        {"i915_swizzle_info", i915_swizzle_info, 0},
+       {"i915_ppgtt_info", i915_ppgtt_info, 0},
 };
 #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)