[Intel-gfx] [PATCH 43/53] drm/i915/bdw: Make sure error capture keeps working with Execlists

Chris Wilson chris at chris-wilson.co.uk
Fri Jun 13 18:54:04 CEST 2014


On Fri, Jun 13, 2014 at 04:38:01PM +0100, oscar.mateo at intel.com wrote:
> From: Oscar Mateo <oscar.mateo at intel.com>
> 
> Since the ringbuffer does not belong per engine anymore, we have to
> make sure that we are always recording the correct ringbuffer.
> 
> TODO: This is only a small fix to keep basic error capture working, but
> we need to add more information for it to be useful (e.g. dump the
> context being executed).
> 
> Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gpu_error.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 87ec60e..f5897be 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -825,9 +825,6 @@ static void i915_record_ring_state(struct drm_device *dev,
>  		ering->hws = I915_READ(mmio);
>  	}
>  
> -	ering->cpu_ring_head = ring->buffer->head;
> -	ering->cpu_ring_tail = ring->buffer->tail;
> -
>  	ering->hangcheck_score = ring->hangcheck.score;
>  	ering->hangcheck_action = ring->hangcheck.action;
>  
> @@ -887,6 +884,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
>  
>  	for (i = 0; i < I915_NUM_RINGS; i++) {
>  		struct intel_engine_cs *ring = &dev_priv->ring[i];
> +		struct intel_ringbuffer *ringbuf = ring->buffer;
>  
>  		if (ring->dev == NULL)
>  			continue;
> @@ -929,8 +927,18 @@ static void i915_gem_record_rings(struct drm_device *dev,
>  			}
>  		}
>  
> +		if (intel_enable_execlists(dev)) {
> +			if (request)
> +				ringbuf = request->ctx->engine[ring->id].ringbuf;
> +			else
> +				ringbuf = ring->default_context->engine[ring->id].ringbuf;
> +		}
else
  ringbuf = ring->buffer;

That saves me some confusion in only seeing it correctly set along one
branch. Bonus points for a better name than ringbuf, I'd even prefer rb
over ringbuf.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list