drm/amdgpu/smu10: fix SoC/fclk units in auto mode
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu/smu10: fix SoC/fclk units in auto mode
SMU takes clock limits in Mhz units. socclk and fclk were using 10 khz units in some cases. Switch to Mhz units. Fixes higher than required SoC clocks.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +4 -4
@@ -773,13 +773,13 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetHardMinFclkByFreq, hwmgr->display_config->num_display >3 ? - data->clock_vol_info.vdd_dep_on_fclk->entries[0 ].clk : + (data->clock_vol_info.vdd_dep_on_fclk->entries[0 ].clk /100 ) : min_mclk,NULL );smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetHardMinSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinVcn,
@@ -792,11 +792,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, NULL);smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetSoftMaxFclkByFreq, - data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk, + data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk /100 ,NULL );smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetSoftMaxSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSoftMaxVcn,
Signature · 1 line
2.35.1
Ping?
Quoted 48 lines · Alex Deucher
SMU takes clock limits in Mhz units. socclk and fclk were using 10 khz units in some cases. Switch to Mhz units. Fixes higher than required SoC clocks.
Fixes 97cf32996c46d9 ("drm/amd/pm: Removed fixed clock in auto mode DPM")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +4
-5@@ -773,13 +773,13 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetHardMinFclkByFreq, hwmgr->display_config->num_display >3 ? - data->clock_vol_info.vdd_dep_on_fclk->entries[0 ].clk : + (data->clock_vol_info.vdd_dep_on_fclk->entries[0 ].clk /100 ) : min_mclk,NULL );smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetHardMinSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinVcn,@@ -792,11 +792,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, NULL);smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetSoftMaxFclkByFreq, - data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk, + data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk /100 ,NULL );smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetSoftMaxSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSoftMaxVcn, --2.35.1
Dear Alex,
Thank you for your patch.
Am 01.04.22 um 17:16 schrieb Alex Deucher:
Quoted 3 lines
SMU takes clock limits in Mhz units. socclk and fclk were using 10 khz units in some cases. Switch to Mhz units. Fixes higher than required SoC clocks.
It’d be great if you used 75 characters per line in commit messages.
Quoted 11 lines
Fixes 97cf32996c46d9 ("drm/amd/pm: Removed fixed clock in auto mode DPM")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +0
-0
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · line 777
Quoted 6 lines
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +1
-1@@ -773,13 +773,13 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinFclkByFreq, hwmgr->display_config->num_display > 3 ? - data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk : + (data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk / 100) : min_mclk,
Should that also be indented now?
Quoted 13 lines
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +1
-1NULL);smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetHardMinSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[0 ].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetHardMinVcn,@@ -792,11 +792,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, NULL); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSoftMaxFclkByFreq,
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · line 802
Quoted 10 lines
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +2
-2- data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk, + data->clock_vol_info.vdd_dep_on_fclk->entries[index_fclk].clk /100 , NULL);smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetSoftMaxSocclkByFreq, - data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk, + data->clock_vol_info.vdd_dep_on_socclk->entries[index_socclk].clk /100 ,NULL ); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSoftMaxVcn,
Kind regards,
Paul