diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-06-15 16:19:00 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-07-28 22:37:02 +0000 |
commit | 7d0fe5863f2f39c93752d330603be24569e4479e (patch) | |
tree | daac49ddbb96df0ee4fc3afb9b86fa2ccf7aefa7 | |
parent | d972326c458b388d8b23f14dcf75ded6285cc007 (diff) |
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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12015>
-rw-r--r-- | src/gallium/drivers/zink/zink_query.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |