mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
wsi/wayland: Init outstanding list earlier.
Fixes a crash if swapchain free is called before the list is
initialized. This only happens when swapchain init fails, so
it is highly unlikely to happen in practical scenarios.
Fixes dEQP-VK.wsi.wayland.swapchain.simulate_oom.min_image_count.
Fixes: 0d51cd4808 ("wsi/wl: Improve fallback for present_wait.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10866
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28325>
This commit is contained in:
parent
2743adac7f
commit
1900617baf
1 changed files with 2 additions and 2 deletions
|
|
@ -2262,6 +2262,8 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
||||||
if (chain == NULL)
|
if (chain == NULL)
|
||||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||||
|
|
||||||
|
wl_list_init(&chain->present_ids.outstanding_list);
|
||||||
|
|
||||||
/* We are taking ownership of the wsi_wl_surface, so remove ownership from
|
/* We are taking ownership of the wsi_wl_surface, so remove ownership from
|
||||||
* oldSwapchain. If the surface is currently owned by a swapchain that is
|
* oldSwapchain. If the surface is currently owned by a swapchain that is
|
||||||
* not oldSwapchain we return an error.
|
* not oldSwapchain we return an error.
|
||||||
|
|
@ -2397,8 +2399,6 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
||||||
}
|
}
|
||||||
pthread_mutex_init(&chain->present_ids.lock, NULL);
|
pthread_mutex_init(&chain->present_ids.lock, NULL);
|
||||||
|
|
||||||
wl_list_init(&chain->present_ids.outstanding_list);
|
|
||||||
|
|
||||||
char *queue_name = vk_asprintf(pAllocator,
|
char *queue_name = vk_asprintf(pAllocator,
|
||||||
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT,
|
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT,
|
||||||
"mesa vk surface %d swapchain %d queue",
|
"mesa vk surface %d swapchain %d queue",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue