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>
This commit is contained in:
Mike Blumenkrantz 2021-06-15 16:19:00 -04:00 committed by Marge Bot
parent d972326c45
commit 7d0fe5863f
1 changed files with 3 additions and 0 deletions

View File

@ -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);