diff options
author | Keith Packard <keithp@dulcimer.keithp.com> | 2007-05-20 17:23:26 -0700 |
---|---|---|
committer | Keith Packard <keithp@dulcimer.keithp.com> | 2007-05-23 20:47:52 -0700 |
commit | 2df87256df755e972eb884bc742832038a020b2c (patch) | |
tree | 3c2efb78ca234a9c74fce63c40a8c3a23b6ccbd6 | |
parent | 9971fac87622c93503540196e1756fded3d4869e (diff) |
Dump pending ring on crash.
When the hardware locks up, dump the pending commands in the ring for
analysis.
-rw-r--r-- | src/i830_debug.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/i830_debug.c b/src/i830_debug.c index 73b5d1ce..19eb17a3 100644 --- a/src/i830_debug.c +++ b/src/i830_debug.c @@ -649,6 +649,30 @@ void i830DumpRegs (ScrnInfoPtr pScrn) } #ifndef REG_DUMPER + +#define NUM_RING_DUMP 64 + +static void +i830_dump_ring(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + unsigned int head, tail, ring, mask; + volatile unsigned char *virt; + + head = (INREG (LP_RING + RING_HEAD)) & I830_HEAD_MASK; + tail = INREG (LP_RING + RING_TAIL) & I830_TAIL_MASK; + mask = pI830->LpRing->tail_mask; + + virt = pI830->LpRing->virtual_start; + ErrorF ("Ring at virtual 0x%x head 0x%x tail 0x%x count %d\n", + (unsigned int) virt, head, tail, (((tail + mask + 1) - head) & mask) >> 2); + for (ring = (head - 128) & mask; ring != tail; ring = (ring + 4) & mask) + { + ErrorF ("\t%08x: %08x\n", ring, *(volatile unsigned int *) (virt + ring)); + } + ErrorF ("Ring end\n"); +} + /* Famous last words */ void @@ -678,6 +702,7 @@ i830_dump_error_state(ScrnInfoPtr pScrn) ErrorF("hwstam: %x ier: %x imr: %x iir: %x\n", INREG16(HWSTAM), INREG16(IER), INREG16(IMR), INREG16(IIR)); + i830_dump_ring (pScrn); } void |