[Intel-gfx] [PATCH v4] drm/i915: Advance ring->head fully when idle

Chris Wilson chris at chris-wilson.co.uk
Fri Apr 7 09:15:02 UTC 2017


On Fri, Apr 07, 2017 at 10:25:13AM +0300, Joonas Lahtinen wrote:
> On to, 2017-04-06 at 18:00 +0100, Chris Wilson wrote:
> > When we retire the last request on the ring, before we ever access that
> > ring again we know it will be completely idle and so we can advance the
> > ring->head fully to the end (i.e. ring->tail) and not just to the start
> > of the breadcrumb. This allows us to skip re-emitting the breadcrumb
> > after resetting the GPU if the ring was entirely idle. This prevents us
> > from overwriting a seqno wraparound by re-executing a stale breadcrumb,
> > i.e.
> > 	submit_request(1)
> > 	intel_engine_init_global_seqno(0)
> > 	i915_reset()
> > would then leave 1 in the HWS, but the next request to execute would
> > also be with seqno 1. The sanity checks upon submission detect this as a
> > timewarp and explode. By setting the ring as empty, upon reset the HWS
> > is left as 0, leaving it consistent with the timeline.
> > 
> > v2: Fix check for deleting last element of list. We know that this
> > request is always the first element of the ring, so only if next
> > points back to the start will this be the only request in flight.
> > v3: Remove opencoding of list_is_last()
> > v4: Move the block to its own function for some clarity.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100144
> > Testcase: igt/gem_exec_whisper/hang-*
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Thanks for the review, and pushed. One more mysterious reset fix done.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list