Commit af5ba6d2 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher
Browse files

drm/amd/powerplay: common API for disabling all features with exception



We are moving to centralize all feature enablement/support checking and
setting APIs in smu_cmn.c.

Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7dbf7805
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1108,7 +1108,6 @@ static int smu_hw_init(void *handle)
static int smu_disable_dpms(struct smu_context *smu)
{
	struct amdgpu_device *adev = smu->adev;
	uint64_t features_to_disable;
	int ret = 0;
	bool use_baco = !smu->is_apu &&
		((adev->in_gpu_reset &&
@@ -1144,13 +1143,8 @@ static int smu_disable_dpms(struct smu_context *smu)
	 * BACO feature has to be kept enabled.
	 */
	if (use_baco && smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) {
		features_to_disable = U64_MAX &
			~(1ULL << smu_cmn_to_asic_specific_index(smu,
							CMN2ASIC_MAPPING_FEATURE,
							SMU_FEATURE_BACO_BIT));
		ret = smu_feature_update_enable_state(smu,
						      features_to_disable,
						      0);
		ret = smu_disable_all_features_with_exception(smu,
							      SMU_FEATURE_BACO_BIT);
		if (ret)
			dev_err(adev->dev, "Failed to disable smu features except BACO.\n");
	} else {
+1 −0
Original line number Diff line number Diff line
@@ -2286,6 +2286,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
	.set_allowed_mask = smu_v11_0_set_allowed_mask,
	.get_enabled_mask = smu_cmn_get_enabled_mask,
	.feature_is_enabled = smu_cmn_feature_is_enabled,
	.disable_all_features_with_exception = smu_cmn_disable_all_features_with_exception,
	.notify_display_change = NULL,
	.set_power_limit = smu_v11_0_set_power_limit,
	.init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
+1 −0
Original line number Diff line number Diff line
@@ -534,6 +534,7 @@ struct pptable_funcs {
	int (*set_allowed_mask)(struct smu_context *smu);
	int (*get_enabled_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num);
	int (*feature_is_enabled)(struct smu_context *smu, enum smu_feature_mask mask);
	int (*disable_all_features_with_exception)(struct smu_context *smu, enum smu_feature_mask mask);
	int (*notify_display_change)(struct smu_context *smu);
	int (*set_power_limit)(struct smu_context *smu, uint32_t n);
	int (*init_max_sustainable_clocks)(struct smu_context *smu);
+1 −0
Original line number Diff line number Diff line
@@ -2301,6 +2301,7 @@ static const struct pptable_funcs navi10_ppt_funcs = {
	.set_allowed_mask = smu_v11_0_set_allowed_mask,
	.get_enabled_mask = smu_cmn_get_enabled_mask,
	.feature_is_enabled = smu_cmn_feature_is_enabled,
	.disable_all_features_with_exception = smu_cmn_disable_all_features_with_exception,
	.notify_display_change = smu_v11_0_notify_display_change,
	.set_power_limit = smu_v11_0_set_power_limit,
	.init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
+1 −0
Original line number Diff line number Diff line
@@ -1020,6 +1020,7 @@ static const struct pptable_funcs renoir_ppt_funcs = {
	.set_default_dpm_table = smu_v12_0_set_default_dpm_tables,
	.get_enabled_mask = smu_cmn_get_enabled_mask,
	.feature_is_enabled = smu_cmn_feature_is_enabled,
	.disable_all_features_with_exception = smu_cmn_disable_all_features_with_exception,
	.get_dpm_ultimate_freq = renoir_get_dpm_ultimate_freq,
	.mode2_reset = smu_v12_0_mode2_reset,
	.set_soft_freq_limited_range = smu_v12_0_set_soft_freq_limited_range,
Loading