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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
This commit is contained in:
Rob Clark 2022-12-15 11:14:58 -08:00 committed by Marge Bot
parent 90b9b1330d
commit a9cdbed5a2

View file

@ -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);