panvk: add error checking for dump/trace mmap call

Fixes: c257bf5142 ("panvk: Conditionally register an host address when tracking user memory")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36122>
This commit is contained in:
Olivia Lee 2025-07-14 11:45:47 -07:00 committed by Marge Bot
parent 56ed5cf1bb
commit 7dcac3d55b

View file

@ -145,9 +145,13 @@ panvk_AllocateMemory(VkDevice _device,
if (device->debug.decode_ctx) {
if (instance->debug_flags & (PANVK_DEBUG_DUMP | PANVK_DEBUG_TRACE)) {
mem->debug.host_mapping =
pan_kmod_bo_mmap(mem->bo, 0, pan_kmod_bo_size(mem->bo),
PROT_READ | PROT_WRITE, MAP_SHARED, NULL);
void *cpu = pan_kmod_bo_mmap(mem->bo, 0, pan_kmod_bo_size(mem->bo),
PROT_READ | PROT_WRITE, MAP_SHARED, NULL);
if (cpu != MAP_FAILED)
mem->debug.host_mapping = cpu;
else
vk_logw(VK_LOG_OBJS(_device),
"failed to map VkMemory for dump or trace.\n");
}
pandecode_inject_mmap(device->debug.decode_ctx, mem->addr.dev,