Mesa (main): zink: force threadsafe mapping for query results when necessary

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 22:48:43 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jun 15 16:19:00 2021 -0400

zink: force threadsafe mapping for query results when necessary

this would otherwise use the ctx-based slab allocator, which races
and crashes

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

---

 src/gallium/drivers/zink/zink_query.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c
index f1082236192..b30bf2c767d 100644
--- a/src/gallium/drivers/zink/zink_query.c
+++ b/src/gallium/drivers/zink/zink_query.c
@@ -432,6 +432,9 @@ get_query_result(struct pipe_context *pctx,
 
    if (!wait)
       flags |= PIPE_MAP_DONTBLOCK;
+   if (query->base.flushed)
+      /* this is not a context-safe operation; ensure map doesn't use slab alloc */
+      flags |= PIPE_MAP_THREAD_SAFE | PIPE_MAP_UNSYNCHRONIZED;
 
    util_query_clear_result(result, query->type);
 



More information about the mesa-commit mailing list