From c20388d617448faad60c4622f888766ed6814d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 6 Mar 2024 10:06:30 -0800 Subject: [PATCH] anv: Set VK_QUEUE_PROTECTED_BIT during queue families initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't make sense to only set it in VkGetPhysicalDeviceQueueFamilyProperties2(). Not setting it to the code path without pdevice->engine_info because the protected support landed on i915 after DRM_I915_QUERY_ENGINE_INFO. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_device.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 146ef728555..d4ebf940edb 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2096,6 +2096,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) uint32_t family_count = 0; VkQueueFlags sparse_flags = pdevice->sparse_type != ANV_SPARSE_TYPE_NOT_SUPPORTED ? VK_QUEUE_SPARSE_BINDING_BIT : 0; + VkQueueFlags protected_flag = pdevice->has_protected_contexts ? + VK_QUEUE_PROTECTED_BIT : 0; if (pdevice->engine_info) { int gc_count = @@ -2137,7 +2139,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) .queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT | - sparse_flags, + sparse_flags | + protected_flag, .queueCount = gc_count, .engine_class = INTEL_ENGINE_CLASS_RENDER, }; @@ -2146,7 +2149,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) pdevice->queue.families[family_count++] = (struct anv_queue_family) { .queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT | - sparse_flags, + sparse_flags | + protected_flag, .queueCount = g_count, .engine_class = INTEL_ENGINE_CLASS_RENDER, }; @@ -2155,7 +2159,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) pdevice->queue.families[family_count++] = (struct anv_queue_family) { .queueFlags = VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT | - sparse_flags, + sparse_flags | + protected_flag, .queueCount = c_count, .engine_class = compute_class, }; @@ -2171,6 +2176,7 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) * When this bug is fixed we should be able to check HEVC support to determine the * correct number of queues. */ + /* TODO: enable protected content on video queue */ pdevice->queue.families[family_count++] = (struct anv_queue_family) { .queueFlags = VK_QUEUE_VIDEO_DECODE_BIT_KHR, .queueCount = pdevice->info.ver == 9 ? MIN2(1, v_count) : v_count, @@ -2179,7 +2185,8 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) } if (blit_count > 0) { pdevice->queue.families[family_count++] = (struct anv_queue_family) { - .queueFlags = VK_QUEUE_TRANSFER_BIT, + .queueFlags = VK_QUEUE_TRANSFER_BIT | + protected_flag, .queueCount = blit_count, .engine_class = INTEL_ENGINE_CLASS_COPY, }; @@ -2732,10 +2739,6 @@ anv_device_physical_get_queue_properties(const struct anv_physical_device *devic properties.queueFlags = family->queueFlags; properties.queueCount = family->queueCount; - /* TODO: enable protected content on video queue */ - if (device->has_protected_contexts && - (family->queueFlags & VK_QUEUE_VIDEO_DECODE_BIT_KHR) == 0) - properties.queueFlags |= VK_QUEUE_PROTECTED_BIT; return properties; }