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;
.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,
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);
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;
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)
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);