Module: Mesa
Branch: main
Commit: c9e41f25a1bda305efaf818bec9f933118df37fa
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c9e41f25a1bda305efaf818bec9f933118df37fa

Author: José Roberto de Souza <[email protected]>
Date:   Thu Sep 21 10:34:22 2023 -0700

anv: Add heaps for Xe KMD in platforms without LLC

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 <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>

---

 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;
 }

Reply via email to