Commit 16c18920 authored by Zhang Rui's avatar Zhang Rui Committed by Srinivas Pandruvada

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: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
parent 7c7e7c0d
...@@ -592,7 +592,7 @@ int isst_get_fact_bucket_info(struct isst_id *id, int level, ...@@ -592,7 +592,7 @@ int isst_get_fact_bucket_info(struct isst_id *id, int level,
id->cpu, i, level, resp); id->cpu, i, level, resp);
for (j = 0; j < 4; ++j) { for (j = 0; j < 4; ++j) {
bucket_info[j + (i * 4)].high_priority_cores_count = bucket_info[j + (i * 4)].hp_cores =
(resp >> (j * 8)) & 0xff; (resp >> (j * 8)) & 0xff;
} }
} }
...@@ -613,22 +613,8 @@ int isst_get_fact_bucket_info(struct isst_id *id, int level, ...@@ -613,22 +613,8 @@ int isst_get_fact_bucket_info(struct isst_id *id, int level,
id->cpu, i, level, k, resp); id->cpu, i, level, k, resp);
for (j = 0; j < 4; ++j) { for (j = 0; j < 4; ++j) {
switch (k) { bucket_info[j + (i * 4)].hp_ratios[k] =
case 0: (resp >> (j * 8)) & 0xff;
bucket_info[j + (i * 4)].sse_trl =
(resp >> (j * 8)) & 0xff;
break;
case 1:
bucket_info[j + (i * 4)].avx_trl =
(resp >> (j * 8)) & 0xff;
break;
case 2:
bucket_info[j + (i * 4)].avx512_trl =
(resp >> (j * 8)) & 0xff;
break;
default:
break;
}
} }
} }
} }
...@@ -672,9 +658,9 @@ int isst_get_fact_info(struct isst_id *id, int level, int fact_bucket, struct is ...@@ -672,9 +658,9 @@ int isst_get_fact_info(struct isst_id *id, int level, int fact_bucket, struct is
debug_printf("cpu:%d CONFIG_TDP_GET_FACT_LP_CLIPPING_RATIO resp:%x\n", debug_printf("cpu:%d CONFIG_TDP_GET_FACT_LP_CLIPPING_RATIO resp:%x\n",
id->cpu, resp); id->cpu, resp);
fact_info->lp_clipping_ratio_license_sse = resp & 0xff; fact_info->lp_ratios[0] = resp & 0xff;
fact_info->lp_clipping_ratio_license_avx2 = (resp >> 8) & 0xff; fact_info->lp_ratios[1] = (resp >> 8) & 0xff;
fact_info->lp_clipping_ratio_license_avx512 = (resp >> 16) & 0xff; fact_info->lp_ratios[2] = (resp >> 16) & 0xff;
ret = isst_get_fact_bucket_info(id, level, fact_info->bucket_info); ret = isst_get_fact_bucket_info(id, level, fact_info->bucket_info);
if (ret) if (ret)
...@@ -685,7 +671,7 @@ int isst_get_fact_info(struct isst_id *id, int level, int fact_bucket, struct is ...@@ -685,7 +671,7 @@ int isst_get_fact_info(struct isst_id *id, int level, int fact_bucket, struct is
if (fact_bucket != 0xff && fact_bucket != j) if (fact_bucket != 0xff && fact_bucket != j)
continue; continue;
if (!fact_info->bucket_info[j].high_priority_cores_count) if (!fact_info->bucket_info[j].hp_cores)
break; break;
print = 1; print = 1;
......
...@@ -235,6 +235,7 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l ...@@ -235,6 +235,7 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l
int base_level) int base_level)
{ {
struct isst_fact_bucket_info *bucket_info = fact_info->bucket_info; struct isst_fact_bucket_info *bucket_info = fact_info->bucket_info;
int trl_max_levels = isst_get_trl_max_levels();
char header[256]; char header[256];
char value[256]; char value[256];
int print = 0, j; int print = 0, j;
...@@ -243,7 +244,7 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l ...@@ -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) if (fact_bucket != 0xff && fact_bucket != j)
continue; continue;
if (!bucket_info[j].high_priority_cores_count) if (!bucket_info[j].hp_cores)
break; break;
print = 1; print = 1;
...@@ -256,10 +257,12 @@ static void _isst_fact_display_information(struct isst_id *id, FILE *outf, int l ...@@ -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"); snprintf(header, sizeof(header), "speed-select-turbo-freq-properties");
format_and_print(outf, base_level, header, NULL); format_and_print(outf, base_level, header, NULL);
for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) { for (j = 0; j < ISST_FACT_MAX_BUCKETS; ++j) {
int i;
if (fact_bucket != 0xff && fact_bucket != j) if (fact_bucket != 0xff && fact_bucket != j)
continue; continue;
if (!bucket_info[j].high_priority_cores_count) if (!bucket_info[j].hp_cores)
break; break;
snprintf(header, sizeof(header), "bucket-%d", j); 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 ...@@ -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(header, sizeof(header), "high-priority-cores-count");
snprintf(value, sizeof(value), "%d", 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); format_and_print(outf, base_level + 2, header, value);
for (i = 0; i < trl_max_levels; i++) {
if (fact_avx & 0x01) { if (fact_avx != 0xFF && !(fact_avx & (1 << i)))
snprintf(header, sizeof(header), continue;
"high-priority-max-frequency(MHz)"); if (i == 0)
snprintf(value, sizeof(value), "%d", snprintf(header, sizeof(header),
bucket_info[j].sse_trl * DISP_FREQ_MULTIPLIER); "high-priority-max-frequency(MHz)");
format_and_print(outf, base_level + 2, header, value); else
} snprintf(header, sizeof(header),
"high-priority-max-%s-frequency(MHz)", isst_get_trl_level_name(i));
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)");
snprintf(value, sizeof(value), "%d", snprintf(value, sizeof(value), "%d",
bucket_info[j].avx512_trl * bucket_info[j].hp_ratios[i] * DISP_FREQ_MULTIPLIER);
DISP_FREQ_MULTIPLIER);
format_and_print(outf, base_level + 2, header, value); format_and_print(outf, base_level + 2, header, value);
} }
} }
snprintf(header, sizeof(header), snprintf(header, sizeof(header),
"speed-select-turbo-freq-clip-frequencies"); "speed-select-turbo-freq-clip-frequencies");
format_and_print(outf, base_level + 1, header, NULL); format_and_print(outf, base_level + 1, header, NULL);
snprintf(header, sizeof(header), "low-priority-max-frequency(MHz)");
snprintf(value, sizeof(value), "%d", for (j = 0; j < trl_max_levels; j++) {
fact_info->lp_clipping_ratio_license_sse * /* No AVX level name for SSE to be consistent with previous formatting */
DISP_FREQ_MULTIPLIER); if (j == 0)
format_and_print(outf, base_level + 2, header, value); snprintf(header, sizeof(header), "low-priority-max-frequency(MHz)");
snprintf(header, sizeof(header), else
"low-priority-max-avx2-frequency(MHz)"); snprintf(header, sizeof(header), "low-priority-max-%s-frequency(MHz)",
snprintf(value, sizeof(value), "%d", isst_get_trl_level_name(j));
fact_info->lp_clipping_ratio_license_avx2 * snprintf(value, sizeof(value), "%d",
DISP_FREQ_MULTIPLIER); fact_info->lp_ratios[j] * DISP_FREQ_MULTIPLIER);
format_and_print(outf, base_level + 2, header, value); 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);
} }
void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix, void isst_ctdp_display_core_info(struct isst_id *id, FILE *outf, char *prefix,
......
...@@ -98,10 +98,8 @@ struct isst_clos_config { ...@@ -98,10 +98,8 @@ struct isst_clos_config {
}; };
struct isst_fact_bucket_info { struct isst_fact_bucket_info {
int high_priority_cores_count; int hp_cores;
int sse_trl; int hp_ratios[TRL_MAX_LEVELS];
int avx_trl;
int avx512_trl;
}; };
struct isst_pbf_info { struct isst_pbf_info {
...@@ -119,9 +117,7 @@ struct isst_pbf_info { ...@@ -119,9 +117,7 @@ struct isst_pbf_info {
#define ISST_TRL_MAX_ACTIVE_CORES 8 #define ISST_TRL_MAX_ACTIVE_CORES 8
#define ISST_FACT_MAX_BUCKETS 8 #define ISST_FACT_MAX_BUCKETS 8
struct isst_fact_info { struct isst_fact_info {
int lp_clipping_ratio_license_sse; int lp_ratios[TRL_MAX_LEVELS];
int lp_clipping_ratio_license_avx2;
int lp_clipping_ratio_license_avx512;
struct isst_fact_bucket_info bucket_info[ISST_FACT_MAX_BUCKETS]; struct isst_fact_bucket_info bucket_info[ISST_FACT_MAX_BUCKETS];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment