From fd40134487c3f3ae2c0c108651041ff98bfea7da Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 12 Feb 2021 11:17:21 +0200 Subject: [PATCH] anv: allow protected GEM context creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: Update new anv_gem_create_context_engines() Signed-off-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- 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,