drm/amd/pp: Make sure clock_voltage_limit_table on dc is valid
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 13 Jun 2018 10:53:49 +0000 (18:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Jun 2018 15:28:11 +0000 (10:28 -0500)
if vbios not set the max clock voltage limit table for DC mode,
Set the table as sama as the table for AC mode.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c

index e63bc47dc715f12dcac2280ab66d80a5e0b03d7d..4ef77cebc62848d7c0820fd079bad69e574c4816 100644 (file)
@@ -236,6 +236,11 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)
        ret = hwmgr->hwmgr_func->backend_init(hwmgr);
        if (ret)
                goto err1;
+ /* make sure dc limits are valid */
+       if ((hwmgr->dyn_state.max_clock_voltage_on_dc.sclk == 0) ||
+                       (hwmgr->dyn_state.max_clock_voltage_on_dc.mclk == 0))
+                       hwmgr->dyn_state.max_clock_voltage_on_dc =
+                                       hwmgr->dyn_state.max_clock_voltage_on_ac;
 
        ret = psm_init_power_state_table(hwmgr);
        if (ret)