anv: be consistent regarding non-render engines on i915.ko

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 5ca224aa0c ("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 <felix.j.degrood@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30627>
This commit is contained in:
Paulo Zanoni 2024-08-07 13:49:37 -07:00 committed by Marge Bot
parent 5f366bf822
commit 20c19351b1

View file

@ -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];