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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39401>
(cherry picked from commit 3fca8423c9)
This commit is contained in:
Yiwei Zhang 2026-01-18 22:33:11 -08:00 committed by Eric Engestrom
parent 48c28ee238
commit 960a4d667b
3 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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,

View file

@ -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