From 9948ead3cd495887eec37f4ac4613541c5f510b1 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Wed, 23 Sep 2020 02:13:00 +0200 Subject: [PATCH] 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 Part-of: --- 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 42cb023156b..7b3dcf10749 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -168,7 +168,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,