From 97baa27dadf6d1df9d1bbaf9f9806a7b219e21dc Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Wed, 22 Apr 2026 13:39:18 +0200 Subject: [PATCH] freedreno/drm/virtio: Fix wait_fence ret ordering ret was read after the timeout check, so breaking on timeout returned 0 instead of the actual fence status, potentially reporting a signaled fence when it was still pending. Fixes: 441f01e7781 ("freedreno/drm/virtio: Drop blocking in host") Signed-off-by: Valentine Burley Part-of: --- src/freedreno/drm/virtio/virtio_pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/drm/virtio/virtio_pipe.c b/src/freedreno/drm/virtio/virtio_pipe.c index 722a53f3d2a..d76b1adabb5 100644 --- a/src/freedreno/drm/virtio/virtio_pipe.c +++ b/src/freedreno/drm/virtio/virtio_pipe.c @@ -138,11 +138,11 @@ virtio_pipe_wait(struct fd_pipe *pipe, const struct fd_fence *fence, uint64_t ti if (ret) goto out; + ret = rsp->ret; + if ((timeout != OS_TIMEOUT_INFINITE) && (os_time_get_nano() >= end_time)) break; - - ret = rsp->ret; } while (ret == -ETIMEDOUT); out: