mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
venus: use dedicated allocation for ANB image memory import
On most platforms, deidcated allocation is preferred for the dma-buf import done by Venus. In special cases, this is required but missed so far. Cc: mesa-stable Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33434>
This commit is contained in:
parent
1d668233ba
commit
d92f9c3d51
1 changed files with 7 additions and 0 deletions
|
|
@ -581,8 +581,15 @@ vn_android_image_from_anb_internal(struct vn_device *dev,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
const bool prefer_dedicated =
|
||||
img->requirements[0].dedicated.prefersDedicatedAllocation == VK_TRUE;
|
||||
const VkMemoryDedicatedAllocateInfo dedicated_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
|
||||
.image = vn_image_to_handle(img),
|
||||
};
|
||||
const VkImportMemoryFdInfoKHR import_fd_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
|
||||
.pNext = prefer_dedicated ? &dedicated_info : NULL,
|
||||
.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
|
||||
.fd = dup_fd,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue