[PATCH 2/2] dma-buf/fence: don't wait when specified timeout is zero
Christian König
christian.koenig at amd.com
Wed Jan 21 03:09:25 PST 2015
Am 21.01.2015 um 11:35 schrieb Jammy Zhou:
> When specified timeout is zero for fence_wait_timeout, just check if the fence
> is signaled or not without wait.
>
> Signed-off-by: Jammy Zhou <Jammy.Zhou at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/dma-buf/fence.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/dma-buf/fence.c b/drivers/dma-buf/fence.c
> index e554111..50ef8bd 100644
> --- a/drivers/dma-buf/fence.c
> +++ b/drivers/dma-buf/fence.c
> @@ -159,6 +159,9 @@ fence_wait_timeout(struct fence *fence, bool intr, signed long timeout)
> if (WARN_ON(timeout < 0))
> return -EINVAL;
>
> + if (timeout == 0)
> + return fence_is_signaled(fence);
> +
> trace_fence_wait_start(fence);
> ret = fence->ops->wait(fence, intr, timeout);
> trace_fence_wait_end(fence);
More information about the dri-devel
mailing list