From f9efedb1a1acbaa70c603d5ef57a83180a8f5782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 5 Jan 2024 10:33:10 -0800 Subject: [PATCH] intel/dev: Replace intel_device_info::apply_hwconfig by a gfx version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no plans to remove hwconfig from platforms 12.5 and newer so lets replace this bool by a ip version check. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/dev/intel_device_info.c | 4 ---- src/intel/dev/intel_device_info.py | 1 - src/intel/dev/intel_hwconfig.c | 16 ++++++++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/intel/dev/intel_device_info.c b/src/intel/dev/intel_device_info.c index f6d44698d3d..bcaab74f11f 100644 --- a/src/intel/dev/intel_device_info.c +++ b/src/intel/dev/intel_device_info.c @@ -1131,7 +1131,6 @@ static const struct intel_device_info intel_device_info_sg1 = { /* (Sub)slice info comes from the kernel topology info */ \ XEHP_FEATURES(0, 1, 0), \ .revision = 4, /* For offline compiler */ \ - .apply_hwconfig = true, \ .has_coarse_pixel_primitive_and_cb = true, \ .has_mesh_shading = true, \ .has_ray_tracing = true, \ @@ -1174,7 +1173,6 @@ static const struct intel_device_info intel_device_info_atsm_g11 = { XEHP_FEATURES(0, 1, 0), \ .has_local_mem = false, \ .has_aux_map = true, \ - .apply_hwconfig = true, \ .has_64bit_float = true, \ .has_64bit_float_via_math_pipe = true, \ .has_integer_dword_mul = false, \ @@ -1240,14 +1238,12 @@ static const struct intel_device_info intel_device_info_bmg = { XE2_FEATURES, .platform = INTEL_PLATFORM_BMG, .has_local_mem = true, - .apply_hwconfig = true, }; static const struct intel_device_info intel_device_info_lnl = { XE2_FEATURES, .platform = INTEL_PLATFORM_LNL, .has_local_mem = false, - .apply_hwconfig = true, }; void diff --git a/src/intel/dev/intel_device_info.py b/src/intel/dev/intel_device_info.py index c6a48755e49..6f6aab2f88d 100644 --- a/src/intel/dev/intel_device_info.py +++ b/src/intel/dev/intel_device_info.py @@ -473,7 +473,6 @@ Struct("intel_device_info", Member("int", "simulator_id"), Member("char", "name", array="INTEL_DEVICE_MAX_NAME_SIZE"), Member("bool", "no_hw"), - Member("bool", "apply_hwconfig"), Member("intel_device_info_mem_desc", "mem"), Member("intel_device_info_pat_desc", "pat"), Member("intel_cooperative_matrix_configuration", diff --git a/src/intel/dev/intel_hwconfig.c b/src/intel/dev/intel_hwconfig.c index f0d4722daa2..d8ec93be207 100644 --- a/src/intel/dev/intel_hwconfig.c +++ b/src/intel/dev/intel_hwconfig.c @@ -153,16 +153,24 @@ process_hwconfig_table(struct intel_device_info *devinfo, assert(current == end); } -/* If devinfo->apply_hwconfig is true, then we apply the hwconfig value. +static inline bool +apply_hwconfig(const struct intel_device_info *devinfo) +{ + /* returns is true when the platform should apply hwconfig values */ + return devinfo->verx10 >= 125; +} + +/* If apply_hwconfig(devinfo) is true, then we apply the + * hwconfig value. * - * For debug builds, if devinfo->apply_hwconfig is false, we will compare the + * For debug builds, if apply_hwconfig() is false, we will compare the * hwconfig value with the current value in the devinfo and log a warning * message if they differ. This should help to make sure the values in our * devinfo structures match what hwconfig is specified. */ #define DEVINFO_HWCONFIG(F, V) \ do { \ - if (devinfo->apply_hwconfig) \ + if (apply_hwconfig(devinfo)) \ devinfo->F = V; \ else if (DEBUG_BUILD && devinfo->F != (V)) \ mesa_logw("%s (%u) != devinfo->%s (%u)", \ @@ -277,7 +285,7 @@ intel_hwconfig_process_table(struct intel_device_info *devinfo, { process_hwconfig_table(devinfo, data, len, apply_hwconfig_item); - return devinfo->apply_hwconfig; + return apply_hwconfig(devinfo); } static void