vulkan/wsi/x11: make 4 image minimum for xwayland driver-specific

this avoids adding extra frames of latency to drivers that don't need
it

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
This commit is contained in:
Mike Blumenkrantz
2023-02-21 08:42:58 -05:00
committed by Marge Bot
parent 7c8a5f6e37
commit c1a62476ac
4 changed files with 8 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ vn_wsi_init(struct vn_physical_device *physical_dev)
VkResult result = wsi_device_init(
&physical_dev->wsi_device, vn_physical_device_to_handle(physical_dev),
vn_wsi_proc_addr, alloc, -1, &physical_dev->instance->dri_options,
&(struct wsi_device_options){.sw_device = false});
&(struct wsi_device_options){.sw_device = false, .extra_xwayland_image = true});
if (result != VK_SUCCESS)
return result;

View File

@@ -81,6 +81,7 @@ wsi_device_init(struct wsi_device *wsi,
wsi->supports_scanout = true;
wsi->sw = device_options->sw_device || (WSI_DEBUG & WSI_DEBUG_SW);
wsi->wants_linear = (WSI_DEBUG & WSI_DEBUG_LINEAR) != 0;
wsi->x11.extra_xwayland_image = device_options->extra_xwayland_image;
#define WSI_GET_CB(func) \
PFN_vk##func func = (PFN_vk##func)proc_addr(pdevice, "vk" #func)
WSI_GET_CB(GetPhysicalDeviceExternalSemaphoreProperties);

View File

@@ -145,6 +145,9 @@ struct wsi_device {
* true.
*/
bool xwaylandWaitReady;
/* adds an extra minImageCount when running under xwayland */
bool extra_xwayland_image;
} x11;
struct {
@@ -257,6 +260,7 @@ typedef PFN_vkVoidFunction (VKAPI_PTR *WSI_FN_GetPhysicalDeviceProcAddr)(VkPhysi
struct wsi_device_options {
bool sw_device;
bool extra_xwayland_image;
};
VkResult

View File

@@ -652,10 +652,10 @@ x11_get_min_image_count(const struct wsi_device *wsi_device, bool is_xwayland)
* This is a tradeoff as it uses more memory than needed for non-fullscreen
* and non-performance intensive applications.
*
* For Xwayland we report four images as describes in
* For Xwayland Venus reports four images as described in
* wsi_wl_surface_get_capabilities
*/
return is_xwayland ? 4 : 3;
return is_xwayland && wsi_device->x11.extra_xwayland_image ? 4 : 3;
}
static VkResult