Reported-by: Dave Airlie <airlied@redhat.com>
Fixes:
fae88d8791b ("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>
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;