drm/amd/powerplay: add voltage change support through pp_table
authorEric Huang <JinHuiEric.Huang@amd.com>
Wed, 1 Mar 2017 20:49:31 +0000 (15:49 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:53:27 +0000 (23:53 -0400)
Disable avfs to make voltage change take effect.

Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h

index fde8fcd..8132d46 100644 (file)
@@ -750,7 +750,17 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)
 
        hwmgr->soft_pp_table = hwmgr->hardcode_pp_table;
 
-       return amd_powerplay_reset(handle);
+       ret = amd_powerplay_reset(handle);
+       if (ret)
+               return ret;
+
+       if (hwmgr->hwmgr_func->avfs_control) {
+               ret = hwmgr->hwmgr_func->avfs_control(hwmgr, false);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
 }
 
 static int pp_dpm_force_clock_level(void *handle,
index 8cf5aed..d5aa6cd 100644 (file)
@@ -360,6 +360,7 @@ struct pp_hwmgr_func {
        int (*release_firmware)(struct pp_hwmgr *hwmgr);
        int (*set_power_profile_state)(struct pp_hwmgr *hwmgr,
                        struct amd_pp_profile *request);
+       int (*avfs_control)(struct pp_hwmgr *hwmgr, bool enable);
 };
 
 struct pp_table_func {