radv: Fix vram override with fully visible VRAM.

Fixes: cf2eebdf4f ("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>
(cherry picked from commit bd7d8a77e9)
This commit is contained in:
Bas Nieuwenhuizen 2021-02-08 15:24:30 +01:00 committed by Dylan Baker
parent e28d43f108
commit 0bb75ccf28
2 changed files with 3 additions and 2 deletions

View file

@ -1066,7 +1066,7 @@
"description": "radv: Fix vram override with fully visible VRAM.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "cf2eebdf4f1eff4eaad30e6f62e026d8fbbe4ff5"
},

View file

@ -153,7 +153,8 @@ radv_get_visible_vram_size(struct radv_physical_device *device)
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 {