[Intel-gfx] [PATCH] drm/i915: Workaround to avoid lite restore with HEAD==TAIL
Chris Wilson
chris at chris-wilson.co.uk
Fri Apr 10 03:11:16 PDT 2015
On Fri, Apr 10, 2015 at 12:01:08PM +0200, Daniel Vetter wrote:
> On Fri, Apr 10, 2015 at 10:32:33AM +0100, Michel Thierry wrote:
> > ---
> > drivers/gpu/drm/i915/i915_gem.c | 11 +++++++++++
> > drivers/gpu/drm/i915/intel_lrc.c | 29 +++++++++++++++++++++++++++++
> > 2 files changed, 40 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index ca522c9..a44070a 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -2382,6 +2382,17 @@ int __i915_add_request(struct intel_engine_cs *ring,
> > request->head = request_start;
> > request->tail = intel_ring_get_tail(ringbuf);
> >
> > + if (i915.enable_execlists &&
> > + (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);
> > + }
Move this to gen8_emit_request() and remove the permanent overallocation
in ring_begin. The tail pointer adjustment can then also be localised.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list