anv: Fix PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES with large BAR

Reported-by: Dave Airlie <airlied@redhat.com>
Fixes: fae88d8791 ("anv: make use of the new smallbar uAPI")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6937
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17761>
This commit is contained in:
Jordan Justen 2022-07-26 20:20:24 -07:00 committed by Marge Bot
parent 11e51f7211
commit fa79020ba9

View File

@ -2771,7 +2771,11 @@ anv_get_memory_budget(VkPhysicalDevice physicalDevice,
if (device->memory.heaps[i].is_local_mem) {
total_heaps_size = total_vram_heaps_size;
mem_available = device->vram_non_mappable.available;
if (device->vram_non_mappable.size > 0 && i == 0) {
mem_available = device->vram_non_mappable.available;
} else {
mem_available = device->vram_mappable.available;
}
} else {
total_heaps_size = total_sys_heaps_size;
mem_available = device->sys.available;