From df7aa1241b60203171e35be862e56942ad294eba 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 (cherry picked from commit 97baa27dadf6d1df9d1bbaf9f9806a7b219e21dc) Part-of: --- .pick_status.json | 2 +- src/freedreno/drm/virtio/virtio_pipe.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7a8d826e822..e0e06d050bf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2484,7 +2484,7 @@ "description": "freedreno/drm/virtio: Fix wait_fence ret ordering", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "441f01e778184be8e5f99d3c40f47ee49402dd03", "notes": null 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: