From d6ea60d5a2dd21a92eac71d2e7ff09e9d29e1126 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 6 Dec 2021 10:47:34 +0100 Subject: [PATCH] radv: allocate the prime buffer as uncached This is a write only buffer so caches aren't needed. Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 5a1bb95c305..91ae1932def 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -4624,6 +4624,13 @@ radv_alloc_memory(struct radv_device *device, const VkMemoryAllocateInfo *pAlloc mem->buffer = NULL; } + if (wsi_info && wsi_info->implicit_sync && mem->buffer) { + /* Mark the linear prime buffer (aka the destination of the prime blit + * as uncached. + */ + flags |= RADEON_FLAG_VA_UNCACHED; + } + float priority_float = 0.5; const struct VkMemoryPriorityAllocateInfoEXT *priority_ext = vk_find_struct_const(pAllocateInfo->pNext, MEMORY_PRIORITY_ALLOCATE_INFO_EXT);