From 30534fcb29c06a5d28817a7add5855363090c30d Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 23 Sep 2020 11:28:41 +0200 Subject: [PATCH] v3dv: only advertise one memory type Our current implemenation is always coherent. Part-of: --- src/broadcom/vulkan/v3dv_device.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index dcde552ec77..5a5f27ad2ec 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -493,21 +493,14 @@ physical_device_init(struct v3dv_physical_device *device, mem->memoryHeaps[0].size = compute_heap_size(); mem->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT; - mem->memoryTypeCount = 2; - /* This is the only combination required by the spec */ + mem->memoryTypeCount = 1; mem->memoryTypes[0].propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; mem->memoryTypes[0].heapIndex = 0; - mem->memoryTypes[1].propertyFlags = - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - mem->memoryTypes[1].heapIndex = 0; - device->options.merge_jobs = getenv("V3DV_NO_MERGE_JOBS") == NULL; result = v3dv_wsi_init(device); @@ -1786,7 +1779,7 @@ v3dv_GetImageMemoryRequirements(VkDevice _device, pMemoryRequirements->size = image->size; pMemoryRequirements->alignment = image->alignment; - pMemoryRequirements->memoryTypeBits = 0x3; /* Both memory types */ + pMemoryRequirements->memoryTypeBits = 0x1; } VkResult @@ -1820,7 +1813,7 @@ v3dv_GetBufferMemoryRequirements(VkDevice _device, { V3DV_FROM_HANDLE(v3dv_buffer, buffer, _buffer); - pMemoryRequirements->memoryTypeBits = 0x3; /* Both memory types */ + pMemoryRequirements->memoryTypeBits = 0x1; pMemoryRequirements->alignment = buffer->alignment; pMemoryRequirements->size = align64(buffer->size, pMemoryRequirements->alignment);