From 960a4d667bf17999cd77efe970c05d1ffa7cdfaf Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sun, 18 Jan 2026 22:33:11 -0800 Subject: [PATCH] venus: track dedicated image during mem alloc Need this because the new common wsi interface only returns the wsi memory from the acquired image index. Part-of: (cherry picked from commit 3fca8423c9453938adf7e732e7dbc1ff811056ff) --- .pick_status.json | 2 +- src/virtio/vulkan/vn_device_memory.h | 3 +++ src/virtio/vulkan/vn_wsi.c | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 9dedfbedbe7..62b02a97a7d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3874,7 +3874,7 @@ "description": "venus: track dedicated image during mem alloc", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/virtio/vulkan/vn_device_memory.h b/src/virtio/vulkan/vn_device_memory.h index 30331b8b315..d2b74b297fe 100644 --- a/src/virtio/vulkan/vn_device_memory.h +++ b/src/virtio/vulkan/vn_device_memory.h @@ -48,6 +48,9 @@ struct vn_device_memory { uint64_t bo_roundtrip_seqno; VkDeviceSize map_end; + + /* only valid when wsi platform is used */ + struct vn_image *dedicated_img; }; VK_DEFINE_NONDISP_HANDLE_CASTS(vn_device_memory, base.vk.base, diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index 3ff749287c9..3f7a35d6ba1 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -243,6 +243,12 @@ vn_wsi_memory_info_init(struct vn_device_memory *mem, struct vn_buffer *buf = vn_buffer_from_handle(dedicated_info->buffer); buf->wsi.mem = mem; } + + /* wsi_memory_allocate_info is not chained for prime blit src */ + if (dedicated_info && dedicated_info->image != VK_NULL_HANDLE) { + struct vn_image *img = vn_image_from_handle(dedicated_info->image); + mem->dedicated_img = img; + } } static uint32_t