summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2023-11-01 00:59:55 +0100
committerEric Engestrom <eric@engestrom.ch>2024-01-03 23:02:44 +0000
commitf4e231dddd75b0670130c9ad70a869759df7acaa (patch)
tree3872366479ada10d495cb35e8572443f9f27ad12
parent6fa1ab1ad0d7184945831081fd9b9a4a5a38e050 (diff)
downloadmesa-f4e231dddd75b0670130c9ad70a869759df7acaa.tar.gz
mesa-f4e231dddd75b0670130c9ad70a869759df7acaa.tar.bz2
mesa-f4e231dddd75b0670130c9ad70a869759df7acaa.zip
zink: lock screen queue on context_destroy and CreateSwapchain
Cc: mesa-stable Signed-off-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25985> (cherry picked from commit 208875516c10f5163d5a7333e2f5fe271fad4ee1)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_context.c2
-rw-r--r--src/gallium/drivers/zink/zink_kopper.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index f8688403255..8ebb6d962cc 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -584,7 +584,7 @@
"description": "zink: lock screen queue on context_destroy and CreateSwapchain",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index b418c6d9d31..c7c0e8ab5c2 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -124,7 +124,9 @@ zink_context_destroy(struct pipe_context *pctx)
if (util_queue_is_initialized(&screen->flush_queue))
util_queue_finish(&screen->flush_queue);
if (ctx->batch.state && !screen->device_lost) {
+ simple_mtx_lock(&screen->queue_lock);
VkResult result = VKSCR(QueueWaitIdle)(screen->queue);
+ simple_mtx_unlock(&screen->queue_lock);
if (result != VK_SUCCESS)
mesa_loge("ZINK: vkQueueWaitIdle failed (%s)", vk_Result_to_str(result));
diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c
index d1e9a57b20f..bda4c206877 100644
--- a/src/gallium/drivers/zink/zink_kopper.c
+++ b/src/gallium/drivers/zink/zink_kopper.c
@@ -318,7 +318,9 @@ kopper_CreateSwapchain(struct zink_screen *screen, struct kopper_displaytarget *
if (error == VK_ERROR_NATIVE_WINDOW_IN_USE_KHR) {
if (util_queue_is_initialized(&screen->flush_queue))
util_queue_finish(&screen->flush_queue);
+ simple_mtx_lock(&screen->queue_lock);
VkResult result = VKSCR(QueueWaitIdle)(screen->queue);
+ simple_mtx_unlock(&screen->queue_lock);
if (result != VK_SUCCESS)
mesa_loge("ZINK: vkQueueWaitIdle failed (%s)", vk_Result_to_str(result));
error = VKSCR(CreateSwapchainKHR)(screen->dev, &cswap->scci, NULL,