summaryrefslogtreecommitdiff
path: root/tools/power/x86/intel-speed-select/isst-display.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2022-08-20 13:33:01 +0300
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2023-03-22 23:36:48 +0300
commit16c1892080d841e5d4b59295b96ae760b83c0b7f (patch)
tree315cdf034b4ef5b13de14e15aa7ded26b91f5bb8 /tools/power/x86/intel-speed-select/isst-display.c
parent7c7e7c0d396b99d5b41d052dbf2b2bddcd5f7f3c (diff)
downloadlinux-16c1892080d841e5d4b59295b96ae760b83c0b7f.tar.xz
tools/power/x86/intel-speed-select: Follow TRL nameing for FACT info
SST-TF high priority core count and ratios and low priority core ratios are also per TRL level. Cleanup the code to follow the same nameing convention as TRL. This removes hardcoded TRL level names and variables. No functional changes are expected. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'tools/power/x86/intel-speed-select/isst-display.c')
-rw-r--r--tools/power/x86/intel-speed-select/isst-display.c70
1 files changed, 28 insertions, 42 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index b9efbdf77dc1..5e57623196fc 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -235,6 +235,7 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l
int base_level)
{
struct isst_fact_bucket_info *bucket_info = fact_info->bucket_info;
+ int trl_max_levels = isst_get_trl_max_levels();
char header[256];
char value[256];
int print = 0, j;
@@ -243,7 +244,7 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l
if (fact_bucket != 0xff && fact_bucket != j)
continue;
- if (!bucket_info[j].high_priority_cores_count)
+ if (!bucket_info[j].hp_cores)
break;
print = 1;
@@ -256,10 +257,12 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l
snprintf(header, sizeof(header), "speed-select-turbo-freq-properties");
format_and_print(outf, base_level, header, NULL);
for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) {
+ int i;
+
if (fact_bucket != 0xff && fact_bucket != j)
continue;
- if (!bucket_info[j].high_priority_cores_count)
+ if (!bucket_info[j].hp_cores)
break;
snprintf(header, sizeof(header), "bucket-%d", j);
@@ -267,54 +270,37 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l
snprintf(header, sizeof(header), "high-priority-cores-count");
snprintf(value, sizeof(value), "%d",
- bucket_info[j].high_priority_cores_count);
+ bucket_info[j].hp_cores);
format_and_print(outf, base_level + 2, header, value);
-
- if (fact_avx & 0x01) {
- snprintf(header, sizeof(header),
- "high-priority-max-frequency(MHz)");
- snprintf(value, sizeof(value), "%d",
- bucket_info[j].sse_trl * DISP_FREQ_MULTIPLIER);
- format_and_print(outf, base_level + 2, header, value);
- }
-
- if (fact_avx & 0x02) {
- snprintf(header, sizeof(header),
- "high-priority-max-avx2-frequency(MHz)");
- snprintf(value, sizeof(value), "%d",
- bucket_info[j].avx_trl * DISP_FREQ_MULTIPLIER);
- format_and_print(outf, base_level + 2, header, value);
- }
-
- if (fact_avx & 0x04) {
- snprintf(header, sizeof(header),
- "high-priority-max-avx512-frequency(MHz)");
+ for (i = 0; i < trl_max_levels; i++) {
+ if (fact_avx != 0xFF && !(fact_avx & (1 << i)))
+ continue;
+ if (i == 0)
+ snprintf(header, sizeof(header),
+ "high-priority-max-frequency(MHz)");
+ else
+ snprintf(header, sizeof(header),
+ "high-priority-max-%s-frequency(MHz)", isst_get_trl_level_name(i));
snprintf(value, sizeof(value), "%d",
- bucket_info[j].avx512_trl *
- DISP_FREQ_MULTIPLIER);
+ bucket_info[j].hp_ratios[i] * DISP_FREQ_MULTIPLIER);
format_and_print(outf, base_level + 2, header, value);
}
}
snprintf(header, sizeof(header),
"speed-select-turbo-freq-clip-frequencies");
format_and_print(outf, base_level + 1, header, NULL);
- snprintf(header, sizeof(header), "low-priority-max-frequency(MHz)");
- snprintf(value, sizeof(value), "%d",
- fact_info->lp_clipping_ratio_license_sse *
- DISP_FREQ_MULTIPLIER);
- format_and_print(outf, base_level + 2, header, value);
- snprintf(header, sizeof(header),
- "low-priority-max-avx2-frequency(MHz)");
- snprintf(value, sizeof(value), "%d",
- fact_info->lp_clipping_ratio_license_avx2 *
- DISP_FREQ_MULTIPLIER);
- format_and_print(outf, base_level + 2, header, value);
- snprintf(header, sizeof(header),
- "low-priority-max-avx512-frequency(MHz)");
- snprintf(value, sizeof(value), "%d",
- fact_info->lp_clipping_ratio_license_avx512 *
- DISP_FREQ_MULTIPLIER);
- format_and_print(outf, base_level + 2, header, value);
+
+ for (j = 0; j < trl_max_levels; j++) {
+ /* No AVX level name for SSE to be consistent with previous formatting */
+ if (j == 0)
+ snprintf(header, sizeof(header), "low-priority-max-frequency(MHz)");
+ else
+ snprintf(header, sizeof(header), "low-priority-max-%s-frequency(MHz)",
+ isst_get_trl_level_name(j));
+ snprintf(value, sizeof(value), "%d",
+ fact_info->lp_ratios[j] * DISP_FREQ_MULTIPLIER);
+ format_and_print(outf, base_level + 2, header, value);
+ }
}
void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix,