From c9e41f25a1bda305efaf818bec9f933118df37fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Thu, 21 Sep 2023 10:34:22 -0700 Subject: [PATCH] anv: Add heaps for Xe KMD in platforms without LLC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As Xe KMD don't support WB + 0 way coherency, so this are the only two memory types possible for integrated GPUs without LLC in Xe KMD. Signed-off-by: José Roberto de Souza Reviewed-by: Francisco Jerez Part-of: --- src/intel/vulkan/xe/anv_device.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/xe/anv_device.c b/src/intel/vulkan/xe/anv_device.c index 3b4cc69a117..b0e31dfa4ca 100644 --- a/src/intel/vulkan/xe/anv_device.c +++ b/src/intel/vulkan/xe/anv_device.c @@ -131,8 +131,19 @@ anv_xe_physical_device_init_memory_types(struct anv_physical_device *device) .heapIndex = 0, }; } else { - return vk_errorf(device, VK_ERROR_INITIALIZATION_FAILED, - "No memory heaps types set for non llc devices yet on Xe"); + device->memory.types[device->memory.type_count++] = (struct anv_memory_type) { + .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, + .heapIndex = 0, + }; + device->memory.types[device->memory.type_count++] = (struct anv_memory_type) { + .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT, + .heapIndex = 0, + }; } return VK_SUCCESS; }