Mesa (master): radv: Don' t use local BOs when allocating with export options.

Bas Nieuwenhuizen bnieuwenhuizen at kemper.freedesktop.org
Sun Dec 10 22:56:28 UTC 2017


Module: Mesa
Branch: master
Commit: 6469669bebce4e6dba928accec735bca457a6a2c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6469669bebce4e6dba928accec735bca457a6a2c

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sun Dec 10 15:34:54 2017 +0100

radv: Don't use local BOs when allocating with export options.

If the app does not plan to put a buffer or image in it
(why? But it is allowed and CTS does it), they do not need to
allocate it with the deciate allocation struct.

Fixes: a639d40f133 "radv: add support for local bos. (v3)"
Reviewed-by: Dave Airlie <airlied at redhat.com>

---

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

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index af301799f3..5a0dd64727 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2162,6 +2162,8 @@ static VkResult radv_alloc_memory(struct radv_device *device,
 		vk_find_struct_const(pAllocateInfo->pNext, IMPORT_MEMORY_FD_INFO_KHR);
 	const VkMemoryDedicatedAllocateInfoKHR *dedicate_info =
 		vk_find_struct_const(pAllocateInfo->pNext, MEMORY_DEDICATED_ALLOCATE_INFO_KHR);
+	const VkExportMemoryAllocateInfoKHR *export_info =
+		vk_find_struct_const(pAllocateInfo->pNext, EXPORT_MEMORY_ALLOCATE_INFO_KHR);
 
 	const struct wsi_memory_allocate_info *wsi_info =
 		vk_find_struct_const(pAllocateInfo->pNext, WSI_MEMORY_ALLOCATE_INFO_MESA);
@@ -2213,7 +2215,7 @@ static VkResult radv_alloc_memory(struct radv_device *device,
 	if (mem_type_index == RADV_MEM_TYPE_GTT_WRITE_COMBINE)
 		flags |= RADEON_FLAG_GTT_WC;
 
-	if (!dedicate_info && !import_info)
+	if (!dedicate_info && !import_info && (!export_info || !export_info->handleTypes))
 		flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
 
 	mem->bo = device->ws->buffer_create(device->ws, alloc_size, device->physical_device->rad_info.max_alignment,




More information about the mesa-commit mailing list