mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
wsi/wl: flush connection on swapchain failure
wayland-client stores up to MAX_FDS_OUT (28) outgoing fds and then release them in batch later through close_fds. While this is not a problem in normal situation, because the app would also have a reference to the same buffers, this is an issue when these buffers are released (eg: because the swapchain creation failed). In this situation wayland-client owns the last ref to these buffers and prevent their deletion. This is an issue with dEQP-VK.wsi.wayland.swapchain.simulate_oom.image_extent because it creates swapchains in a fast loop with a failing allocator to fail the swapchain creation. Without this change, on a 16GB dGPU the test peaks at 95% VRAM / 60% GTT and completes in 1.5 sec. With this change, the max usage is 65% VRAM / 10% GTT and completes it in 0.3 sec. Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27592>
This commit is contained in:
parent
f9787864e0
commit
9a00a360ad
1 changed files with 6 additions and 0 deletions
|
|
@ -2222,6 +2222,12 @@ static void
|
|||
wsi_wl_swapchain_chain_free(struct wsi_wl_swapchain *chain,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
/* Force wayland-client to release fd sent during the swapchain
|
||||
* creation (see MAX_FDS_OUT) to avoid filling up VRAM with
|
||||
* released buffers.
|
||||
*/
|
||||
wl_display_flush(chain->wsi_wl_surface->display->wl_display);
|
||||
|
||||
if (chain->frame)
|
||||
wl_callback_destroy(chain->frame);
|
||||
if (chain->tearing_control)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue