venus: drop force_unmappable hack

No longer needed since the vkMapMemory would fail properly instead of
failing the external memory import.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
This commit is contained in:
Yiwei Zhang 2025-07-13 20:42:07 -07:00 committed by Marge Bot
parent 6c8f075fb3
commit e27ad2a021
3 changed files with 5 additions and 16 deletions

View file

@ -778,7 +778,6 @@ vn_android_device_import_ahb(
uint64_t alloc_size = 0;
uint32_t mem_type_bits = 0;
uint32_t mem_type_index = mem_vk->memory_type_index;
bool force_unmappable = false;
VkResult result = VK_SUCCESS;
handle = AHardwareBuffer_getNativeHandle(mem_vk->ahardware_buffer);
@ -837,14 +836,6 @@ vn_android_device_import_ahb(
mem_type_index = ffs(mem_type_bits & mem_req->memoryTypeBits) - 1;
}
/* XXX Workaround before we use cross-domain backend in minigbm, since
* venus doesn't support transfer blit for classic 3d resources.
*
* For AHB image, we can allow r8 storage image support, since that's
* always allocated with blob mem.
*/
force_unmappable = img->base.vk.format != VK_FORMAT_R8_UNORM;
}
if (dedicated_info && dedicated_info->buffer != VK_NULL_HANDLE) {
@ -888,8 +879,8 @@ vn_android_device_import_ahb(
.allocationSize = alloc_size,
.memoryTypeIndex = mem_type_index,
};
result = vn_device_memory_import_dma_buf(dev, mem, &local_alloc_info,
force_unmappable, dup_fd);
result =
vn_device_memory_import_dma_buf(dev, mem, &local_alloc_info, dup_fd);
if (result != VK_SUCCESS) {
close(dup_fd);
return result;

View file

@ -110,7 +110,6 @@ VkResult
vn_device_memory_import_dma_buf(struct vn_device *dev,
struct vn_device_memory *mem,
const VkMemoryAllocateInfo *alloc_info,
bool force_unmappable,
int fd)
{
const VkMemoryType *mem_type =
@ -119,8 +118,8 @@ vn_device_memory_import_dma_buf(struct vn_device *dev,
struct vn_renderer_bo *bo;
VkResult result = vn_renderer_bo_create_from_dma_buf(
dev->renderer, alloc_info->allocationSize, fd,
force_unmappable ? 0 : mem_type->propertyFlags, &bo);
dev->renderer, alloc_info->allocationSize, fd, mem_type->propertyFlags,
&bo);
if (result != VK_SUCCESS)
return result;
@ -387,7 +386,7 @@ vn_AllocateMemory(VkDevice device,
if (mem->base.vk.ahardware_buffer) {
result = vn_android_device_import_ahb(dev, mem, dedicated_info);
} else if (import_fd_info) {
result = vn_device_memory_import_dma_buf(dev, mem, pAllocateInfo, false,
result = vn_device_memory_import_dma_buf(dev, mem, pAllocateInfo,
import_fd_info->fd);
} else {
result = vn_device_memory_alloc(dev, mem, pAllocateInfo);

View file

@ -58,7 +58,6 @@ VkResult
vn_device_memory_import_dma_buf(struct vn_device *dev,
struct vn_device_memory *mem,
const VkMemoryAllocateInfo *alloc_info,
bool force_unmappable,
int fd);
VkResult