From fa79020ba982d99d9c68ad63f1979ad21afbff10 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Tue, 26 Jul 2022 20:20:24 -0700 Subject: [PATCH] anv: Fix PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES with large BAR Reported-by: Dave Airlie Fixes: fae88d8791b ("anv: make use of the new smallbar uAPI") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6937 Signed-off-by: Jordan Justen Reviewed-by: Dave Airlie Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 63309be61dd..a1ada41ecc4 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -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;