[Intel-gfx] [PATCH] drm/i915: Finish i915_gem_wait_for_idle() on the global execution timeline
Chris Wilson
chris at chris-wilson.co.uk
Tue Dec 12 14:03:06 UTC 2017
Quoting Chris Wilson (2017-12-11 21:42:22)
> In order to be sure that we catch the most recent request to be
> executed, we need to finish on the global execution timeline. This
> prevents a race where the request is being transferred between timelines
> behind our back, jumping it ahead in the list onto the global execution
> timeline that we have already processed causing us not to wait on that
> request. Document this requirement with an assertion to protect
> ourselves against future changes.
>
> References: 73cb97010d4f ("drm/i915: Combine seqno + tracking into a global timeline struct")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 9e957b213fdb..40db2258eb07 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3566,6 +3566,10 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags)
>
> lockdep_assert_held(&i915->drm.struct_mutex);
>
> + /* Must finish by waiting on the global execution_timeline */
> + GEM_BUG_ON(list_last_entry(&i915->gt.timelines,
> + typeof(*tl), link) !=
> + &i915->gt.global_timeline);
Scratch all that. It's just nice to have, rather than a hard
requirement. We aren't looking at the timeline->requests list, but
timeline->last_request which will not disappear behind our backs.
-Chris
More information about the Intel-gfx
mailing list