From 06f5d1a1052a1f7fb2c530ea22b1fc6e261d1821 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sun, 4 May 2025 21:54:20 -0700 Subject: [PATCH] venus: expose WSI on renderer without dma-buf support For Venus on host driver without dmabuf support, we can fallback to allow cpu buffer blit for wsi instead of not exposing it. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13096 Part-of: --- src/virtio/vulkan/vn_physical_device.c | 3 +-- src/virtio/vulkan/vn_wsi.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index 13565312c5b..05e8d54fa33 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -1178,8 +1178,7 @@ vn_physical_device_get_native_extensions( } #ifdef VN_USE_WSI_PLATFORM - if (can_external_mem && - physical_dev->renderer_sync_fd.semaphore_importable) { + if (physical_dev->renderer_sync_fd.semaphore_importable) { exts->KHR_incremental_present = true; exts->KHR_swapchain = true; exts->KHR_swapchain_mutable_format = true; diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index dec3940cda1..33cd2de532b 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -81,7 +81,8 @@ vn_wsi_init(struct vn_physical_device *physical_dev) &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, + .sw_device = !physical_dev->base.vk.supported_extensions + .EXT_external_memory_dma_buf, .extra_xwayland_image = true, }); if (result != VK_SUCCESS)