[Intel-gfx] [PATCH v2] drm/i915: Workaround to avoid lite restore with HEAD==TAIL

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 14 23:49:30 PDT 2015


On Tue, Apr 14, 2015 at 04:41:24PM +0100, Michel Thierry wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 6dd0d57..dc94984 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2364,14 +2364,27 @@ int __i915_add_request(struct intel_engine_cs *ring,
>  		ret = ring->emit_request(ringbuf, request);
>  		if (ret)
>  			return ret;
> +
> +		request->tail = intel_ring_get_tail(ringbuf);
> +
> +		if (IS_GEN8(ring->dev) || IS_GEN9(ring->dev)) {
> +			/*
> +			 * Here we add two extra NOOPs as padding to avoid
> +			 * lite restore of a context with HEAD==TAIL.
> +			 */
> +			intel_logical_ring_emit(ringbuf, MI_NOOP);
> +			intel_logical_ring_emit(ringbuf, MI_NOOP);
> +			intel_logical_ring_advance(ringbuf);
> +		}

But you are still doing the dance here inside gem, not as a quirk of the
backend. This can be moved to advance_and_submit - needs to since
otherwise the logic is now split between two "independent" units.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list