Dump some useful info when a PGRAPH error occurs.
authorBen Skeggs <darktama@iinet.net.au>
Thu, 16 Nov 2006 21:05:23 +0000 (08:05 +1100)
committerBen Skeggs <darktama@iinet.net.au>
Thu, 16 Nov 2006 21:05:23 +0000 (08:05 +1100)
The "channel" detect doesn't work on my nv40, but the rest
seems to produce sane info.

shared-core/nouveau_fifo.c
shared-core/nouveau_irq.c

index c662165..73c4e9f 100644 (file)
@@ -536,7 +536,7 @@ void nouveau_fifo_cleanup(drm_device_t* dev, DRMFILE filp)
 
        DRM_DEBUG("clearing FIFO enables from filp\n");
        for(i=0;i<nouveau_fifo_number(dev);i++)
-               if (dev_priv->fifos[i].filp==filp)
+               if (dev_priv->fifos[i].used && dev_priv->fifos[i].filp==filp)
                        nouveau_fifo_free(dev,i);
 
        /* check we still point at an active channel */
index 6de4a5e..9131125 100644 (file)
@@ -306,8 +306,33 @@ static void nouveau_pgraph_irq_handler(drm_device_t *dev)
        }
 
        if (status & NV_PGRAPH_INTR_ERROR) {
+               uint32_t nsource, nstatus, instance;
+               uint32_t address;
+               uint32_t channel;
+               uint32_t method, subc, data;
+
                DRM_ERROR("NV: PGRAPH error interrupt\n");
 
+               nstatus = NV_READ(0x00400104);
+               nsource = NV_READ(0x00400108);
+               DRM_DEBUG("nsource:0x%08x\tnstatus:0x%08x\n", nsource, nstatus);
+
+               instance = NV_READ(0x00400158);
+               DRM_DEBUG("instance:0x%08x\n", instance);
+
+               address = NV_READ(0x400704);
+               data    = NV_READ(0x400708);
+               channel = (address >> 20) & 0x1F;
+               subc    = (address >> 16) & 0x7;
+               method  = address & 0x1FFC;
+               DRM_DEBUG("NV: 0x400704 = 0x%08x\n", address);
+               DRM_ERROR("NV: Channel %d/%d (class 0x%04x) -"
+                         "Method 0x%04x, Data 0x%08x\n",
+                               channel, subc,
+                               NV_READ(0x400160+subc*4) & 0xFFFF,
+                               method, data
+                        );
+
                status &= ~NV_PGRAPH_INTR_ERROR;
                NV_WRITE(NV_PGRAPH_INTSTAT, NV_PGRAPH_INTR_ERROR);
        }