drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir
Subsystems (3)
PATCH 1/7 drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir
As other dGPU asics, Renoir should use smu_cmn_get_enabled_mask() for that job.
--- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +2 -1
@@ -710,7 +710,8 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,size_t size =0 ;int ret =0 , i; -if (!smu->is_apu) { +if (!smu->is_apu || + (smu->adev->asic_type ==CHIP_RENOIR )) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );
Signature · 1 line
2.29.0
PATCH 2/7 drm/amd/pm: unify the interface for retrieving enabled ppfeatures
Instead of having two which do the same thing.
--- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 2 +- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 6 +- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 93 ++++++++----------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 4 - 5 files changed, 44 insertions(+), 67 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c +1 -1
@@ -373,7 +373,7 @@ static bool cyan_skillfish_is_dpm_running(struct smu_context *smu)if (adev->in_suspend)return false; - ret =smu_cmn_get_enabled_32_bits_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );if (ret)return false;
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +3 -3
@@ -507,7 +507,7 @@ static bool vangogh_is_dpm_running(struct smu_context *smu)if (adev->in_suspend)return false; - ret =smu_cmn_get_enabled_32_bits_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );if (ret)return false;
@@ -1965,7 +1965,7 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en)if (!en)return ret; - ret =smu_cmn_get_enabled_32_bits_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );if (ret)return ret;
@@ -2182,7 +2182,7 @@ static const struct pptable_funcs vangogh_ppt_funcs = { .dpm_set_jpeg_enable = vangogh_dpm_set_jpeg_enable, .is_dpm_running = vangogh_is_dpm_running, .read_sensor = vangogh_read_sensor, - .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, + .get_enabled_mask = smu_cmn_get_enabled_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, .set_watermarks_table = vangogh_set_watermarks_table, .set_driver_table_location = smu_v11_0_set_driver_table_location,
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +3 -3
@@ -209,7 +209,7 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en)if (!en)return ret; - ret =smu_cmn_get_enabled_32_bits_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );if (ret)return ret;
@@ -258,7 +258,7 @@ static bool yellow_carp_is_dpm_running(struct smu_context *smu)uint32_t feature_mask[2 ];uint64_t feature_enabled; - ret =smu_cmn_get_enabled_32_bits_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );if (ret)return false;
@@ -1174,7 +1174,7 @@ static const struct pptable_funcs yellow_carp_ppt_funcs = { .is_dpm_running = yellow_carp_is_dpm_running, .set_watermarks_table = yellow_carp_set_watermarks_table, .get_gpu_metrics = yellow_carp_get_gpu_metrics, - .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask, + .get_enabled_mask = smu_cmn_get_enabled_mask, .get_pp_feature_mask = smu_cmn_get_pp_feature_mask, .set_driver_table_location = smu_v13_0_set_driver_table_location, .gfx_off_control = smu_v13_0_gfx_off_control,
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +37 -56
124 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0 -4
@@ -61,10 +61,6 @@ int smu_cmn_get_enabled_mask(struct smu_context *smu,uint32_t *feature_mask, uint32_t num); -int smu_cmn_get_enabled_32_bits_mask (struct smu_context *smu, -uint32_t *feature_mask, -uint32_t num); -uint64_t smu_cmn_get_indep_throttler_status (const unsigned long dep_status,const uint8_t *throttler_map);
Signature · 1 line
2.29.0
PATCH 3/7 drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
In reply to Evan QuanAs it has exactly the same value as the 'enabled' member and also do the same thing.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++----------- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -1
@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -1
@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +4 -4
@@ -1625,8 +1625,8 @@ static int navi10_display_config_changed(struct smu_context *smu)int ret =0 ;if ((smu->watermarks_bitmap &WATERMARKS_EXIST ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_NumOfDisplays, smu->display_config->num_display,NULL );
@@ -1864,13 +1864,13 @@ static int navi10_notify_smc_display_config(struct smu_context *smu) min_clocks.dcef_clock_in_sr = smu->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config->min_mem_set_clock; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret =smu_v11_0_display_clock_voltage_request (smu, &clock_req);if (!ret) { -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetMinDeepSleepDcefclk, min_clocks.dcef_clock_in_sr/100,
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +5 -5
@@ -1281,8 +1281,8 @@ static int sienna_cichlid_display_config_changed(struct smu_context *smu)int ret =0 ;if ((smu->watermarks_bitmap &WATERMARKS_EXIST ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) {#if 0 ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_NumOfDisplays, smu->display_config->num_display,
@@ -1521,13 +1521,13 @@ static int sienna_cichlid_notify_smc_display_config(struct smu_context *smu) min_clocks.dcef_clock_in_sr = smu->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config->min_mem_set_clock; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret =smu_v11_0_display_clock_voltage_request (smu, &clock_req);if (!ret) { -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetMinDeepSleepDcefclk, min_clocks.dcef_clock_in_sr/100,
@@ -3752,7 +3752,7 @@ static int sienna_cichlid_gpo_control(struct smu_context *smu,int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_GFX_GPO_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_GFX_GPO_BIT )) { ret =smu_cmn_get_smc_version (smu,NULL , &smu_version);if (ret)return ret;
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +8 -11
@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct smu_context *smu,return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );
@@ -817,8 +816,6 @@ int smu_v11_0_system_features_control(struct smu_context *smu,bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num); }return ret;
@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control) {int ret =0 ; -if (!smu_cmn_feature_is_supported (smu,SMU_FEATURE_FAN_CONTROL_BIT )) +if (!smu_cmn_feature_is_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT ))return 0 ; ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT , auto_fan_control);
@@ -1607,7 +1604,7 @@ bool smu_v11_0_baco_is_support(struct smu_context *smu)return false;/* Arcturus does not support this bit mask */ -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_BACO_BIT ) && +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_BACO_BIT ) && !smu_cmn_feature_is_enabled (smu,SMU_FEATURE_BACO_BIT ))return false;
@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct smu_context *smu, {int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_GFX_ULV_BIT )) +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_GFX_ULV_BIT )) ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_GFX_ULV_BIT , enablement);return ret;
@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu,struct amdgpu_device *adev = smu->adev;int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_GFXCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_GFXCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_GFXCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s GFXCLK DS!\n" , enablement ?"enable" :"disable" );
@@ -2170,7 +2167,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_UCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_UCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_UCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s UCLK DS!\n" , enablement ?"enable" :"disable" );
@@ -2178,7 +2175,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_FCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_FCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_FCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s FCLK DS!\n" , enablement ?"enable" :"disable" );
@@ -2186,7 +2183,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_SOCCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_SOCCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_SOCCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s SOCCLK DS!\n" , enablement ?"enable" :"disable" );
@@ -2194,7 +2191,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_LCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_LCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_LCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s LCLK DS!\n" , enablement ?"enable" :"disable" );
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1 -4
@@ -1960,7 +1960,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;
@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en)bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }
@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct smu_context *smu) adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_GFXCLK_BIT ) && +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_GFXCLK_BIT ) && (adev->pg_flags &AMD_PG_SUPPORT_GFX_PG )) { ret =smu_cmn_send_smc_msg (smu, SMU_MSG_EnableGfxOff,NULL );if (ret) {
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1 -4
@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct smu_context *smu,return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );
@@ -783,8 +782,6 @@ int smu_v13_0_system_features_control(struct smu_context *smu,bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num); }return ret;
@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control) {int ret =0 ; -if (!smu_cmn_feature_is_supported (smu,SMU_FEATURE_FAN_CONTROL_BIT )) +if (!smu_cmn_feature_is_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT ))return 0 ; ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT , auto_fan_control);
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0 -3
@@ -204,7 +204,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en) ret =smu_cmn_send_smc_msg (smu, SMU_MSG_PrepareMp1ForUnload,NULL );bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;
@@ -215,8 +214,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en)bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -17
@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu, } } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_FEATURE , - mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0 -3
@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu,enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
Signature · 1 line
2.29.0
Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
Quoted 3 lines · Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing.
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not supported.
Thanks,
Lijo
Quoted 327 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++----------- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +4
-4@@ -1625,8 +1625,8 @@ static int navi10_display_config_changed(struct smu_context *smu)int ret =0 ;if ((smu->watermarks_bitmap &WATERMARKS_EXIST ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_NumOfDisplays, smu->display_config->num_display,NULL );@@ -1864,13 +1864,13 @@ static int navi10_notify_smc_display_config(struct smu_context *smu) min_clocks.dcef_clock_in_sr = smu->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config->min_mem_set_clock; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret =smu_v11_0_display_clock_voltage_request (smu, &clock_req);if (!ret) { -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetMinDeepSleepDcefclk, min_clocks.dcef_clock_in_sr/100,drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +5
-5@@ -1281,8 +1281,8 @@ static int sienna_cichlid_display_config_changed(struct smu_context *smu)int ret =0 ;if ((smu->watermarks_bitmap &WATERMARKS_EXIST ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && -smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) { +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT ) && +smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_SOCCLK_BIT )) {#if 0 ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_NumOfDisplays, smu->display_config->num_display,@@ -1521,13 +1521,13 @@ static int sienna_cichlid_notify_smc_display_config(struct smu_context *smu) min_clocks.dcef_clock_in_sr = smu->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config->min_mem_set_clock; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_DCEFCLK_BIT )) { clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret =smu_v11_0_display_clock_voltage_request (smu, &clock_req);if (!ret) { -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_DCEFCLK_BIT )) { ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetMinDeepSleepDcefclk, min_clocks.dcef_clock_in_sr/100,@@ -3752,7 +3752,7 @@ static int sienna_cichlid_gpo_control(struct smu_context *smu,int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_GFX_GPO_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_GFX_GPO_BIT )) { ret =smu_cmn_get_smc_version (smu,NULL , &smu_version);if (ret)return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +8
-11@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct smu_context *smu,return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -817,8 +816,6 @@ int smu_v11_0_system_features_control(struct smu_context *smu,bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control) {int ret =0 ; -if (!smu_cmn_feature_is_supported (smu,SMU_FEATURE_FAN_CONTROL_BIT )) +if (!smu_cmn_feature_is_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT ))return 0 ; ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT , auto_fan_control);@@ -1607,7 +1604,7 @@ bool smu_v11_0_baco_is_support(struct smu_context *smu)return false;/* Arcturus does not support this bit mask */ -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_BACO_BIT ) && +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_BACO_BIT ) && !smu_cmn_feature_is_enabled (smu,SMU_FEATURE_BACO_BIT ))return false;@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct smu_context *smu, {int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_GFX_ULV_BIT )) +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_GFX_ULV_BIT )) ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_GFX_ULV_BIT , enablement);return ret;@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu,struct amdgpu_device *adev = smu->adev;int ret =0 ; -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_GFXCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_GFXCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_GFXCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s GFXCLK DS!\n" , enablement ?"enable" :"disable" );@@ -2170,7 +2167,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_UCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_UCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_UCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s UCLK DS!\n" , enablement ?"enable" :"disable" );@@ -2178,7 +2175,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_FCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_FCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_FCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s FCLK DS!\n" , enablement ?"enable" :"disable" );@@ -2186,7 +2183,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_SOCCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_SOCCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_SOCCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s SOCCLK DS!\n" , enablement ?"enable" :"disable" );@@ -2194,7 +2191,7 @@ int smu_v11_0_deep_sleep_control(struct smu_context *smu, } } -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DS_LCLK_BIT )) { +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DS_LCLK_BIT )) { ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_DS_LCLK_BIT , enablement);if (ret) {dev_err (adev->dev,"Failed to %s LCLK DS!\n" , enablement ?"enable" :"disable" );drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-4@@ -1960,7 +1960,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en)bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct smu_context *smu) adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ -if (smu_cmn_feature_is_supported (smu,SMU_FEATURE_DPM_GFXCLK_BIT ) && +if (smu_cmn_feature_is_enabled (smu,SMU_FEATURE_DPM_GFXCLK_BIT ) && (adev->pg_flags &AMD_PG_SUPPORT_GFX_PG )) { ret =smu_cmn_send_smc_msg (smu, SMU_MSG_EnableGfxOff,NULL );if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-4@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct smu_context *smu,return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -783,8 +782,6 @@ int smu_v13_0_system_features_control(struct smu_context *smu,bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control) {int ret =0 ; -if (!smu_cmn_feature_is_supported (smu,SMU_FEATURE_FAN_CONTROL_BIT )) +if (!smu_cmn_feature_is_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT ))return 0 ; ret =smu_cmn_feature_set_enabled (smu,SMU_FEATURE_FAN_CONTROL_BIT , auto_fan_control);drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-3@@ -204,7 +204,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en) ret =smu_cmn_send_smc_msg (smu, SMU_MSG_PrepareMp1ForUnload,NULL );bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -215,8 +214,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en)bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-17@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu, } } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id =smu_cmn_to_asic_specific_index (smu, -CMN2ASIC_MAPPING_FEATURE , - mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu,enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
RE: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
[AMD Official Use Only]
Quoted 12 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 4:52 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureOn 1/21/2022 1:14 PM, Evan Quan wrote:
Quoted 8 lines
Quoted 3 lines
As it has exactly the same value as the 'enabled' member and also do the same thing.
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not supported.
[Quan, Evan] Uh, I doubt it was designed with such intention. As if it was, there should be checks in ->get_allowed_feature_mask(e.g. navi10_get_allowed_feature_mask) whether driver tries to enable/disable different features from PMFW.
" When a request comes through sysfs node for enable/disable of a feature" If the sysfs node mentioned is "pp_features", I might be able to provide some insights why there is no such checks added when I made them. Considering there may be some dependency between those dpm features(e.g. gfx ulv depends on gfx dpm), we actually cannot guard user whether their settings will succeed. E.g. If PMFW supports both GFX ULV and DPM but user wants ULV only, the checks against pmfw supported features seem fine. But actually that cannot work due to the dependency between them. So, instead of applying some checks which actually cannot guard anything, we just let user take the risks.
BR
Evan
Quoted 448 lines
Thanks,
LijoQuoted 8 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++-----------
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct
Quoted 39 lines
.../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1625,8 +1625,8 @@ static int navi10_display_config_changed(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1629
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1628
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1629
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1630
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0smu->display_config- num_display,NULL);
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1864,13 +1864,13 @@ static int
navi10_notify_smc_display_config(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config- min_mem_set_clock; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_notify_smc_display_config(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1if (!ret) { - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1876
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, diff --git
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int
Quoted 6 lines
a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cindex651fe748e423..d568d6137a00100644drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0@@ -1281,8 +1281,8 @@ static int
sienna_cichlid_display_config_changed(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1287
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0#if 0 ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0smu->display_config-
num_display, @@ -1521,13 +1521,13 @@
static int sienna_cichlid_notify_smc_display_config(structsmu_context*smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 6 lines
min_clocks.dcef_clock_in_sr = smu->display_config-
min_dcef_deep_sleep_set_clk;
min_clocks.memory_clock = smu->display_config-min_mem_set_clock;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 4 lines
clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock * 10;ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 2 lines
if (!ret) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {Quoted 1 line
ret =
smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, @@ -3752,7 +3752,7 @@
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 5 lines
static int sienna_cichlid_gpo_control(struct
smu_context*smu,
int ret = 0;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {Quoted 1 line
ret = smu_cmn_get_smc_version(smu, NULL,
&smu_version);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct
Quoted 8 lines
if (ret)
return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct smu_context *smu, · line 813
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -817,8
Quoted 4 lines
+816,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,bitmap_copy(feature->enabled, (unsigned long
*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1186
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,Quoted 1 line
auto_fan_control); @@ -1607,7 +1604,7 @@ bool
smu_v11_0_baco_is_support(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
return false;
/* Arcturus does not support this bit mask */
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct
Quoted 4 lines
!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_BACO_BIT))
return false;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2150
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2151
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0enablement);return ret;
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct smu_context *smu,
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1struct amdgpu_device *adev = smu->adev;int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2162
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2163
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT, enablement);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2165
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0if (ret) { dev_err(adev->dev, "Failed to %s GFXCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2170,7 +2167,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_UCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT, enablement);Quoted 2 lines
if (ret) {
dev_err(adev->dev, "Failed to %s UCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2178,7 +2175,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_FCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT, enablement);Quoted 2 lines
if (ret) {
dev_err(adev->dev, "Failed to %s FCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2186,7 +2183,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT, enablement);Quoted 2 lines
if (ret) {
dev_err(adev->dev, "Failed to %s SOCCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2194,7 +2191,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_LCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT, enablement);Quoted 2 lines
if (ret) {
dev_err(adev->dev, "Failed to %s LCLK DS!\n",enablement ?
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 7 lines
"enable" : "disable"); diff --git
a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cindexb4a3c9b8b54e..e72831aa4859100644drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1960,7 +1960,6 @@ static int
vangogh_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1993
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1990
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1992
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_EnableGfxOff, NULL);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct
Quoted 7 lines
if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct · line 779
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -783,8
Quoted 4 lines
+782,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,bitmap_copy(feature->enabled, (unsigned long
*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1071
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int
Quoted 7 lines
auto_fan_control); diff --gita/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cindexf425827e2361..e9172622c0c4100644drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -204,7 +204,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 204
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_PrepareMp1ForUnload,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct
Quoted 23 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2@@ -215,8 +214,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-0@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct smu_context *smu, · line 490
Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-8} } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_FEATURE,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-9- mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
Quoted 20 lines · Evan
[AMD Official Use Only]
Quoted 16 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 4:52 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 3 lines · Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing.
Quoted 7 lines
Quoted 4 lines
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not supported.
[Quan, Evan] Uh, I doubt it was designed with such intention. As if it was, there should be checks in ->get_allowed_feature_mask(e.g.
navi10_get_allowed_feature_mask) whether driver tries to enable/disable different features from PMFW.
" When a request comes through sysfs node for enable/disable of a feature" If the sysfs node mentioned is "pp_features", I might be able to provide some insights why there is no such checks added when I made them. Considering there may be some dependency between those dpm features(e.g. gfx ulv depends on gfx dpm), we actually cannot guard user whether their settings will succeed. E.g. If PMFW supports both GFX ULV and DPM but user wants ULV only, the checks against pmfw supported features seem fine. But actually that cannot work due to the dependency between them. So, instead of applying some checks which actually cannot guard anything, we just let user take the risks.
Below is one example
Review
Quoted 1 line
(quoted diff) +0
-1- if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))
Review
Quoted 1 line
(quoted diff) +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))
Let's say user switched to manual mode, that time we disable fan control and move to manual mode. Next time when user requests auto mode, we check if fan control is originally supported on that platform and switch to auto.
Either way, we should cache the features which are originally supported on the platform (through a combination of PPTable features and allowed feature masks on ASICs which are applicable) and disallow anything outside of that.
Thanks,
Lijo
Quoted 450 lines
BR
EvanQuoted 448 lines
Thanks,
LijoQuoted 8 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++-----------
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct
Quoted 39 lines
.../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1625,8 +1625,8 @@ static int navi10_display_config_changed(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1629
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1628
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1629
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_display_config_changed(struct · line 1630
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0smu->display_config- num_display,NULL);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1864,13 +1864,13 @@ static int
navi10_notify_smc_display_config(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config- min_mem_set_clock; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_notify_smc_display_config(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1if (!ret) { - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1876
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, diff --git
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int
Quoted 6 lines
a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cindex651fe748e423..d568d6137a00100644drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0@@ -1281,8 +1281,8 @@ static int
sienna_cichlid_display_config_changed(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1287
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0#if 0 ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0smu->display_config-
num_display, @@ -1521,13 +1521,13 @@
static int sienna_cichlid_notify_smc_display_config(structsmu_context*smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 6 lines
min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config-
min_mem_set_clock;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 4 lines
clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock * 10;ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 2 lines
if (!ret) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {Quoted 1 line
ret =
smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, @@ -3752,7 +3752,7 @@
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 5 lines
static int sienna_cichlid_gpo_control(struct
smu_context*smu,
int ret = 0;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {Quoted 1 line
ret = smu_cmn_get_smc_version(smu, NULL,
&smu_version);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct
Quoted 8 lines
if (ret) return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct smu_context *smu, · line 813
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -817,8
Quoted 4 lines
+816,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1186
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,Quoted 1 line
auto_fan_control); @@ -1607,7 +1604,7 @@ bool
smu_v11_0_baco_is_support(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
return false; /* Arcturus does not support this bit mask */drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct
Quoted 4 lines
!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) return false;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2150
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2151
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0enablement);return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct smu_context *smu,
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1struct amdgpu_device *adev = smu->adev;int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2162
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2163
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT, enablement);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2165
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0if (ret) { dev_err(adev->dev, "Failed to %s GFXCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2170,7 +2167,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_UCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s UCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2178,7 +2175,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_FCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s FCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2186,7 +2183,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s SOCCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2194,7 +2191,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_LCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s LCLK DS!\n",enablement ?
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 7 lines
"enable" : "disable"); diff --git
a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cindexb4a3c9b8b54e..e72831aa4859100644drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1960,7 +1960,6 @@ static int
vangogh_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1993
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1990
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1992
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_EnableGfxOff, NULL);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct
Quoted 7 lines
if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct · line 779
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -783,8
Quoted 4 lines
+782,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1071
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int
Quoted 7 lines
auto_fan_control); diff --gita/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cindexf425827e2361..e9172622c0c4100644drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -204,7 +204,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 204
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_PrepareMp1ForUnload,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct
Quoted 23 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2@@ -215,8 +214,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-0@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct smu_context *smu, · line 490
Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-8} } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_FEATURE,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-9- mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
RE: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
[AMD Official Use Only]
Quoted 55 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 5:37 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 24 lines · Evan
[AMD Official Use Only]
Quoted 20 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 4:52 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 3 lines · Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing.
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not
supported.
Quoted 1 line
[Quan, Evan] Uh, I doubt it was designed with such intention. As if it was,
there should be checks in ->get_allowed_feature_mask(e.g.
navi10_get_allowed_feature_mask) whether driver tries to enable/disable different features from PMFW.Quoted 1 line
" When a request comes through sysfs node for enable/disable of a
feature" If the sysfs node mentioned is "
pp_features", I might be able to provide some insights why there is no such checks added when I made them. Considering there may be some dependency between those dpm features(e.g. gfx ulv depends on gfx dpm), we actually cannot guard user whether their settings will succeed. E.g. If PMFW supports both GFX ULV and DPM but user wants ULV only, the checks against pmfw supported features seem fine. But actually that cannot work due to the dependency between them. So, instead of applying some checks which actually cannot guard anything, we just let user take the risks.Quoted 1 line
Below is one example
Quoted 9 lines
Review
Quoted 1 line
(quoted diff) +0
-1- if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Review
Quoted 1 line
(quoted diff) +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Let's say user switched to manual mode, that time we disable fan control and move to manual mode. Next time when user requests auto mode, we check if fan control is originally supported on that platform and switch to auto.
[Quan, Evan] Logically yes. But in reality I assume this should not happen. As during our post-silicon bringup, we enable those features(and corresponding sysfs interfaces)support only after verified. It means if the feature(auto fan control) is not supported, the sysfs interface should be not visible to user.
Quoted 4 lines
Either way, we should cache the features which are originally supported on the platform (through a combination of PPTable features and allowed feature masks on ASICs which are applicable) and disallow anything outside of that.
[Quan, Evan] Although I doubt the necessity of such cache. But I do keep a structure member "feature->allowed" which does the similar job. It may be more reasonable to expand its scope to handle the job described here.
BR
Evan
Quoted 459 lines
Thanks,
LijoQuoted 14 lines
BR
EvanQuoted 12 lines
Thanks,
LijoQuoted 8 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++-------
Quoted 156 lines
Quoted 156 lines
----
Quoted 39 lines
.../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1625,8 +1625,8 @@ static intQuoted 1 line
navi10_display_config_changed(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 4 lines
int ret = 0;if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int
Quoted 4 lines
smu->display_config-
num_display,
NULL);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1864,13 +1864,13 @@ static int
navi10_notify_smc_display_config(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config- min_mem_set_clock; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_notify_smc_display_config(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1if (!ret) { - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1876
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, diff --git
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int
Quoted 6 lines
a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cindex651fe748e423..d568d6137a00100644drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0@@ -1281,8 +1281,8 @@ static int
sienna_cichlid_display_config_changed(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1287
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0#if 0 ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0smu->display_config-
num_display, @@ -1521,13 +1521,13 @@ static int sienna_cichlid_notify_smc_display_config(structsmu_context*smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 6 lines
min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config-
min_mem_set_clock;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 4 lines
clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock * 10;ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 2 lines
if (!ret) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {Quoted 1 line
ret =
smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, @@ -3752,7 +3752,7 @@
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 5 lines
static int sienna_cichlid_gpo_control(struct
smu_context*smu,
int ret = 0;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {Quoted 1 line
ret = smu_cmn_get_smc_version(smu, NULL,
&smu_version);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct
Quoted 8 lines
if (ret) return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return ret;Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct smu_context *smu, · line 813
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -817,8
Quoted 1 line
+816,6 @@ int smu_v11_0_system_features_control(struct
smu_contextQuoted 168 lines
Quoted 168 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1186
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,Quoted 1 line
auto_fan_control); @@ -1607,7 +1604,7 @@ bool
smu_v11_0_baco_is_support(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
return false; /* Arcturus does not support this bit mask */drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct
Quoted 4 lines
!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) return false;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2150
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2151
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0enablement);return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct smu_context *smu,
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1struct amdgpu_device *adev = smu->adev;int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2162
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2163
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT, enablement);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2165
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0if (ret) { dev_err(adev->dev, "Failed to %s GFXCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2170,7 +2167,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_UCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s UCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2178,7 +2175,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_FCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s FCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2186,7 +2183,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s SOCCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2194,7 +2191,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_LCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s LCLK DS!\n",enablement ?
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 7 lines
"enable" : "disable"); diff --git
a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cindexb4a3c9b8b54e..e72831aa4859100644drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1960,7 +1960,6 @@ static int
vangogh_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1993
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1990
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1992
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_EnableGfxOff, NULL);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct
Quoted 7 lines
if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return ret;Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct · line 779
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -783,8
Quoted 1 line
+782,6 @@ int smu_v13_0_system_features_control(struct
smu_contextQuoted 100 lines
Quoted 100 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1071
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int
Quoted 7 lines
auto_fan_control); diff --gita/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cindexf425827e2361..e9172622c0c4100644drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -204,7 +204,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 204
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_PrepareMp1ForUnload,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct
Quoted 24 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -215,8 +214,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2-bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-0@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct smu_context *smu, · line 490
Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-8} } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_FEATURE,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-9- mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
Quoted 64 lines · Evan
[AMD Official Use Only]
Quoted 60 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 5:37 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 24 lines · Evan
[AMD Official Use Only]
Quoted 20 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 4:52 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 3 lines · Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing.
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not
supported.
Quoted 1 line
[Quan, Evan] Uh, I doubt it was designed with such intention. As if it was,
there should be checks in ->get_allowed_feature_mask(e.g.
navi10_get_allowed_feature_mask) whether driver tries to enable/disable different features from PMFW.Quoted 1 line
" When a request comes through sysfs node for enable/disable of a
feature" If the sysfs node mentioned is "
pp_features", I might be able to provide some insights why there is no such checks added when I made them. Considering there may be some dependency between those dpm features(e.g. gfx ulv depends on gfx dpm), we actually cannot guard user whether their settings will succeed. E.g. If PMFW supports both GFX ULV and DPM but user wants ULV only, the checks against pmfw supported features seem fine. But actually that cannot work due to the dependency between them. So, instead of applying some checks which actually cannot guard anything, we just let user take the risks.Quoted 1 line
Below is one example
Review
Quoted 1 line
(quoted diff) +0
-1- if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Review
Quoted 1 line
(quoted diff) +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))
Quoted 7 lines
Quoted 4 lines
Let's say user switched to manual mode, that time we disable fan control and move to manual mode. Next time when user requests auto mode, we check if fan control is originally supported on that platform and switch to auto.
[Quan, Evan] Logically yes. But in reality I assume this should not happen. As during our post-silicon bringup, we enable those features(and corresponding sysfs interfaces)support only after verified. It means if the feature(auto fan control) is not supported, the sysfs interface should be not visible to user.
Well, there are multiple examples -
amdgpu_asic_update_umd_stable_pstate(smu->adev,
false);
smu_deep_sleep_control(smu, true);
smu_gfx_ulv_control(smu, true);
smu_gpo_control(smu, true);This is yet another one. Some aspects are disabled while umd profiling and then they are enabled back when it's back to FW control. This is internal logic and it could be disastrous if we try to enable a feature without checking if it's really supported on production SKUs.
Quoted 7 lines
Quoted 4 lines
Either way, we should cache the features which are originally supported on the platform (through a combination of PPTable features and allowed feature masks on ASICs which are applicable) and disallow anything outside of that.
[Quan, Evan] Although I doubt the necessity of such cache. But I do keep a structure member "
feature->allowed" which does the similar job. It may be more reasonable to expand its scope to handle the job described here.
It would be needed for both internal and external interfaces, I strongly suggest to keep it. The name 'supported' is more intuitive and 'allowed feature' concept from PMFW is not there for all ASICs, though I don't mind the name anyway.
Thanks,
Lijo
Quoted 461 lines
BR
EvanQuoted 459 lines
Thanks,
LijoQuoted 14 lines
BR
EvanQuoted 12 lines
Thanks,
LijoQuoted 8 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19 ++++++++-------
Quoted 156 lines
Quoted 156 lines
----
Quoted 39 lines
.../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 ----------------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.supported,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1625,8 +1625,8 @@ static intQuoted 1 line
navi10_display_config_changed(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 4 lines
int ret = 0; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int
Quoted 4 lines
smu->display_config- num_display, NULL);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1864,13 +1864,13 @@ static int
navi10_notify_smc_display_config(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config- min_mem_set_clock; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int navi10_notify_smc_display_config(struct smu_context *smu)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock *10 ; ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1if (!ret) { - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1876
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, diff --git
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int
Quoted 6 lines
a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cindex651fe748e423..d568d6137a00100644drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0@@ -1281,8 +1281,8 @@ static int
sienna_cichlid_display_config_changed(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1287
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0#if 0 ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0smu->display_config-
num_display, @@ -1521,13 +1521,13 @@ static int sienna_cichlid_notify_smc_display_config(structsmu_context*smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 6 lines
min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config-
min_mem_set_clock;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 4 lines
clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock * 10; ret = smu_v11_0_display_clock_voltage_request(smu,
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 2 lines
if (!ret) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {Quoted 1 line
ret =
smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, @@ -3752,7 +3752,7 @@
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 5 lines
static int sienna_cichlid_gpo_control(struct
smu_context*smu,int ret = 0;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {Quoted 1 line
ret = smu_cmn_get_smc_version(smu, NULL,
&smu_version);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct
Quoted 8 lines
if (ret) return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -808,7 +808,6 @@ int smu_v11_0_system_features_control(struct
smu_context*smu,Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return ret;Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct smu_context *smu, · line 813
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -817,8
Quoted 1 line
+816,6 @@ int smu_v11_0_system_features_control(struct
smu_contextQuoted 168 lines
Quoted 168 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1186
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,Quoted 1 line
auto_fan_control); @@ -1607,7 +1604,7 @@ bool
smu_v11_0_baco_is_support(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
return false; /* Arcturus does not support this bit mask */drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct
Quoted 4 lines
!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) return false;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2150
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2151
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0enablement);return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct smu_context *smu,
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1struct amdgpu_device *adev = smu->adev;int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2162
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2163
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT, enablement);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2165
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0if (ret) { dev_err(adev->dev, "Failed to %s GFXCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2170,7 +2167,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_UCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s UCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2178,7 +2175,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_FCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s FCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2186,7 +2183,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s SOCCLK DS!\n",enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2194,7 +2191,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
} }drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_LCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s LCLK DS!\n",enablement ?
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 7 lines
"enable" : "disable"); diff --git
a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cindexb4a3c9b8b54e..e72831aa4859100644drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1960,7 +1960,6 @@ static int
vangogh_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-3RLC_STATUS_OFF, NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num); -bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ;}drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1993
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/ - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1990
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1992
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0(adev->pg_flags & AMD_PG_SUPPORT_GFX_PG)) { ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_EnableGfxOff, NULL);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct
Quoted 7 lines
if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0@@ -774,7 +774,6 @@ int smu_v13_0_system_features_control(struct
smu_context*smu,Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return ret;Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int smu_v13_0_system_features_control(struct · line 779
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 );@@ -783,8
Quoted 1 line
+782,6 @@ int smu_v13_0_system_features_control(struct
smu_contextQuoted 100 lines
Quoted 100 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1071
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int
Quoted 7 lines
auto_fan_control); diff --gita/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cindexf425827e2361..e9172622c0c4100644drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -204,7 +204,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 204
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_PrepareMp1ForUnload,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct
Quoted 24 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1NULL);bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -215,8 +214,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)bitmap_copy(feature->enabled, (unsigned long *)&feature_mask, feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-2-bitmap_copy (feature->supported, (unsigned long *)&feature_mask, - feature->feature_num);return 0 ; }drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-0@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct smu_context *smu, · line 490
Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-8} } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_FEATURE,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-9- mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3enum smu_cmn2asic_mapping_type type, uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
RE: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member of smu_feature structure
[AMD Official Use Only]
Quoted 112 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, January 24, 2022 1:03 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 24 lines · Evan
[AMD Official Use Only]
Quoted 20 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 5:37 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant 'supported' member ofsmu_featurestructureQuoted 8 lines · Evan
[AMD Official Use Only]
Quoted 4 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, January 21, 2022 4:52 PM
To: Quan, Evan <[email protected]>; amd-Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Cc Deucher, Alexander <[email protected]>; Chen,Guchun
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
<[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH 3/7] drm/amd/pm: drop the redundant'supported'
Quoted 15 lines
Quoted 15 lines
Quoted 9 lines
Quoted 9 lines
member of
smu_featurestructureQuoted 3 lines · Evan Quan
As it has exactly the same value as the 'enabled' member and also do the same thing.
Quoted 5 lines
Quoted 5 lines
I believe the original intention is different. We need to cache the features which are really supported by PMFW on that device on init. When a request comes through sysfs node for enable/disable of a feature, we should check against this and disallow those which are not
supported.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
[Quan, Evan] Uh, I doubt it was designed with such intention. As if it was,
there should be checks in ->get_allowed_feature_mask(e.g.
navi10_get_allowed_feature_mask) whether driver tries to enable/disable different features from PMFW.Quoted 1 line
" When a request comes through sysfs node for enable/disable of a
feature" If the sysfs node mentioned is "
pp_features", I might be able to provide some insights why there is no such checks added when Imade them.
Quoted 11 lines
Quoted 11 lines
Considering there may be some dependency between those dpm features(e.g. gfx ulv depends on gfx dpm), we actually cannot guard user whether their settings will succeed. E.g. If PMFW supports both GFX ULV and DPM but user wants ULV only, the checks against pmfw supported features seem fine. But actually that cannot work due to the dependency between them. So, instead of applying some checks which actually cannot guard anything, we just let user take the risks.
Quoted 1 line
Below is one example
Quoted 8 lines
Quoted 8 lines
Review
Quoted 1 line
(quoted diff) +0
-1- if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Review
Quoted 1 line
(quoted diff) +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Let's say user switched to manual mode, that time we disable fan control and move to manual mode. Next time when user requests auto mode, we check if fan control is originally supported on that platform and
switch to auto.
Quoted 4 lines
Quoted 1 line
[Quan, Evan] Logically yes. But in reality I assume this should not happen. As during our post-silicon bringup, we enable those features(and corresponding sysfs interfaces)support only after verified. It
means if the feature(auto fan control) is not supported, the sysfs interface should be not visible to user.
Well, there are multiple examples -
amdgpu_asic_update_umd_stable_pstate(smu->adev, false); smu_deep_sleep_control(smu, true); smu_gfx_ulv_control(smu, true); smu_gpo_control(smu, true);This is yet another one. Some aspects are disabled while umd profiling and then they are enabled back when it's back to FW control. This is internal logic and it could be disastrous if we try to enable a feature without checking if it's really supported on production SKUs.
Quoted 5 lines
Quoted 4 lines
Either way, we should cache the features which are originally supported on the platform (through a combination of PPTable features and allowed feature masks on ASICs which are applicable) and disallow anything outside of that.
[Quan, Evan] Although I doubt the necessity of such cache. But I do keep a
structure member "
feature->allowed" which does the similar job.
Quoted 8 lines
Quoted 1 line
It may be more reasonable to expand its scope to handle the job described
here.
Quoted 1 line
It would be needed for both internal and external interfaces, I strongly suggest to keep it. The name 'supported' is more intuitive and 'allowed feature' concept from PMFW is not there for all ASICs, though I don't mind the name anyway.
[Quan, Evan] I'm fine to keep it. Please check the new patch series then.
BR
Evan
Quoted 499 lines
Thanks,
LijoQuoted 20 lines
BR
EvanQuoted 18 lines
Thanks,
LijoQuoted 14 lines
BR
EvanQuoted 12 lines
Thanks,
LijoQuoted 8 lines
Signed-off-by Evan Quan <[email protected]>Change-Id I07c9a5ac5290cd0d88a40ce1768d393156419b5a--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 8 ++++---- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 +++++----- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 19++++++++---
Quoted 6 lines
Quoted 6 lines
----
Quoted 5 lines
Quoted 5 lines
----
Quoted 4 lines
.../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 5 +---- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 5 +---- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 3 --- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 17 -----------------
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 --- 10 files changed, 19 insertions(+), 53 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-0@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle)Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(void *handle)
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-1smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; - bitmap_zero(smu->smu_feature.supported,
SMU_FEATURE_MAX);Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(void *handle) · line 952
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-0bitmap_zero(smu->smu_feature.enabled,
SMU_FEATURE_MAX);Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(void *handle) · line 953
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0
-0bitmap_zero(smu->smu_feature.allowed,
SMU_FEATURE_MAX);Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 20 lines
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0
-1@@ -388,7 +388,6 @@ struct smu_power_context {struct smu_feature {uint32_t feature_num; - DECLARE_BITMAP(supported, SMU_FEATURE_MAX); DECLARE_BITMAP(allowed, SMU_FEATURE_MAX); DECLARE_BITMAP(enabled, SMU_FEATURE_MAX); };drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1625,8 +1625,8 @@ static intQuoted 1 line
navi10_display_config_changed(struct
smu_context*smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 4 lines
int ret = 0; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {Quoted 23 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 1 line
smu-
display_config-
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int
Quoted 3 lines
num_display,NULL);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0@@ -1864,13 +1864,13 @@ static int
navi10_notify_smc_display_config(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config- min_mem_set_clock; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1869
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0clock_req.clock_type = amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock* 10;
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1872
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_v11_0_display_clock_voltage_request(smu,
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1874
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-1if (!ret) { - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1874
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c static int · line 1875
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +0
-0ret =smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, diff --git
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int
Quoted 6 lines
a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.cindex651fe748e423..d568d6137a00100644drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0@@ -1281,8 +1281,8 @@ static int
sienna_cichlid_display_config_changed(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1int ret =0 ; if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && - smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1284
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT) &&Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1285
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c static int · line 1287
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0#if 0 ret = smu_cmn_send_smc_msg_with_param(smu,
SMU_MSG_NumOfDisplays,Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-0smu-display_config-
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 2 lines
num_display, @@ -1521,13 +1521,13 @@ static int sienna_cichlid_notify_smc_display_config(structsmu_context*smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 6 lines
min_clocks.dcef_clock_in_sr = smu->display_config- min_dcef_deep_sleep_set_clk; min_clocks.memory_clock = smu->display_config-
min_mem_set_clock;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_DCEFCLK_BIT)) {Quoted 2 lines
clock_req.clock_type =
amd_pp_dcef_clock; clock_req.clock_freq_in_khz = min_clocks.dcef_clock* 10;
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
ret =
smu_v11_0_display_clock_voltage_request(smu,
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
&clock_req);drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 2 lines
if (!ret) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_DCEFCLK_BIT)) {Quoted 1 line
ret =
smu_cmn_send_smc_msg_with_param(smu,
Quoted 1 line
SMU_MSG_SetMinDeepSleepDcefclk,Quoted 1 line
min_clocks.dcef_clock_in_sr/100, @@ -3752,7 +3752,7 @@
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 5 lines
static int sienna_cichlid_gpo_control(struct
smu_context*smu,int ret = 0;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFX_GPO_BIT)) {Quoted 1 line
ret = smu_cmn_get_smc_version(smu, NULL,
&smu_version);Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int
Quoted 8 lines
if (ret) return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -808,7 +808,6 @@ intsmu_v11_0_system_features_control(struct
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_system_features_control(struct smu_context *smu,
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret = smu_cmn_get_enabled_mask(smu,
feature_mask, 2);Quoted 25 lines
Quoted 25 lines
Quoted 2 lines
Quoted 2 lines
@@ -817,8
Quoted 1 line
+816,6 @@ int smu_v11_0_system_features_control(struct
smu_contextQuoted 22 lines
Quoted 22 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- feature->feature_num); }return ret;@@ -1186,7 +1183,7 @@ smu_v11_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1186
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0return 0 ;Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct · line 1189
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,Quoted 1 line
auto_fan_control); @@ -1607,7 +1604,7 @@ bool
smu_v11_0_baco_is_support(struct smu_context *smu)drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 4 lines
return false; /* Arcturus does not support this bit mask */drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_BACO_BIT)Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
&&
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_BACO_BIT)Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
&&
Quoted 1 line
!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_BACO_BIT))Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct
Quoted 3 lines
return false;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2150,7 +2147,7 @@ int smu_v11_0_gfx_ulv_control(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c smu_v11_0_auto_fan_control(struct smu_context *smu, bool auto_fan_control)
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1{int ret =0 ; - if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2150
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT))drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_gfx_ulv_control(struct · line 2151
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_GFX_ULV_BIT,drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0enablement);return ret;drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0@@ -2162,7 +2159,7 @@ int smu_v11_0_deep_sleep_control(struct
smu_context*smu,Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0struct amdgpu_device *adev = smu->adev;int ret =0 ;Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2165
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2162
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c int smu_v11_0_deep_sleep_control(struct · line 2163
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_GFXCLK_BIT, enablement);Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-0if (ret) { dev_err(adev->dev, "Failed to %s GFXCLKDS!\n",
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2170,7 +2167,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,Quoted 3 lines
} }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_UCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_UCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s UCLKDS!\n",
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2178,7 +2175,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,Quoted 3 lines
} }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_FCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_FCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s FCLKDS!\n",
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2186,7 +2183,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,Quoted 3 lines
} }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_SOCCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s SOCCLKDS!\n",
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
enablement ?
Quoted 1 line
"enable" : "disable"); @@ -2194,7 +2191,7 @@ int
smu_v11_0_deep_sleep_control(struct
smu_context*smu,Quoted 3 lines
} }Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DS_LCLK_BIT)) {drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT)) {Quoted 1 line
ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_DS_LCLK_BIT, enablement);Quoted 2 lines
if (ret) { dev_err(adev->dev, "Failed to %s LCLKDS!\n",
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
enablement ?
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int
Quoted 7 lines
"enable" : "disable"); diff --git
a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.cindexb4a3c9b8b54e..e72831aa4859100644drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0@@ -1960,7 +1960,6 @@ static int
vangogh_system_features_control(struct smu_context *smu, bool en)Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0RLC_STATUS_OFF,NULL);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;@@ -1971,8 +1970,6 @@ static intvangogh_system_features_control(struct
smu_context*smu, boolen)
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- feature->feature_num);return 0 ; }@@ -1989,7 +1986,7 @@ static int vangogh_post_smu_init(struct
smu_context*smu)Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0adev->gfx.config.max_sh_per_se * adev->gfx.config.max_shader_engines;/* allow message will be sent after enable message on Vangogh*/
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1993
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-1- if (smu_cmn_feature_is_supported(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1990
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1
-0+ if (smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_DPM_GFXCLK_BIT) &&Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0(adev->pg_flags &
AMD_PG_SUPPORT_GFX_PG)) {Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c static int vangogh_post_smu_init(struct · line 1992
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_EnableGfxOff, NULL);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int
Quoted 7 lines
if (ret) {drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0@@ -774,7 +774,6 @@ intsmu_v13_0_system_features_control(struct
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c int · line 779
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1return ret;bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (en) { ret = smu_cmn_get_enabled_mask(smu,
feature_mask, 2);Quoted 40 lines
Quoted 40 lines
Quoted 2 lines
Quoted 2 lines
@@ -783,8
Quoted 1 line
+782,6 @@ int smu_v13_0_system_features_control(struct
smu_contextQuoted 37 lines
Quoted 37 lines
Quoted 3 lines
*smu,
bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
Quoted 2 lines
feature->feature_num);drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct
Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1- feature->feature_num); }return ret;@@ -1071,7 +1068,7 @@ smu_v13_0_auto_fan_control(struct
smu_context*smu, boolauto_fan_control)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 4 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-1{int ret =0 ; - if (!smu_cmn_feature_is_supported(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1071
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +1
-0+ if (!smu_cmn_feature_is_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT))drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c smu_v13_0_auto_fan_control(struct · line 1074
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +0
-0return 0 ; ret = smu_cmn_feature_set_enabled(smu,
SMU_FEATURE_FAN_CONTROL_BIT,drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int
Quoted 7 lines
auto_fan_control); diff --gita/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cb/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.cindexf425827e2361..e9172622c0c4100644drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -204,7 +204,6 @@ static int
yellow_carp_system_features_control(struct smu_context *smu, bool en)drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 204
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0ret = smu_cmn_send_smc_msg(smu,
SMU_MSG_PrepareMp1ForUnload,Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0NULL);Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 214
Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1bitmap_zero (feature->enabled, feature->feature_num); -bitmap_zero (feature->supported, feature->feature_num);if (!en)return ret;drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0@@ -215,8 +214,6 @@ static int yellow_carp_system_features_control(struct smu_context *smu,bool
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 217
Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-0en) bitmap_copy(feature->enabled, (unsigned long*)&feature_mask,
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c static int · line 220
Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1feature->feature_num); - bitmap_copy(feature->supported, (unsigned long*)&feature_mask,
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct
Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +0
-1- feature->feature_num);return 0; }drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-0@@ -476,23 +476,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_to_asic_specific_index(struct smu_context *smu, · line 490
Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-8} } -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask) -{ -struct smu_feature *feature = &smu->smu_feature; -int feature_id; - - feature_id = smu_cmn_to_asic_specific_index(smu, -
CMN2ASIC_MAPPING_FEATURE,drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct
Quoted 18 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0
-9- mask); -if (feature_id <0 ) -return 0 ; - -WARN_ON (feature_id > feature->feature_num); - -return test_bit (feature_id, feature->supported); -} -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask) {drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0@@ -48,9 +48,6 @@ int smu_cmn_to_asic_specific_index(struct
smu_context*smu,Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h int smu_cmn_to_asic_specific_index(struct · line 48
Quoted 1 line
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-0enum
smu_cmn2asic_mapping_typetype,Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0
-3uint32_t index); -int smu_cmn_feature_is_supported (struct smu_context *smu, -enum smu_feature_mask mask); -int smu_cmn_feature_is_enabled (struct smu_context *smu,enum smu_feature_mask mask);
PATCH 4/7 drm/amd/pm: update the data type for retrieving enabled ppfeatures
In reply to Evan QuanUse uint64_t instead of an array of uint32_t. This can avoid some non-necessary intermediate uint32_t -> uint64_t conversions.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 5 ++-- .../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 5 +--- .../amd/pm/swsmu/smu11/cyan_skillfish_ppt.c | 6 +--- .../gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 5 +--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 5 +--- .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 4 +-- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 10 ++----- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 7 ++--- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 4 +-- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 9 ++---- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 29 +++++++------------ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 2 +- 14 files changed, 32 insertions(+), 64 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -1
@@ -2309,7 +2309,7 @@ static int smu_read_sensor(void *handle, *size =4 ;break ;case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK : - ret =smu_feature_get_enabled_mask (smu, (uint32_t *)data,2 ); + ret =smu_feature_get_enabled_mask (smu, (uint64_t *)data); *size =8 ;break ;case AMDGPU_PP_SENSOR_UVD_POWER :
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +2 -3
@@ -974,10 +974,9 @@ struct pptable_funcs {/** * @get_enabled_mask: Get a mask of features that are currently enabled * on the SMU. -* &feature_mask: Array representing enabled feature mask. -* &num: Elements in &feature_mask. +* &feature_mask: Enabled feature mask. */ -int (*get_enabled_mask)(struct smu_context *smu,uint32_t *feature_mask,uint32_t num); +int (*get_enabled_mask)(struct smu_context *smu,uint64_t *feature_mask);/** * @feature_is_enabled: Test if a feature is enabled.
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +1 -4
@@ -2022,15 +2022,12 @@ static void arcturus_dump_pptable(struct smu_context *smu)static bool arcturus_is_dpm_running (struct smu_context *smu) {int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (uint64_t )feature_mask[1 ] <<32 | feature_mask[0 ]; -return !!(feature_enabled &SMC_DPM_FEATURE ); }
drivers/gpu/drm/amd/pm/swsmu/smu11/cyan_skillfish_ppt.c +1 -5
@@ -366,20 +366,16 @@ static bool cyan_skillfish_is_dpm_running(struct smu_context *smu) {struct amdgpu_device *adev = smu->adev;int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled;/* we need to re-init after suspend so return false */ if (adev->in_suspend)return false; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (uint64_t )feature_mask[0 ] | - ((uint64_t )feature_mask[1 ] <<32 ); -/* * cyan_skillfish specific, query default sclk inseted of hard code. */
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +1 -4
@@ -1640,15 +1640,12 @@ static int navi10_display_config_changed(struct smu_context *smu)static bool navi10_is_dpm_running (struct smu_context *smu) {int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (uint64_t )feature_mask[1 ] <<32 | feature_mask[0 ]; -return !!(feature_enabled &SMC_DPM_FEATURE ); }
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +1 -4
@@ -1298,15 +1298,12 @@ static int sienna_cichlid_display_config_changed(struct smu_context *smu)static bool sienna_cichlid_is_dpm_running (struct smu_context *smu) {int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (uint64_t )feature_mask[1 ] <<32 | feature_mask[0 ]; -return !!(feature_enabled &SMC_DPM_FEATURE ); }
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -2
@@ -799,7 +799,7 @@ int smu_v11_0_system_features_control(struct smu_context *smu, bool en) {struct smu_feature *feature = &smu->smu_feature; -uint32_t feature_mask[2 ]; +uint64_t feature_mask;int ret =0 ; ret = smu_cmn_send_smc_msg(smu, (en ? SMU_MSG_EnableAllSmuFeatures :
@@ -810,7 +810,7 @@ int smu_v11_0_system_features_control(struct smu_context *smu,bitmap_zero (feature->enabled, feature->feature_num);if (en) { - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_mask);if (ret)return ret;
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +3 -7
@@ -500,21 +500,17 @@ static bool vangogh_is_dpm_running(struct smu_context *smu) {struct amdgpu_device *adev = smu->adev;int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled;/* we need to re-init after suspend so return false */ if (adev->in_suspend)return false; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (unsigned long )((uint64_t )feature_mask[0 ] | - ((uint64_t )feature_mask[1 ] <<32 )); -return !!(feature_enabled &SMC_DPM_FEATURE ); }
@@ -1952,7 +1948,7 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en) {struct amdgpu_device *adev = smu->adev;struct smu_feature *feature = &smu->smu_feature; -uint32_t feature_mask[2 ]; +uint64_t feature_mask;int ret =0 ;if (adev->pm.fw_version >=0x43f1700 && !en)
@@ -1964,7 +1960,7 @@ static int vangogh_system_features_control(struct smu_context *smu, bool en)if (!en)return ret; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_mask);if (ret)return ret;
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +2 -5
@@ -1451,14 +1451,11 @@ static int aldebaran_usr_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_static bool aldebaran_is_dpm_running (struct smu_context *smu) {int ret; -uint32_t feature_mask[2 ]; -unsigned long feature_enabled; +uint64_t feature_enabled; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (unsigned long )((uint64_t )feature_mask[0 ] | - ((uint64_t )feature_mask[1 ] <<32 ));return !!(feature_enabled &SMC_DPM_FEATURE ); }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -2
@@ -765,7 +765,7 @@ int smu_v13_0_system_features_control(struct smu_context *smu, bool en) {struct smu_feature *feature = &smu->smu_feature; -uint32_t feature_mask[2 ]; +uint64_t feature_mask;int ret =0 ; ret = smu_cmn_send_smc_msg(smu, (en ? SMU_MSG_EnableAllSmuFeatures :
@@ -776,7 +776,7 @@ int smu_v13_0_system_features_control(struct smu_context *smu,bitmap_zero (feature->enabled, feature->feature_num);if (en) { - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_mask);if (ret)return ret;
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +3 -6
@@ -197,7 +197,7 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en) {struct smu_feature *feature = &smu->smu_feature;struct amdgpu_device *adev = smu->adev; -uint32_t feature_mask[2 ]; +uint64_t feature_mask;int ret =0 ;if (!en && !adev->in_s0ix)
@@ -208,7 +208,7 @@ static int yellow_carp_system_features_control(struct smu_context *smu, bool en)if (!en)return ret; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_mask);if (ret)return ret;
@@ -252,16 +252,13 @@ static int yellow_carp_dpm_set_jpeg_enable(struct smu_context *smu, bool enable)static bool yellow_carp_is_dpm_running (struct smu_context *smu) {int ret =0 ; -uint32_t feature_mask[2 ];uint64_t feature_enabled; - ret =smu_cmn_get_enabled_mask (smu, feature_mask,2 ); + ret =smu_cmn_get_enabled_mask (smu, &feature_enabled);if (ret)return false; - feature_enabled = (uint64_t )feature_mask[1 ] <<32 | feature_mask[0 ]; -return !!(feature_enabled &SMC_DPM_FEATURE ); }
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +11 -18
@@ -525,8 +525,7 @@ bool smu_cmn_clk_dpm_is_enabled(struct smu_context *smu, }int smu_cmn_get_enabled_mask (struct smu_context *smu, -uint32_t *feature_mask, -uint32_t num) +uint64_t *feature_mask) {struct smu_feature *feature = &smu->smu_feature;struct amdgpu_device *adev = smu->adev;
@@ -534,7 +533,7 @@ int smu_cmn_get_enabled_mask(struct smu_context *smu,uint32_t *feature_mask_low;int ret =0 ; -if (!feature_mask || num <2 ) +if (!feature_mask)return -EINVAL ;if (!bitmap_empty (feature->enabled, feature->feature_num)) {
@@ -544,8 +543,8 @@ int smu_cmn_get_enabled_mask(struct smu_context *smu,return 0 ; } - feature_mask_low = &feature_mask[0 ]; - feature_mask_high = &feature_mask[1 ]; + feature_mask_low = &((uint32_t *)feature_mask)[0 ]; + feature_mask_high = &((uint32_t *)feature_mask)[1 ];switch (adev->asic_type) {case CHIP_CYAN_SKILLFISH :
@@ -676,7 +675,7 @@ static const char *smu_get_feature_name(struct smu_context *smu,size_t smu_cmn_get_pp_feature_mask (struct smu_context *smu,char *buf) { -uint32_t feature_mask[2 ] = {0 }; +uint64_t feature_mask;int feature_index =0 ;uint32_t count =0 ;int8_t sort_feature[SMU_FEATURE_COUNT ];
@@ -684,13 +683,12 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,int ret =0 , i; ret =smu_cmn_get_enabled_mask (smu, - feature_mask, -2 ); + &feature_mask);if (ret)return 0 ; size =sysfs_emit_at (buf, size,"features high: 0x%08x low: 0x%08x\n" , - feature_mask[1 ], feature_mask[0 ]); +upper_32_bits (feature_mask),lower_32_bits (feature_mask));memset (sort_feature,-1 ,sizeof (sort_feature));
@@ -726,22 +724,17 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu, uint64_t new_mask) {int ret =0 ; -uint32_t feature_mask[2 ] = {0 }; +uint64_t feature_mask;uint64_t feature_2_enabled =0 ;uint64_t feature_2_disabled =0 ; -uint64_t feature_enables =0 ; ret =smu_cmn_get_enabled_mask (smu, - feature_mask, -2 ); + &feature_mask);if (ret)return ret; - feature_enables = ((uint64_t )feature_mask[1 ] <<32 | - (uint64_t )feature_mask[0 ]); - - feature_2_enabled = ~feature_enables & new_mask; - feature_2_disabled = feature_enables & ~new_mask; + feature_2_enabled = ~feature_mask & new_mask; + feature_2_disabled = feature_mask & ~new_mask;if (feature_2_enabled) { ret = smu_cmn_feature_update_enable_state(smu,
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +1 -2
@@ -55,8 +55,7 @@ bool smu_cmn_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type clk_type);int smu_cmn_get_enabled_mask (struct smu_context *smu, -uint32_t *feature_mask, -uint32_t num); +uint64_t *feature_mask); uint64_t smu_cmn_get_indep_throttler_status( const unsigned long dep_status,
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h +1 -1
@@ -55,7 +55,7 @@#define smu_send_smc_msg (smu, msg, read_arg) smu_ppt_funcs(send_smc_msg, 0, smu, msg, read_arg)#define smu_init_display_count (smu, count) smu_ppt_funcs(init_display_count, 0, smu, count)#define smu_feature_set_allowed_mask (smu) smu_ppt_funcs(set_allowed_mask, 0, smu) -#define smu_feature_get_enabled_mask (smu, mask, num) smu_ppt_funcs(get_enabled_mask, 0, smu, mask, num) +#define smu_feature_get_enabled_mask (smu, mask) smu_ppt_funcs(get_enabled_mask, 0, smu, mask)#define smu_feature_is_enabled (smu, mask) smu_ppt_funcs(feature_is_enabled, 0, smu, mask)#define smu_disable_all_features_with_exception (smu, no_hw_disablement, mask) smu_ppt_funcs(disable_all_features_with_exception, 0, smu, no_hw_disablement, mask)#define smu_is_dpm_running (smu) smu_ppt_funcs(is_dpm_running, 0 , smu)
Signature · 1 line
2.29.0
PATCH 5/7 drm/amd/pm: drop the cache for enabled ppfeatures
In reply to Evan QuanThe following scenarios make the driver cache for enabled ppfeatures outdated and invalid:
- Other tools interact with PMFW to change the enabled ppfeatures.
- PMFW may enable/disable some features behind driver's back. E.g. for sienna_cichild, on gfxoff entering, PMFW will disable gfx related DPM features. All those are performed without driver's notice.
Also considering driver does not actually interact with PMFW such frequently, the benefit brought by such cache is very limited.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 - drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 23 +--------- .../gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 16 +------ .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 23 +--------- .../drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 16 +------ drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 46 +++++-------------- 7 files changed, 17 insertions(+), 109 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -1
@@ -949,7 +949,6 @@ static int smu_sw_init(void *handle) smu->pool_size = adev->pm.smu_prv_buffer_size; smu->smu_feature.feature_num =SMU_FEATURE_MAX ; -bitmap_zero (smu->smu_feature.enabled,SMU_FEATURE_MAX );bitmap_zero (smu->smu_feature.allowed,SMU_FEATURE_MAX );mutex_init (&smu->message_lock);
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -1
@@ -389,7 +389,6 @@ struct smu_feature {uint32_t feature_num;DECLARE_BITMAP (allowed,SMU_FEATURE_MAX ); -DECLARE_BITMAP (enabled,SMU_FEATURE_MAX ); };struct smu_clocks {
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -21
@@ -798,27 +798,8 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)int smu_v11_0_system_features_control (struct smu_context *smu,bool en) { -struct smu_feature *feature = &smu->smu_feature; -uint64_t feature_mask; -int ret =0 ; - - ret =smu_cmn_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : - SMU_MSG_DisableAllSmuFeatures),NULL ); -if (ret) -return ret; - -bitmap_zero (feature->enabled, feature->feature_num); - -if (en) { - ret =smu_cmn_get_enabled_mask (smu, &feature_mask); -if (ret) -return ret; - -bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, - feature->feature_num); - } - -return ret; +return smu_cmn_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : + SMU_MSG_DisableAllSmuFeatures),NULL ); }int smu_v11_0_notify_display_change (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +1 -15
@@ -1947,27 +1947,13 @@ static int vangogh_get_dpm_clock_table(struct smu_context *smu, struct dpm_clockstatic int vangogh_system_features_control (struct smu_context *smu,bool en) {struct amdgpu_device *adev = smu->adev; -struct smu_feature *feature = &smu->smu_feature; -uint64_t feature_mask;int ret =0 ;if (adev->pm.fw_version >=0x43f1700 && !en) ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_RlcPowerNotify,RLC_STATUS_OFF ,NULL ); -bitmap_zero (feature->enabled, feature->feature_num); - -if (!en) -return ret; - - ret =smu_cmn_get_enabled_mask (smu, &feature_mask); -if (ret) -return ret; - -bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, - feature->feature_num); - -return 0 ; +return ret; }static int vangogh_post_smu_init (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -21
@@ -764,27 +764,8 @@ int smu_v13_0_gfx_off_control(struct smu_context *smu, bool enable)int smu_v13_0_system_features_control (struct smu_context *smu,bool en) { -struct smu_feature *feature = &smu->smu_feature; -uint64_t feature_mask; -int ret =0 ; - - ret =smu_cmn_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : - SMU_MSG_DisableAllSmuFeatures),NULL ); -if (ret) -return ret; - -bitmap_zero (feature->enabled, feature->feature_num); - -if (en) { - ret =smu_cmn_get_enabled_mask (smu, &feature_mask); -if (ret) -return ret; - -bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, - feature->feature_num); - } - -return ret; +return smu_cmn_send_smc_msg (smu, (en ? SMU_MSG_EnableAllSmuFeatures : + SMU_MSG_DisableAllSmuFeatures),NULL ); }int smu_v13_0_notify_display_change (struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +1 -15
@@ -195,27 +195,13 @@ static int yellow_carp_fini_smc_tables(struct smu_context *smu)static int yellow_carp_system_features_control (struct smu_context *smu,bool en) { -struct smu_feature *feature = &smu->smu_feature;struct amdgpu_device *adev = smu->adev; -uint64_t feature_mask;int ret =0 ;if (!en && !adev->in_s0ix) ret =smu_cmn_send_smc_msg (smu, SMU_MSG_PrepareMp1ForUnload,NULL ); -bitmap_zero (feature->enabled, feature->feature_num); - -if (!en) -return ret; - - ret =smu_cmn_get_enabled_mask (smu, &feature_mask); -if (ret) -return ret; - -bitmap_copy (feature->enabled, (unsigned long *)&feature_mask, - feature->feature_num); - -return 0 ; +return ret; }static int yellow_carp_dpm_set_vcn_enable (struct smu_context *smu,bool enable)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +11 -35
117 lines not on this page · raw message
Signature · 1 line
2.29.0
PATCH 6/7 drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures
In reply to Evan QuanAs the enabled ppfeatures are just retrieved ahead. We can use that directly instead of retrieving again and again.
--- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +9 -1
@@ -661,6 +661,7 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,int8_t sort_feature[SMU_FEATURE_COUNT ];size_t size =0 ;int ret =0 , i; +int feature_id; ret =smu_cmn_get_enabled_mask (smu, &feature_mask);
@@ -689,11 +690,18 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,if (sort_feature[i] <0 )continue ; +/* convert to asic spcific feature ID */ + feature_id =smu_cmn_to_asic_specific_index (smu, +CMN2ASIC_MAPPING_FEATURE , + sort_feature[i]); +if (feature_id <0 ) +continue ; + size +=sysfs_emit_at (buf, size,"%02d. %-20s (%2d) : %s\n" , count++,smu_get_feature_name (smu, sort_feature[i]), i, - !!smu_cmn_feature_is_enabled (smu, sort_feature[i]) ? + !!test_bit (feature_id, (unsigned long *)&feature_mask) ?"enabled" :"disabled" ); }
Signature · 1 line
2.29.0
PATCH 7/7 drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception
In reply to Evan QuanAs there is no internal cache for enabled ppfeatures now. Thus the 2nd parameter will be not needed any more.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++------- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 - drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 7 ------- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 1 - drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 2 +- 5 files changed, 3 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -7
@@ -1348,9 +1348,7 @@ static int smu_disable_dpms(struct smu_context *smu)case IP_VERSION (11 ,5 ,0 ):case IP_VERSION (11 ,0 ,12 ):case IP_VERSION (11 ,0 ,13 ): -return smu_disable_all_features_with_exception (smu, - true, -SMU_FEATURE_COUNT ); +return 0 ;default :break ; }
@@ -1366,9 +1364,7 @@ static int smu_disable_dpms(struct smu_context *smu)case IP_VERSION (11 ,0 ,0 ):case IP_VERSION (11 ,0 ,5 ):case IP_VERSION (11 ,0 ,9 ): -return smu_disable_all_features_with_exception (smu, - true, -SMU_FEATURE_BACO_BIT ); +return 0 ;default :break ; }
@@ -1380,7 +1376,6 @@ static int smu_disable_dpms(struct smu_context *smu)*/ if (use_baco &&smu_feature_is_enabled (smu,SMU_FEATURE_BACO_BIT )) { ret =smu_disable_all_features_with_exception (smu, - false,SMU_FEATURE_BACO_BIT );if (ret)dev_err (adev->dev,"Failed to disable smu features except BACO.\n" );
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +0 -1
@@ -989,7 +989,6 @@ struct pptable_funcs {* exception to those in &mask. */ int (*disable_all_features_with_exception)(struct smu_context *smu, -bool no_hw_disablement,enum smu_feature_mask mask);/**
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -7
@@ -748,9 +748,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,* @mask * * @smu: smu_context pointer -* @no_hw_disablement: whether real dpm disablement should be performed -* true: update the cache(about dpm enablement state) only -* false: real dpm disablement plus cache update * @mask: the dpm feature which should not be disabled * SMU_FEATURE_COUNT: no exception, all dpm features * to disable
@@ -759,7 +756,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,* 0 on success or a negative error code on failure. */ int smu_cmn_disable_all_features_with_exception (struct smu_context *smu, -bool no_hw_disablement,enum smu_feature_mask mask) {uint64_t features_to_disable =U64_MAX ;
@@ -775,9 +771,6 @@ int smu_cmn_disable_all_features_with_exception(struct smu_context *smu, features_to_disable &= ~(1ULL << skipped_feature_id); } -if (no_hw_disablement) -return 0 ; -return smu_cmn_feature_update_enable_state (smu, features_to_disable,0 );
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h +0 -1
@@ -76,7 +76,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu, uint64_t new_mask);int smu_cmn_disable_all_features_with_exception (struct smu_context *smu, -bool no_hw_disablement,enum smu_feature_mask mask); int smu_cmn_get_smc_version(struct smu_context *smu,
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h +1 -1
@@ -57,7 +57,7 @@#define smu_feature_set_allowed_mask (smu) smu_ppt_funcs(set_allowed_mask, 0, smu)#define smu_feature_get_enabled_mask (smu, mask) smu_ppt_funcs(get_enabled_mask, 0, smu, mask)#define smu_feature_is_enabled (smu, mask) smu_ppt_funcs(feature_is_enabled, 0, smu, mask) -#define smu_disable_all_features_with_exception (smu, no_hw_disablement, mask) smu_ppt_funcs(disable_all_features_with_exception, 0, smu, no_hw_disablement, mask) +#define smu_disable_all_features_with_exception (smu, mask) smu_ppt_funcs(disable_all_features_with_exception, 0, smu, mask)#define smu_is_dpm_running (smu) smu_ppt_funcs(is_dpm_running, 0 , smu)#define smu_notify_display_change (smu) smu_ppt_funcs(notify_display_change, 0, smu)#define smu_populate_umd_state_clk (smu) smu_ppt_funcs(populate_umd_state_clk, 0, smu)
Signature · 1 line
2.29.0