From 20c19351b1bd75523371863d24bb2fb312b28612 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Wed, 7 Aug 2024 13:49:37 -0700 Subject: [PATCH] anv: be consistent regarding non-render engines on i915.ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Today, on i915.ko, if Sparse Resources is disabled and the Kernel is new enough to confirm to us that the GuC version is good, we'll expose non-render engines, otherwise we don't. Ever since we merged 5ca224aa0c35 ("anv/trtt: make all contexts have the same TR-TT programming"), TR-TT is not anymore the reason why we're not enabling non-render engines. Our performance team has analyzed workloads and concluded enabling non-render engines is not worth it on i915.ko today. So here we adjust the code to do three things: - Stop blaming TR-TT - Unify the default behavior for i915.ko - Don't disable non-render engines when TR-TT is being used on xe.ko. v2: - Comments (José) Acked-by: Felix DeGrood Reviewed-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_physical_device.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_physical_device.c b/src/intel/vulkan/anv_physical_device.c index 14bb4f4b68e..c2395a27d59 100644 --- a/src/intel/vulkan/anv_physical_device.c +++ b/src/intel/vulkan/anv_physical_device.c @@ -2099,12 +2099,20 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice) intel_engines_count(pdevice->engine_info, INTEL_ENGINE_CLASS_VIDEO); int g_count = 0; int c_count = 0; + /* Not only the Kernel needs to have vm_control, but it also needs to + * have a new enough GuC and the interface to tell us so. This is + * implemented in the common layer by is_guc_semaphore_functional() and + * results in devinfo->engine_class_supported_count being adjusted, + * which we read below. + */ const bool kernel_supports_non_render_engines = pdevice->has_vm_control; - const bool sparse_supports_non_render_engines = - pdevice->sparse_type != ANV_SPARSE_TYPE_TRTT; + /* For now we're choosing to not expose non-render engines on i915.ko + * even when the Kernel allows it. We have data suggesting it's not an + * obvious win in terms of performance. + */ const bool can_use_non_render_engines = kernel_supports_non_render_engines && - sparse_supports_non_render_engines; + pdevice->info.kmd_type == INTEL_KMD_TYPE_XE; if (can_use_non_render_engines) { c_count = pdevice->info.engine_class_supported_count[INTEL_ENGINE_CLASS_COMPUTE];