Mesa (staging/20.2): radv: Skip tiny non-visible VRAM heap.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 14 18:48:24 UTC 2020


Module: Mesa
Branch: staging/20.2
Commit: 44e3895e1c847617dd1c80c0f0dc861d71763d03
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=44e3895e1c847617dd1c80c0f0dc861d71763d03

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Wed Sep 23 02:13:00 2020 +0200

radv: Skip tiny non-visible VRAM heap.

When I enable "Above 4G decoding" in my BIOS I still get 16 MiB of
non-visible VRAM on my 8G VRAM GPU ...

CC: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6827>

---

 src/amd/vulkan/radv_device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 5bf9234a8c6..601cb6c9f64 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -146,7 +146,10 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device)
 	uint64_t vram_size = radv_get_vram_size(device);
 	int vram_index = -1, visible_vram_index = -1, gart_index = -1;
 	device->memory_properties.memoryHeapCount = 0;
-	if (vram_size > 0) {
+
+	/* Only get a VRAM heap if it is significant, not if it is a 16 MiB
+	 * remainder above visible VRAM. */
+	if (vram_size > 0 && vram_size * 9 >= visible_vram_size) {
 		vram_index = device->memory_properties.memoryHeapCount++;
 		device->memory_properties.memoryHeaps[vram_index] = (VkMemoryHeap) {
 			.size = vram_size,



More information about the mesa-commit mailing list