From 1cd60fb2c7f2b6649e09a29be6181242d19cc220 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Thu, 11 Jul 2024 18:17:46 +0900 Subject: [PATCH] asahi: Fix non-async flush As far as I can tell, we're actually supposed to do a full sync here if ASYNC or DEFERRED are not specified. Signed-off-by: Asahi Lina Part-of: --- src/gallium/drivers/asahi/agx_pipe.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index b3b3d29850a..cf9d8a83a24 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -1557,6 +1557,15 @@ agx_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, agx_flush_all(ctx, "Gallium flush"); + if (!(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC))) { + agx_sync_all(ctx, "Gallium sync flush"); + + if (fence) + *fence = NULL; + + return; + } + /* At this point all pending work has been submitted. Since jobs are * started and completed sequentially from a UAPI perspective, and since * we submit all jobs with compute+render barriers on the prior job,