panvk: Initialize device virtual address space after the VM creation

Make sure we're not lacking a lock/heap destroy when we fail to
create the VM.

Fixes: 53fb1d99ca ("panvk: Transition to explicit VA assignment on v10+")
Reported-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33471>
This commit is contained in:
Boris Brezillon 2025-02-10 14:01:07 +01:00 committed by Marge Bot
parent 5f3c6a0f27
commit 4ae12cc6ff

View file

@ -304,10 +304,6 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
panfrost_clamp_to_usable_va_range(device->kmod.dev, 1ull << 32);
uint32_t vm_flags = PAN_ARCH <= 7 ? PAN_KMOD_VM_FLAG_AUTO_VA : 0;
simple_mtx_init(&device->as.lock, mtx_plain);
util_vma_heap_init(&device->as.heap, user_va_start,
user_va_end - user_va_start);
device->kmod.vm =
pan_kmod_vm_create(device->kmod.dev, vm_flags,
user_va_start, user_va_end - user_va_start);
@ -317,6 +313,10 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
goto err_destroy_kdev;
}
simple_mtx_init(&device->as.lock, mtx_plain);
util_vma_heap_init(&device->as.heap, user_va_start,
user_va_end - user_va_start);
panvk_device_init_mempools(device);
#if PAN_ARCH <= 9