From 90b9b1330d0f7627c793b950c737be5333e5230e Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 15 Dec 2022 08:48:00 -0800 Subject: [PATCH] freedreno/drm/virtio: Guest side fence waits Now that fd_fence and fd_submit_fence are unified, we can wait on the fence fd rather than needing to poll the host. Signed-off-by: Rob Clark Part-of: --- src/freedreno/drm/virtio/virtio_pipe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/freedreno/drm/virtio/virtio_pipe.c b/src/freedreno/drm/virtio/virtio_pipe.c index 2c9fd6d..0b2952c 100644 --- a/src/freedreno/drm/virtio/virtio_pipe.c +++ b/src/freedreno/drm/virtio/virtio_pipe.c @@ -21,6 +21,7 @@ * SOFTWARE. */ +#include "util/libsync.h" #include "util/slab.h" #include "freedreno_ringbuffer_sp.h" @@ -120,6 +121,10 @@ static int virtio_pipe_wait(struct fd_pipe *pipe, const struct fd_fence *fence, uint64_t timeout) { MESA_TRACE_FUNC(); + + if (fence->use_fence_fd) + return sync_wait(fence->fence_fd, timeout / 1000000); + struct msm_ccmd_wait_fence_req req = { .hdr = MSM_CCMD(WAIT_FENCE, sizeof(req)), .queue_id = to_virtio_pipe(pipe)->queue_id, -- 2.7.4