mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
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:
parent
56ed5cf1bb
commit
7dcac3d55b
1 changed files with 7 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue