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

Author: Lionel Landwerlin <[email protected]>
Date:   Fri Feb 12 11:17:21 2021 +0200

anv: allow protected GEM context creation

v2: Update new anv_gem_create_context_engines()

Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>

---

 src/intel/vulkan/i915/anv_device.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/i915/anv_device.c 
b/src/intel/vulkan/i915/anv_device.c
index f2909e09eff..33eb3a4cdcb 100644
--- a/src/intel/vulkan/i915/anv_device.c
+++ b/src/intel/vulkan/i915/anv_device.c
@@ -277,6 +277,7 @@ anv_i915_device_setup_context(struct anv_device *device,
       assert(num_queues <= 64);
       enum intel_engine_class engine_classes[64];
       int engine_count = 0;
+      enum intel_gem_create_context_flags flags = 0;
       for (uint32_t i = 0; i < pCreateInfo->queueCreateInfoCount; i++) {
          const VkDeviceQueueCreateInfo *queueCreateInfo =
             &pCreateInfo->pQueueCreateInfos[i];
@@ -288,8 +289,12 @@ anv_i915_device_setup_context(struct anv_device *device,
 
          for (uint32_t j = 0; j < queueCreateInfo->queueCount; j++)
             engine_classes[engine_count++] = queue_family->engine_class;
+
+         if (pCreateInfo->pQueueCreateInfos[i].flags &
+             VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT)
+            flags |= INTEL_GEM_CREATE_CONTEXT_EXT_PROTECTED_FLAG;
       }
-      if (!intel_gem_create_context_engines(device->fd, 0 /* flags */,
+      if (!intel_gem_create_context_engines(device->fd, flags,
                                             physical_device->engine_info,
                                             engine_count, engine_classes,
                                             device->vm_id,

Reply via email to