[Intel-gfx] [PATCH] drm/i915: Acquire the signaler's timeline HWSP last

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue May 7 10:37:01 UTC 2019


On 03/05/2019 15:02, Chris Wilson wrote:
> Acquiring the signaler's timeline takes an active reference to their
> HWSP that we would like to avoid if possible, so take it after
> performing all of our allocations required to set up the fencing. The
> acquisition also provides the final check that the target has not
> already signaled allowing us to avoid the semaphore at the last moment.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 6dbf8dc5cd6a..933a11677f4a 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -813,13 +813,13 @@ emit_semaphore_wait(struct i915_request *to,
>   	if (err < 0)
>   		return err;
>   
> -	/* We need to pin the signaler's HWSP until we are finished reading. */
> -	err = i915_timeline_read_hwsp(from, to, &hwsp_offset);
> +	/* Only submit our spinner after the signaler is running! */
> +	err = i915_request_await_execution(to, from, gfp);
>   	if (err)
>   		return err;
>   
> -	/* Only submit our spinner after the signaler is running! */
> -	err = i915_request_await_execution(to, from, gfp);
> +	/* We need to pin the signaler's HWSP until we are finished reading. */
> +	err = i915_timeline_read_hwsp(from, to, &hwsp_offset);
>   	if (err)
>   		return err;
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list