venus: requests whole blob mem size for non-dedicated import

For non-dedicated import, later import could have varied size against
the same bo, so we just request the whole blob mem size for those.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
This commit is contained in:
Yiwei Zhang 2025-07-14 16:39:19 -07:00 committed by Marge Bot
parent b32a8d17a2
commit 442f242a49

View file

@ -115,11 +115,16 @@ vn_device_memory_import_dma_buf(struct vn_device *dev,
const VkMemoryType *mem_type =
&dev->physical_device->memory_properties
.memoryTypes[alloc_info->memoryTypeIndex];
const VkMemoryDedicatedAllocateInfo *dedicated_info =
vk_find_struct_const(alloc_info->pNext, MEMORY_DEDICATED_ALLOCATE_INFO);
const bool is_dedicated =
dedicated_info && (dedicated_info->image != VK_NULL_HANDLE ||
dedicated_info->buffer != VK_NULL_HANDLE);
struct vn_renderer_bo *bo;
VkResult result = vn_renderer_bo_create_from_dma_buf(
dev->renderer, alloc_info->allocationSize, fd, mem_type->propertyFlags,
&bo);
dev->renderer, is_dedicated ? alloc_info->allocationSize : 0, fd,
mem_type->propertyFlags, &bo);
if (result != VK_SUCCESS)
return result;