Mesa (main): zink: only get swapchain present semaphore on batch flush after acquire

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 8 20:04:09 UTC 2022


Module: Mesa
Branch: main
Commit: 21496dea9ccb7d8c4bd4b28684b6a78f124303d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21496dea9ccb7d8c4bd4b28684b6a78f124303d8

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Apr  8 09:51:57 2022 -0400

zink: only get swapchain present semaphore on batch flush after acquire

otherwise this was a no-op flush from the frontend that should be ignored

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>

---

 src/gallium/drivers/zink/zink_batch.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c
index a3e84a87d53..3382d28b889 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -497,8 +497,10 @@ zink_end_batch(struct zink_context *ctx, struct zink_batch *batch)
    batch->work_count = 0;
 
    if (batch->swapchain) {
-      batch->state->present = zink_kopper_present(screen, batch->swapchain);
-      batch->state->swapchain = batch->swapchain;
+      if (batch->swapchain->obj->acquired) {
+         batch->state->present = zink_kopper_present(screen, batch->swapchain);
+         batch->state->swapchain = batch->swapchain;
+      }
       batch->swapchain = NULL;
    }
 



More information about the mesa-commit mailing list