Mesa (main): zink: force batch completion check on query result

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 00:05:29 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jul 22 10:51:23 2021 -0400

zink: force batch completion check on query result

non-timeline drivers have no screen-based method of "checking" batch
completion, so the context method has to be used here to avoid an infinite
loop

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

---

 src/gallium/drivers/zink/zink_query.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c
index 89c02a7f27b..08b3723a4f4 100644
--- a/src/gallium/drivers/zink/zink_query.c
+++ b/src/gallium/drivers/zink/zink_query.c
@@ -784,7 +784,10 @@ zink_get_query_result(struct pipe_context *pctx,
          pctx->flush(pctx, NULL, 0);
       if (!wait)
          return false;
-   }
+   } else if (!threaded_query(q)->flushed &&
+              /* timeline drivers can wait during buffer map */
+              !zink_screen(pctx->screen)->info.have_KHR_timeline_semaphore)
+      zink_batch_usage_check_completion(ctx, query->batch_id);
 
    return get_query_result(pctx, q, wait, result);
 }



More information about the mesa-commit mailing list