From 3f1d40d230c98d4ca9d2e20b214723a7b7d265d2 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sat, 28 Jun 2025 17:01:47 -0700 Subject: [PATCH] venus: wsi workaround for gamescope Gamescope relies on legacy scanout support when explicit modifier isn't available and it chains the mesa wsi hint requesting such. Venus doesn't support legacy scanout with optimal tiling on its own, so venus disables legacy scanout in favor of prime buffer blit for optimal performance. As a workaround here, venus can once again force linear tiling when legacy scanout is requested outside of common wsi. Tested-by: Dmitry Osipenko Part-of: --- src/virtio/vulkan/vn_wsi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index 3fa75f72112..77695514439 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -132,6 +132,23 @@ vn_wsi_create_image(struct vn_device *dev, create_info = &local_create_info; } + /* Gamescope relies on legacy scanout support when explicit modifier isn't + * available and it chains the mesa wsi hint requesting such. Venus doesn't + * support legacy scanout with optimal tiling on its own, so venus disables + * legacy scanout in favor of prime buffer blit for optimal performance. As + * a workaround here, venus can once again force linear tiling when legacy + * scanout is requested outside of common wsi. + */ + if (wsi_info->scanout) { + if (create_info != &local_create_info) { + local_create_info = *create_info; + local_create_info.tiling = VK_IMAGE_TILING_LINEAR; + create_info = &local_create_info; + } else { + local_create_info.tiling = VK_IMAGE_TILING_LINEAR; + } + } + struct vn_image *img; VkResult result = vn_image_create(dev, create_info, alloc, &img); if (result != VK_SUCCESS)