Re: [PATCH] drm/syncobj: Use dma_fence_wait for the simple wait case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 05, 2018 at 11:55:49AM +0100, Chris Wilson wrote:
> When waiting for a single fence beneath a syncobj, forgo our open coding
> for waiting over multiple fences and call the driver specific
> dma_fence_wait_timeout(). This gives the opportunity for the driver to
> handle it more efficiently then the lcd of signal callbacks, and avoids
> the temporary allocations and array iterations.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

Aside: Do the igts test both the single and multi-case?
-Daniel
> ---
>  drivers/gpu/drm/drm_syncobj.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index d4f4ce484529..c0f787f7a298 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -695,6 +695,14 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
>  	signed long ret;
>  	uint32_t signaled_count, i;
>  
> +	/* KISS for the common case of waiting for a single submitted fence. */
> +	if (count == 1 && (fence = drm_syncobj_fence_get(syncobjs[0]))) {
> +		ret = dma_fence_wait_timeout(fence, true, timeout);
> +		dma_fence_put(fence);
> +		*idx = 0;
> +		return ret;
> +	}
> +
>  	entries = kcalloc(count, sizeof(*entries), GFP_KERNEL);
>  	if (!entries)
>  		return -ENOMEM;
> -- 
> 2.17.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux