drm/amd/powerplay: enable MGPU fan boost feature on Vega20
authorEvan Quan <evan.quan@amd.com>
Thu, 27 Sep 2018 05:48:45 +0000 (13:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:00:05 +0000 (17:00 -0500)
Added Vega20 specific implementation for MGPU fan boost
feature.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c

index 7884ae3b1922c75941fdd8828638caabde850d68..958af7b48827cd534448d0df6eaa5ed2c6e70abd 100644 (file)
@@ -1477,6 +1477,19 @@ static int vega20_init_max_sustainable_clocks(struct pp_hwmgr *hwmgr)
        return 0;
 }
 
+static int vega20_enable_mgpu_fan_boost(struct pp_hwmgr *hwmgr)
+{
+       int result;
+
+       result = smum_send_msg_to_smc(hwmgr,
+               PPSMC_MSG_SetMGpuFanBoostLimitRpm);
+       PP_ASSERT_WITH_CODE(!result,
+                       "[EnableMgpuFan] Failed to enable mgpu fan boost!",
+                       return result);
+
+       return 0;
+}
+
 static void vega20_init_powergate_state(struct pp_hwmgr *hwmgr)
 {
        struct vega20_hwmgr *data =
@@ -3488,6 +3501,8 @@ static const struct pp_hwmgr_func vega20_hwmgr_funcs = {
        /* smu memory related */
        .notify_cac_buffer_info =
                vega20_notify_cac_buffer_info,
+       .enable_mgpu_fan_boost =
+               vega20_enable_mgpu_fan_boost,
 };
 
 int vega20_hwmgr_init(struct pp_hwmgr *hwmgr)