nvk: Don't assert memory placement on import

Instead, we assert that the non-placement flags match, which is
currently CAN_MAP and SHARED.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35213>
This commit is contained in:
Faith Ekstrand
2025-05-28 12:02:39 -04:00
parent bf82c94751
commit 77eba0980b
2 changed files with 4 additions and 2 deletions
+1 -2
View File
@@ -178,8 +178,7 @@ nvk_AllocateMemory(VkDevice device,
/* We can't really assert anything for dma-bufs because they could come
* in from some other device.
*/
if (fd_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT)
assert(!(flags & ~mem->mem->flags));
assert(!(flags & ~mem->mem->flags & ~NVKMD_MEM_PLACEMENT_FLAGS));
} else if (pte_kind != 0 || tile_mode != 0) {
result = nvkmd_dev_alloc_tiled_mem(dev->nvkmd, &dev->vk.base,
aligned_size, alignment,
+3
View File
@@ -55,6 +55,9 @@ enum nvkmd_mem_flags {
NVKMD_MEM_SHARED = 1 << 4,
};
#define NVKMD_MEM_PLACEMENT_FLAGS \
(NVKMD_MEM_LOCAL | NVKMD_MEM_GART | NVKMD_MEM_VRAM)
enum nvkmd_mem_map_flags {
NVKMD_MEM_MAP_RD = 1 << 0,
NVKMD_MEM_MAP_WR = 1 << 1,