panvk: add max supported va to physical device

This is slightly neater to check during device feature
filling instead of calculating it repeatedly.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38871>
This commit is contained in:
Utku Iseri 2026-02-11 08:08:13 +01:00 committed by Marge Bot
parent a1b2d2293f
commit 3a853e0ba4
3 changed files with 10 additions and 6 deletions

View file

@ -316,6 +316,11 @@ get_device_heaps(struct panvk_physical_device *device,
host_cached_not_coherent_type;
}
const uint64_t request_va =
PANVK_DEBUG(NO_EXTENDED_VA_RANGE) ? 1ull << 32 : 1ull << 48;
device->memory.max_supported_va =
pan_clamp_to_usable_va_range(device->kmod.dev, request_va);
return VK_SUCCESS;
}

View file

@ -63,6 +63,8 @@ struct panvk_physical_device {
VkMemoryType types[4];
uint32_t type_count;
uint64_t max_supported_va;
} memory;
struct vk_sync_type drm_syncobj_type;

View file

@ -408,14 +408,11 @@ panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,
if (PANVK_DEBUG(TRACE) || PANVK_DEBUG(SYNC) || PANVK_DEBUG(DUMP))
device->debug.decode_ctx = pandecode_create_context(false);
/* 48bit address space, with the lower 32MB reserved. We clamp
* things so it matches kmod VA range limitations.
*/
/* 48bit address space clamped by the physical device limits, with the lower
* 32MB reserved. */
uint64_t user_va_start = pan_clamp_to_usable_va_range(
device->kmod.dev, PANVK_VA_RESERVE_BOTTOM);
const uint64_t user_va_bits = PANVK_DEBUG(NO_EXTENDED_VA_RANGE) ? 32 : 48;
uint64_t user_va_end =
pan_clamp_to_usable_va_range(device->kmod.dev, 1ull << user_va_bits);
uint64_t user_va_end = physical_device->memory.max_supported_va;
uint32_t vm_flags = PAN_ARCH < 10 ? PAN_KMOD_VM_FLAG_AUTO_VA : 0;
device->kmod.vm =