Commit 1fcf670e authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Hans de Goede
Browse files

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 80a513e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+8 −2
Original line number Diff line number Diff line
@@ -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;

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

+1 −0
Original line number Diff line number Diff line
@@ -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: