diff options
author | Zhang Rui <rui.zhang@intel.com> | 2022-08-09 01:52:11 +0800 |
---|---|---|
committer | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2023-03-22 13:36:51 -0700 |
commit | 4a17b29188734f6ec4d9835d74a7489e3409c692 (patch) | |
tree | 005b7aef696182cb3a184ef9c3e53f4dd1e54eeb | |
parent | 855932831511eef31b5e71c3b6155fd8c57e2a0b (diff) | |
download | linux-stable-4a17b29188734f6ec4d9835d74a7489e3409c692.tar.gz linux-stable-4a17b29188734f6ec4d9835d74a7489e3409c692.tar.bz2 linux-stable-4a17b29188734f6ec4d9835d74a7489e3409c692.zip |
tools/power/x86/intel-speed-select: Abstract get_get_trls
Allow platform specific implementation to get turbo ratio limits of each
AVX level, for a selected SST-PP level.
No functional changes are expected.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[srinivas.pandruvada@linux.intel.com: changelog edits]
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-core-mbox.c | 14 | ||||
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-core.c | 17 | ||||
-rw-r--r-- | tools/power/x86/intel-speed-select/isst.h | 1 |
3 files changed, 24 insertions, 8 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-core-mbox.c b/tools/power/x86/intel-speed-select/isst-core-mbox.c index 8d62bafcaca5..2ea7ef4ef446 100644 --- a/tools/power/x86/intel-speed-select/isst-core-mbox.c +++ b/tools/power/x86/intel-speed-select/isst-core-mbox.c @@ -338,6 +338,19 @@ static int mbox_get_get_trl(struct isst_id *id, int level, int avx_level, int *t return 0; } +static int mbox_get_get_trls(struct isst_id *id, int level, struct isst_pkg_ctdp_level_info *ctdp_level) +{ + int trl_max_levels = isst_get_trl_max_levels(); + int i, ret; + + for (i = 0; i < trl_max_levels; i++) { + ret = mbox_get_get_trl(id, level, i, ctdp_level->trl_ratios[i]); + if (ret) + return ret; + } + return 0; +} + static int mbox_get_trl_bucket_info(struct isst_id *id, int level, unsigned long long *buckets_info) { int ret; @@ -598,6 +611,7 @@ static struct isst_platform_ops mbox_ops = { .get_pwr_info = mbox_get_pwr_info, .get_coremask_info = mbox_get_coremask_info, .get_get_trl = mbox_get_get_trl, + .get_get_trls = mbox_get_get_trls, .get_trl_bucket_info = mbox_get_trl_bucket_info, .set_tdp_level = mbox_set_tdp_level, .get_pbf_info = mbox_get_pbf_info, diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c index 27049e283eb3..f4e3a91dc4c2 100644 --- a/tools/power/x86/intel-speed-select/isst-core.c +++ b/tools/power/x86/intel-speed-select/isst-core.c @@ -346,6 +346,12 @@ int isst_get_get_trl(struct isst_id *id, int level, int avx_level, int *trl) return isst_ops->get_get_trl(id, level, avx_level, trl); } +int isst_get_get_trls(struct isst_id *id, int level, struct isst_pkg_ctdp_level_info *ctdp_level) +{ + CHECK_CB(get_get_trls); + return isst_ops->get_get_trls(id, level, ctdp_level); +} + int isst_get_trl_bucket_info(struct isst_id *id, int level, unsigned long long *buckets_info) { CHECK_CB(get_trl_bucket_info); @@ -550,8 +556,6 @@ int isst_get_process_ctdp(struct isst_id *id, int tdp_level, struct isst_pkg_ctd for (i = 0; i <= pkg_dev->levels; ++i) { struct isst_pkg_ctdp_level_info *ctdp_level; - int trl_max_levels = isst_get_trl_max_levels(); - int j; if (tdp_level != 0xff && i != tdp_level) continue; @@ -618,12 +622,9 @@ int isst_get_process_ctdp(struct isst_id *id, int tdp_level, struct isst_pkg_ctd if (ret) return ret; - for (j = 0; j < trl_max_levels; j++) { - ret = isst_get_get_trl(id, i, j, - ctdp_level->trl_ratios[j]); - if (ret) - return ret; - } + ret = isst_get_get_trls(id, i, ctdp_level); + if (ret) + return ret; } if (!valid) diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h index e113a2bef404..b17fcf737560 100644 --- a/tools/power/x86/intel-speed-select/isst.h +++ b/tools/power/x86/intel-speed-select/isst.h @@ -192,6 +192,7 @@ struct isst_platform_ops { int (*get_pwr_info)(struct isst_id *id, int config_index, struct isst_pkg_ctdp_level_info *ctdp_level); int (*get_coremask_info)(struct isst_id *id, int config_index, struct isst_pkg_ctdp_level_info *ctdp_level); int (*get_get_trl)(struct isst_id *id, int level, int avx_level, int *trl); + int (*get_get_trls)(struct isst_id *id, int level, struct isst_pkg_ctdp_level_info *ctdp_level); int (*get_trl_bucket_info)(struct isst_id *id, int level, unsigned long long *buckets_info); int (*set_tdp_level)(struct isst_id *id, int tdp_level); int (*get_pbf_info)(struct isst_id *id, int level, struct isst_pbf_info *pbf_info); |