From d4cedcd3628cc3b67411ed6d780c30ec2182d26c Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Thu, 5 Jun 2025 11:38:53 -0700 Subject: [PATCH] venus: force sw wsi path on nv proprietary We have to force it here, otherwise, if we'd like to preserve the modifier path, it'd be too late when it falls back to prime blit with unsupported compositors/envs. Part-of: --- src/virtio/vulkan/vn_wsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index 1aaffa18cfc..403c110eb9e 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -78,14 +78,21 @@ vn_wsi_proc_addr(VkPhysicalDevice physicalDevice, const char *pName) VkResult vn_wsi_init(struct vn_physical_device *physical_dev) { + /* TODO Drop the workaround for NVIDIA_PROPRIETARY once hw prime buffer + * blit path works there. + */ + const bool use_sw_device = + !physical_dev->base.vk.supported_extensions + .EXT_external_memory_dma_buf || + physical_dev->renderer_driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY; + const VkAllocationCallbacks *alloc = &physical_dev->instance->base.vk.alloc; 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 = !physical_dev->base.vk.supported_extensions - .EXT_external_memory_dma_buf, + .sw_device = use_sw_device, .extra_xwayland_image = true, }); if (result != VK_SUCCESS)