tools/power/x86/intel-speed-select: SST BF/TF support per level

SST BF and TF can be enabled/disabled per level. So check the current
level support from the mask of supported levels.

This change from a single level to mask for info.sst_tf_support and
info.sst_tf_support is indicated by API version change. Use as mask for
API version above 2. In this way there is no change in behavior when
running on older kernel with API version 2.

Since the tool can support now API version 3, update the supported API
version.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Srinivas Pandruvada 2024-03-26 18:55:53 -04:00 committed by Hans de Goede
parent 80a513e3f7
commit 1fcf670e50
3 changed files with 10 additions and 3 deletions

View file

@ -18,7 +18,7 @@ struct process_cmd_struct {
static const char *version_str = "v1.18";
static const int supported_api_ver = 2;
static const int supported_api_ver = 3;
static struct isst_if_platform_info isst_platform_info;
static char *progname;
static int debug_flag;

View file

@ -194,8 +194,14 @@ static int tpmi_get_ctdp_control(struct isst_id *id, int config_index,
if (!(info.level_mask & level_mask))
return -1;
ctdp_level->fact_support = info.sst_tf_support;
ctdp_level->pbf_support = info.sst_bf_support;
if (api_version() > 2) {
ctdp_level->fact_support = info.sst_tf_support & BIT(config_index);
ctdp_level->pbf_support = info.sst_bf_support & BIT(config_index);
} else {
ctdp_level->fact_support = info.sst_tf_support;
ctdp_level->pbf_support = info.sst_bf_support;
}
ctdp_level->fact_enabled = !!(info.feature_state & BIT(1));
ctdp_level->pbf_enabled = !!(info.feature_state & BIT(0));

View file

@ -23,6 +23,7 @@ int isst_set_platform_ops(int api_version)
isst_ops = mbox_get_platform_ops();
break;
case 2:
case 3:
isst_ops = tpmi_get_platform_ops();
break;
default: