From a99d90d015d0756af5e5e33cddf1f6d0e9f8f8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Mon, 15 Jul 2024 12:10:19 -0700 Subject: [PATCH] anv: Move code adding protected memory type to common code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xe KMD now has support for protected memory, so lets move it to common code. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_physical_device.c | 12 ++++++++++++ src/intel/vulkan/i915/anv_device.c | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index e496baacb85..e1e021bdc99 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -2034,6 +2034,18 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd) break; } + if (device->has_protected_contexts) { + /* Add a memory type for protected buffers, local and not host + * visible. + */ + device->memory.types[device->memory.type_count++] = + (struct anv_memory_type) { + .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | + VK_MEMORY_PROPERTY_PROTECTED_BIT, + .heapIndex = 0, + }; + } + assert(device->memory.type_count < ARRAY_SIZE(device->memory.types)); if (result != VK_SUCCESS) diff --git a/src/intel/vulkan/i915/anv_device.c b/src/intel/vulkan/i915/anv_device.c index 1c5bbf23ba5..d6fd25009c2 100644 --- a/src/intel/vulkan/i915/anv_device.c +++ b/src/intel/vulkan/i915/anv_device.c @@ -207,18 +207,6 @@ anv_i915_physical_device_init_memory_types(struct anv_physical_device *device) }; } - if (device->has_protected_contexts) { - /* Add a memory type for protected buffers, local and not host - * visible. - */ - device->memory.types[device->memory.type_count++] = - (struct anv_memory_type) { - .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | - VK_MEMORY_PROPERTY_PROTECTED_BIT, - .heapIndex = 0, - }; - } - return VK_SUCCESS; }