From ab91106d4f46ff269bb9868064b87a2fcdc44de4 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 30 Aug 2024 10:07:09 -0700 Subject: [PATCH] anv: fix compute engines when using ANV_QUEUE_OVERRIDE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I just noticed that my custom sparse program was not working correctly when I used ANV_QUEUE_OVERRIDE (instead of enabling the compute queue by default or using INTEL_ENGINE_CLASS_COMPUTE, which was removed by commit 600d88ab3c11 ("intel: Remove INTEL_ENGINE_CLASS_COMPUTE and INTEL_ENGINE_CLASS_COPY parameters"). It turns out we were not setting the same engine class type when using ANV_QUEUE_OVERRIDE vs the other cases. Move the code around so the behavior can stay the same. Reviewed-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_physical_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index 9f236b2a024..9588f392a28 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -2141,8 +2141,6 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) if (can_use_non_render_engines) { c_count = pdevice->info.engine_class_supported_count[INTEL_ENGINE_CLASS_COMPUTE]; } - enum intel_engine_class compute_class = - c_count < 1 ? INTEL_ENGINE_CLASS_RENDER : INTEL_ENGINE_CLASS_COMPUTE; int blit_count = 0; if (pdevice->info.verx10 >= 125 && can_use_non_render_engines) { @@ -2151,6 +2149,11 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) anv_override_engine_counts(&gc_count, &g_count, &c_count, &v_count, &blit_count); + enum intel_engine_class compute_class = + pdevice->info.engine_class_supported_count[INTEL_ENGINE_CLASS_COMPUTE] && + c_count >= 1 ? INTEL_ENGINE_CLASS_COMPUTE : + INTEL_ENGINE_CLASS_RENDER; + if (gc_count > 0) { pdevice->queue.families[family_count++] = (struct anv_queue_family) { .queueFlags = VK_QUEUE_GRAPHICS_BIT |