Fixes:
cf2eebdf4f1 ("radv,gallium: Add driconf option to reduce advertised VRAM size.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8915>
static uint64_t
radv_get_vram_size(struct radv_physical_device *device)
{
- return radv_get_adjusted_vram_size(device) - device->rad_info.vram_vis_size;
+ uint64_t total_size = radv_get_adjusted_vram_size(device);
+ return total_size - MIN2(total_size, device->rad_info.vram_vis_size);
}
enum radv_heap {