drm/i915: Include engine->last_submitted_seqno in GPU error state
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 7 Apr 2016 06:29:10 +0000 (07:29 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Apr 2016 10:42:50 +0000 (11:42 +0100)
It's useful to look at the last seqno submitted on a particular engine
and compare it against the HWS value to check for irregularities.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1460010558-10705-1-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gpu_error.c

index be4bcdcbb1292e58b1f7e42183823889f5b01693..ebbf4e40068423e44bf2f670e16f407b193b454b 100644 (file)
@@ -1363,8 +1363,10 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
 
        for_each_engine_id(engine, dev_priv, id) {
                seq_printf(m, "%s:\n", engine->name);
-               seq_printf(m, "\tseqno = %x [current %x]\n",
-                          engine->hangcheck.seqno, seqno[id]);
+               seq_printf(m, "\tseqno = %x [current %x, last %x]\n",
+                          engine->hangcheck.seqno,
+                          seqno[id],
+                          engine->last_submitted_seqno);
                seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n",
                           (long long)engine->hangcheck.acthd,
                           (long long)acthd[id]);
index 4ebd3ff028031cad96d47b78fe12428d0547e1da..a93e5dd4fa9acbdd78573fb120827ca3977b0d8d 100644 (file)
@@ -495,6 +495,7 @@ struct drm_i915_error_state {
                u32 cpu_ring_head;
                u32 cpu_ring_tail;
 
+               u32 last_seqno;
                u32 semaphore_seqno[I915_NUM_ENGINES - 1];
 
                /* Register state */
index 6d63a2f5575aede44171bb133f2f5ccca9c218bd..ce77713a555d8b5d2751ffce9f82f9cafdf20acc 100644 (file)
@@ -296,6 +296,7 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m,
                }
        }
        err_printf(m, "  seqno: 0x%08x\n", ring->seqno);
+       err_printf(m, "  last_seqno: 0x%08x\n", ring->last_seqno);
        err_printf(m, "  waiting: %s\n", yesno(ring->waiting));
        err_printf(m, "  ring->head: 0x%08x\n", ring->cpu_ring_head);
        err_printf(m, "  ring->tail: 0x%08x\n", ring->cpu_ring_tail);
@@ -932,6 +933,7 @@ static void i915_record_ring_state(struct drm_device *dev,
        ering->instpm = I915_READ(RING_INSTPM(engine->mmio_base));
        ering->seqno = engine->get_seqno(engine, false);
        ering->acthd = intel_ring_get_active_head(engine);
+       ering->last_seqno = engine->last_submitted_seqno;
        ering->start = I915_READ_START(engine);
        ering->head = I915_READ_HEAD(engine);
        ering->tail = I915_READ_TAIL(engine);