drm/amd/powerplay: refine pwm1_enable callback functions for CI.
Use the new enums for setting and getting the fan control mode. Fixes problems due to previous inconsistencies between enums. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2fde9ab218
commit
afa31879f0
|
@ -1267,30 +1267,33 @@ static int ci_dpm_set_fan_speed_percent(struct amdgpu_device *adev,
|
||||||
|
|
||||||
static void ci_dpm_set_fan_control_mode(struct amdgpu_device *adev, u32 mode)
|
static void ci_dpm_set_fan_control_mode(struct amdgpu_device *adev, u32 mode)
|
||||||
{
|
{
|
||||||
if (mode) {
|
switch (mode) {
|
||||||
/* stop auto-manage */
|
case AMD_FAN_CTRL_NONE:
|
||||||
if (adev->pm.dpm.fan.ucode_fan_control)
|
if (adev->pm.dpm.fan.ucode_fan_control)
|
||||||
ci_fan_ctrl_stop_smc_fan_control(adev);
|
ci_fan_ctrl_stop_smc_fan_control(adev);
|
||||||
ci_fan_ctrl_set_static_mode(adev, mode);
|
ci_dpm_set_fan_speed_percent(adev, 100);
|
||||||
} else {
|
break;
|
||||||
/* restart auto-manage */
|
case AMD_FAN_CTRL_MANUAL:
|
||||||
|
if (adev->pm.dpm.fan.ucode_fan_control)
|
||||||
|
ci_fan_ctrl_stop_smc_fan_control(adev);
|
||||||
|
break;
|
||||||
|
case AMD_FAN_CTRL_AUTO:
|
||||||
if (adev->pm.dpm.fan.ucode_fan_control)
|
if (adev->pm.dpm.fan.ucode_fan_control)
|
||||||
ci_thermal_start_smc_fan_control(adev);
|
ci_thermal_start_smc_fan_control(adev);
|
||||||
else
|
break;
|
||||||
ci_fan_ctrl_set_default_mode(adev);
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 ci_dpm_get_fan_control_mode(struct amdgpu_device *adev)
|
static u32 ci_dpm_get_fan_control_mode(struct amdgpu_device *adev)
|
||||||
{
|
{
|
||||||
struct ci_power_info *pi = ci_get_pi(adev);
|
struct ci_power_info *pi = ci_get_pi(adev);
|
||||||
u32 tmp;
|
|
||||||
|
|
||||||
if (pi->fan_is_controlled_by_smc)
|
if (pi->fan_is_controlled_by_smc)
|
||||||
return 0;
|
return AMD_FAN_CTRL_AUTO;
|
||||||
|
else
|
||||||
tmp = RREG32_SMC(ixCG_FDO_CTRL2) & CG_FDO_CTRL2__FDO_PWM_MODE_MASK;
|
return AMD_FAN_CTRL_MANUAL;
|
||||||
return (tmp >> CG_FDO_CTRL2__FDO_PWM_MODE__SHIFT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in New Issue