<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div>
<div id="x_divRplyFwdMsg" dir="ltr">
<div></div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Change-Id: Ieb05cfa95e4072357e18f631ab71780de0688008<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 27 +++++++++++++++------------<br>
 1 file changed, 15 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
index a6dda34..6dc1410 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
@@ -1267,30 +1267,33 @@ static int ci_dpm_set_fan_speed_percent(struct amdgpu_device *adev,<br>
 <br>
 static void ci_dpm_set_fan_control_mode(struct amdgpu_device *adev, u32 mode)<br>
 {<br>
-       if (mode) {<br>
-               /* stop auto-manage */<br>
+       switch (mode) {<br>
+       case AMD_FAN_CTRL_NONE:<br>
                 if (adev->pm.dpm.fan.ucode_fan_control)<br>
                         ci_fan_ctrl_stop_smc_fan_control(adev);<br>
-               ci_fan_ctrl_set_static_mode(adev, mode);<br>
-       } else {<br>
-               /* restart auto-manage */<br>
+               ci_dpm_set_fan_speed_percent(adev, 100);<br>
+               break;<br>
+       case AMD_FAN_CTRL_MANUAL:<br>
+               if (adev->pm.dpm.fan.ucode_fan_control)<br>
+                       ci_fan_ctrl_stop_smc_fan_control(adev);<br>
+               break;<br>
+       case AMD_FAN_CTRL_AUTO:<br>
                 if (adev->pm.dpm.fan.ucode_fan_control)<br>
                         ci_thermal_start_smc_fan_control(adev);<br>
-               else<br>
-                       ci_fan_ctrl_set_default_mode(adev);<br>
+               break;<br>
+       default:<br>
+               break;<br>
         }<br>
 }<br>
 <br>
 static u32 ci_dpm_get_fan_control_mode(struct amdgpu_device *adev)<br>
 {<br>
         struct ci_power_info *pi = ci_get_pi(adev);<br>
-       u32 tmp;<br>
 <br>
         if (pi->fan_is_controlled_by_smc)<br>
-               return 0;<br>
-<br>
-       tmp = RREG32_SMC(ixCG_FDO_CTRL2) & CG_FDO_CTRL2__FDO_PWM_MODE_MASK;<br>
-       return (tmp >> CG_FDO_CTRL2__FDO_PWM_MODE__SHIFT);<br>
+               return AMD_FAN_CTRL_AUTO;<br>
+       else<br>
+               return AMD_FAN_CTRL_MANUAL;<br>
 }<br>
 <br>
 #if 0<br>
-- <br>
1.9.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>