[Intel-gfx] [PATCH 1/7] drm/i915: Include engine->last_submitted_seqno in GPU error state

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Apr 6 08:57:07 UTC 2016


On ke, 2016-04-06 at 00:57 +0100, Chris Wilson wrote:
> 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 at chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c   | 6 ++++--
>  drivers/gpu/drm/i915/i915_drv.h       | 1 +
>  drivers/gpu/drm/i915/i915_gpu_error.c | 2 ++
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index a2e3af02c292..906e5424e488 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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]);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 313bc3576d87..fad8e0d5a216 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -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 */
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 9b55409d91b3..9463cb4e9323 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -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);
> @@ -931,6 +932,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);
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list