[Intel-gfx] [PATCH 2/2] drm/i915: Remove the timeline as the last step of retiring

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Nov 20 16:07:14 UTC 2019


On 20/11/2019 15:21, Chris Wilson wrote:
> Before we remove from the timeline, finish flushing the context state.
> As the timeline may be peeked upon by another CPU, we don't want to
> remove request from the timeline until we have finished working on it.

I have to ask why I'm afraid.

Regards,

Tvrtko

> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 00011f9533b6..2445a0693287 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -269,12 +269,13 @@ bool i915_request_retire(struct i915_request *rq)
>   	GEM_BUG_ON(!list_empty(&rq->execute_cb));
>   	spin_unlock_irq(&rq->lock);
>   
> -	remove_from_client(rq);
> -	list_del(&rq->link);
> -
>   	intel_context_exit(rq->hw_context);
>   	intel_context_unpin(rq->hw_context);
>   
> +	/* And finally after flushing the state, remove from prying eyes. */
> +	remove_from_client(rq);
> +	list_del(&rq->link);
> +
>   	free_capture_list(rq);
>   	i915_sched_node_fini(&rq->sched);
>   	i915_request_put(rq);
> 


More information about the Intel-gfx mailing list