]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: add per-ring fault reg to error_state
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 14 Dec 2011 12:57:39 +0000 (13:57 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 29 Jan 2012 22:17:52 +0000 (23:17 +0100)
This was pretty handy when figuring out what exactly went wrong with
ppgtt and it might also be useful when we stop filling the entire gart
with scratch page entries.

Also add the gen6+ DONE reg while at it.

v2: Chris Wilson suggested to allocate the error_state with kzalloc
for better paranoia. Also kill existing spurious clears of the
error_state while at it.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_reg.h

index f0486059e44e9b1191c861bc4cf4984b973b59c1..d4104904e58b03a473d004518f28cd5e8f3820d1 100644 (file)
@@ -718,8 +718,10 @@ static void i915_ring_error_state(struct seq_file *m,
        if (INTEL_INFO(dev)->gen >= 4)
                seq_printf(m, "  INSTPS: 0x%08x\n", error->instps[ring]);
        seq_printf(m, "  INSTPM: 0x%08x\n", error->instpm[ring]);
-       if (INTEL_INFO(dev)->gen >= 6)
+       if (INTEL_INFO(dev)->gen >= 6) {
                seq_printf(m, "  FADDR: 0x%08x\n", error->faddr[ring]);
+               seq_printf(m, "  FAULT_REG: 0x%08x\n", error->fault_reg[ring]);
+       }
        seq_printf(m, "  seqno: 0x%08x\n", error->seqno[ring]);
 }
 
@@ -749,8 +751,10 @@ static int i915_error_state(struct seq_file *m, void *unused)
        for (i = 0; i < dev_priv->num_fence_regs; i++)
                seq_printf(m, "  fence[%d] = %08llx\n", i, error->fence[i]);
 
-       if (INTEL_INFO(dev)->gen >= 6) 
+       if (INTEL_INFO(dev)->gen >= 6) {
                seq_printf(m, "ERROR: 0x%08x\n", error->error);
+               seq_printf(m, "DONE_REG: 0x%08x\n", error->done_reg);
+       }
 
        i915_ring_error_state(m, dev, error, RCS);
        if (HAS_BLT(dev))
index 12e8cce79289e36e57c638bac2c33d01fd43ee9a..865de800756d94508a322c8b3b190e03fc0a322c 100644 (file)
@@ -165,6 +165,8 @@ struct drm_i915_error_state {
        u32 instdone1;
        u32 seqno[I915_NUM_RINGS];
        u64 bbaddr;
+       u32 fault_reg[I915_NUM_RINGS];
+       u32 done_reg;
        u32 faddr[I915_NUM_RINGS];
        u64 fence[I915_MAX_NUM_FENCES];
        struct timeval time;
index 4dedb31480664b52c2a6dc758a1b6784bbf0fb29..64bb2127911e0771ce0d0ef9c2014882571c1d6f 100644 (file)
@@ -882,8 +882,10 @@ static void i915_record_ring_state(struct drm_device *dev,
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
 
-       if (INTEL_INFO(dev)->gen >= 6)
+       if (INTEL_INFO(dev)->gen >= 6) {
                error->faddr[ring->id] = I915_READ(RING_DMA_FADD(ring->mmio_base));
+               error->fault_reg[ring->id] = I915_READ(RING_FAULT_REG(ring));
+       }
 
        if (INTEL_INFO(dev)->gen >= 4) {
                error->ipeir[ring->id] = I915_READ(RING_IPEIR(ring->mmio_base));
@@ -898,7 +900,6 @@ static void i915_record_ring_state(struct drm_device *dev,
                error->ipeir[ring->id] = I915_READ(IPEIR);
                error->ipehr[ring->id] = I915_READ(IPEHR);
                error->instdone[ring->id] = I915_READ(INSTDONE);
-               error->bbaddr = 0;
        }
 
        error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base));
@@ -932,7 +933,7 @@ static void i915_capture_error_state(struct drm_device *dev)
                return;
 
        /* Account for pipe specific data like PIPE*STAT */
-       error = kmalloc(sizeof(*error), GFP_ATOMIC);
+       error = kzalloc(sizeof(*error), GFP_ATOMIC);
        if (!error) {
                DRM_DEBUG_DRIVER("out of memory, not capturing error state\n");
                return;
@@ -946,10 +947,10 @@ static void i915_capture_error_state(struct drm_device *dev)
        for_each_pipe(pipe)
                error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
 
-       if (INTEL_INFO(dev)->gen >= 6)
+       if (INTEL_INFO(dev)->gen >= 6) {
                error->error = I915_READ(ERROR_GEN6);
-       else
-               error->error = 0;
+               error->done_reg = I915_READ(DONE_REG);
+       }
 
        i915_record_ring_state(dev, error, &dev_priv->ring[RCS]);
        if (HAS_BLT(dev))
index d107a1d756a8977c7e7d53515c828280ed954fca..f9607387c00c675cb935648e11413c34792a4178 100644 (file)
 #define RING_HWS_PGA(base)     ((base)+0x80)
 #define RING_HWS_PGA_GEN6(base)        ((base)+0x2080)
 #define RENDER_HWS_PGA_GEN7    (0x04080)
+#define RING_FAULT_REG(ring)   (0x4094 + 0x100*(ring)->id)
+#define DONE_REG               0x40b0
 #define BSD_HWS_PGA_GEN7       (0x04180)
 #define BLT_HWS_PGA_GEN7       (0x04280)
 #define RING_ACTHD(base)       ((base)+0x74)