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>
(cherry picked from commit 7dcac3d55b)
This commit is contained in:
Olivia Lee 2025-07-14 11:45:47 -07:00 committed by Eric Engestrom
parent 233754b67f
commit 331a5c7646
2 changed files with 8 additions and 4 deletions

View file

@ -204,7 +204,7 @@
"description": "panvk: add error checking for dump/trace mmap call",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "c257bf514277ab51d30096cbf3c29c884561ae52",
"notes": null

View file

@ -147,9 +147,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,