vulkan/wsi/wayland: use mtx helpers in wait_for_present2

present_ids.lock is a mtx_t object, and the rest of the file already
uses mtx_(un)lock helpers.

Fixes: 3023f31cad ("wsi/wayland: Add support for PresentWait2")
Signed-off-by: llyyr <llyyr.public@gmail.com>
(cherry picked from commit b11f0ce609)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
This commit is contained in:
llyyr 2026-05-11 20:46:56 +05:30 committed by Eric Engestrom
parent 287987ffc8
commit a6e63d01e8
2 changed files with 4 additions and 4 deletions

View file

@ -724,7 +724,7 @@
"description": "vulkan/wsi/wayland: use mtx helpers in wait_for_present2",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "3023f31cadc9a384f0d72832bfca5e05ce0ce89c",
"notes": null

View file

@ -2701,12 +2701,12 @@ wsi_wl_swapchain_wait_for_present2(struct wsi_swapchain *wsi_chain,
return result;
while (1) {
err = pthread_mutex_lock(&chain->present_ids.lock);
if (err != 0)
err = mtx_lock(&chain->present_ids.lock);
if (err != thrd_success)
return VK_ERROR_OUT_OF_DATE_KHR;
bool completed = chain->present_ids.max_completed >= present_id;
pthread_mutex_unlock(&chain->present_ids.lock);
mtx_unlock(&chain->present_ids.lock);
if (completed)
return VK_SUCCESS;