From: Rob Clark Date: Thu, 15 Dec 2022 19:14:58 +0000 (-0800) Subject: freedreno/drm: Short-circuit kernel for timeout=0 waits X-Git-Tag: upstream/23.3.3~15342 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9cdbed5a287f9ac6458976e1fe81c191bd2c7de;p=platform%2Fupstream%2Fmesa.git freedreno/drm: Short-circuit kernel for timeout=0 waits We already know from the userspace fence whether the fence has signaled or not. No need to do a syscall if we aren't going to wait. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/drm/freedreno_pipe.c b/src/freedreno/drm/freedreno_pipe.c index b81b290..75b16d8 100644 --- a/src/freedreno/drm/freedreno_pipe.c +++ b/src/freedreno/drm/freedreno_pipe.c @@ -192,6 +192,9 @@ fd_pipe_wait_timeout(struct fd_pipe *pipe, const struct fd_fence *fence, if (!fd_fence_after(fence->ufence, pipe->control->fence)) return 0; + if (!timeout) + return -ETIMEDOUT; + fd_pipe_flush(pipe, fence->ufence); return pipe->funcs->wait(pipe, fence, timeout);