From 6a0f2dd44b60d37086518e607473cbbbd589c54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 25 Oct 2024 08:49:49 -0700 Subject: [PATCH] intel/dev: Fix max_cs_threads value on simulator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit intel_device_info_update_after_hwconfig() updates max_cs_threads based on max_eus_per_subslice and num_thread_per_eu but in some platforms simulator the hwconfig don't have the INTEL_HWCONFIG_MAX_NUM_EU_PER_DSS value, causing max_cs_threads to be set to a wrong value and then causing issues when programing CFE_STATE with a invalid value. Fortunately we can also get max_eus_per_subslice from topology query, so here moving the hwconfig query and intel_device_info_update_after_hwconfig() call to after topology. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/dev/i915/intel_device_info.c | 16 ++++++++-------- src/intel/dev/xe/intel_device_info.c | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/intel/dev/i915/intel_device_info.c b/src/intel/dev/i915/intel_device_info.c index a832d0bb81a..429e4ad8af8 100644 --- a/src/intel/dev/i915/intel_device_info.c +++ b/src/intel/dev/i915/intel_device_info.c @@ -554,14 +554,6 @@ bool intel_device_info_i915_get_info_from_fd(int fd, struct intel_device_info *d void *hwconfig_blob; int32_t len; - hwconfig_blob = intel_device_info_i915_query_hwconfig(fd, &len); - if (hwconfig_blob) { - if (intel_hwconfig_process_table(devinfo, hwconfig_blob, len)) - intel_device_info_update_after_hwconfig(devinfo); - - free(hwconfig_blob); - } - int val; if (getparam(fd, I915_PARAM_CS_TIMESTAMP_FREQUENCY, &val)) devinfo->timestamp_frequency = val; @@ -585,6 +577,14 @@ bool intel_device_info_i915_get_info_from_fd(int fd, struct intel_device_info *d getparam_topology(devinfo, fd); } + hwconfig_blob = intel_device_info_i915_query_hwconfig(fd, &len); + if (hwconfig_blob) { + if (intel_hwconfig_process_table(devinfo, hwconfig_blob, len)) + intel_device_info_update_after_hwconfig(devinfo); + + free(hwconfig_blob); + } + intel_device_info_i915_query_regions(devinfo, fd, false); if (devinfo->platform == INTEL_PLATFORM_CHV) diff --git a/src/intel/dev/xe/intel_device_info.c b/src/intel/dev/xe/intel_device_info.c index 2740156494c..6cf9d3320c5 100644 --- a/src/intel/dev/xe/intel_device_info.c +++ b/src/intel/dev/xe/intel_device_info.c @@ -330,12 +330,12 @@ intel_device_info_xe_get_info_from_fd(int fd, struct intel_device_info *devinfo) if (!xe_query_gts(fd, devinfo)) return false; - if (xe_query_process_hwconfig(fd, devinfo)) - intel_device_info_update_after_hwconfig(devinfo); - if (!xe_query_topology(fd, devinfo)) return false; + if (xe_query_process_hwconfig(fd, devinfo)) + intel_device_info_update_after_hwconfig(devinfo); + devinfo->has_context_isolation = true; devinfo->has_mmap_offset = true; devinfo->has_caching_uapi = false;