drm/amd/pp: Add common interface in smu for update dpm setting
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 24 Jan 2018 06:48:17 +0000 (14:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Mar 2018 20:39:28 +0000 (15:39 -0500)
it is used for adjust part of dpm settigs per workloads
to change the natural dpm behavior for better perf or perf/watt.

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/inc/hwmgr.h
drivers/gpu/drm/amd/powerplay/inc/smumgr.h
drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c

index bb50cc2..ae73956 100644 (file)
@@ -239,6 +239,7 @@ struct pp_smumgr_func {
        int (*populate_requested_graphic_levels)(struct pp_hwmgr *hwmgr,
                        struct amd_pp_profile *request);
        bool (*is_hw_avfs_present)(struct pp_hwmgr  *hwmgr);
+       int (*update_dpm_settings)(struct pp_hwmgr *hwmgr, void *profile_setting);
 };
 
 struct pp_hwmgr_func {
index b1b27b2..e05a57e 100644 (file)
@@ -134,5 +134,6 @@ extern int smum_populate_requested_graphic_levels(struct pp_hwmgr *hwmgr,
 
 extern bool smum_is_hw_avfs_present(struct pp_hwmgr *hwmgr);
 
+extern int smum_update_dpm_settings(struct pp_hwmgr *hwmgr, void *profile_setting);
 
 #endif
index 8673884..1ce4959 100644 (file)
@@ -253,3 +253,11 @@ bool smum_is_hw_avfs_present(struct pp_hwmgr *hwmgr)
 
        return false;
 }
+
+int smum_update_dpm_settings(struct pp_hwmgr *hwmgr, void *profile_setting)
+{
+       if (hwmgr->smumgr_funcs->update_dpm_settings)
+               return hwmgr->smumgr_funcs->update_dpm_settings(hwmgr, profile_setting);
+
+       return -EINVAL;
+}