dma-buf/fence: don't wait when specified timeout is zero
authorJammy Zhou <Jammy.Zhou@amd.com>
Wed, 21 Jan 2015 10:35:48 +0000 (18:35 +0800)
committerSumit Semwal <sumit.semwal@linaro.org>
Thu, 22 Jan 2015 05:58:51 +0000 (11:28 +0530)
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@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-By: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
drivers/dma-buf/fence.c

index e5541117b3e915de7f08ecc38a58ec9f72bf2c12..50ef8bd8708ba69d93808510c9a8be473d377d7c 100644 (file)
@@ -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);
This page took 0.026864 seconds and 5 git commands to generate.