[Intel-gfx] [PATCH] drm/i915: Make wa_tail_dwords flexible for future platforms.

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 25 13:17:15 PST 2016


On Mon, Jan 25, 2016 at 11:29:19AM -0800, Rodrigo Vivi wrote:
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -764,18 +764,18 @@ intel_logical_ring_advance_and_submit(struct drm_i915_gem_request *request)
>  {
>  	struct intel_ringbuffer *ringbuf = request->ringbuf;
>  	struct drm_i915_private *dev_priv = request->i915;
> +	int i;
>  
>  	intel_logical_ring_advance(ringbuf);
>  	request->tail = ringbuf->tail;
>  
>  	/*
> -	 * Here we add two extra NOOPs as padding to avoid
> +	 * Here we add extra NOOPs as padding to avoid
>  	 * lite restore of a context with HEAD==TAIL.
> -	 *
> -	 * Caller must reserve WA_TAIL_DWORDS for us!
>  	 */
> -	intel_logical_ring_emit(ringbuf, MI_NOOP);
> -	intel_logical_ring_emit(ringbuf, MI_NOOP);
> +	for (i = 0; i < ringbuf->wa_tail_dwords; i++)
> +		intel_logical_ring_emit(ringbuf, MI_NOOP);
> +
>  	intel_logical_ring_advance(ringbuf);
>  
>  	if (intel_ring_stopped(request->ring))
> @@ -876,6 +876,16 @@ int intel_logical_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
>  	if (ret)
>  		return ret;
>  
> +	if (IS_GEN8(req->ring->dev) || IS_GEN9(req->ring->dev))

req->i915

This is attrocious. Just allocate the extra space when required.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list