summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
diff options
context:
space:
mode:
authorEric Huang2016-09-12 22:17:44 +0200
committerAlex Deucher2017-03-30 05:52:48 +0200
commit34bb2734d1bc3c72e4739234481c0efab0941d14 (patch)
treec31583ca0511581253f37aea943ba840d8388bfd /drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
parentdrm/amdgpu:cleanup no needed braces (diff)
downloadkernel-qcow2-linux-34bb2734d1bc3c72e4739234481c0efab0941d14.tar.gz
kernel-qcow2-linux-34bb2734d1bc3c72e4739234481c0efab0941d14.tar.xz
kernel-qcow2-linux-34bb2734d1bc3c72e4739234481c0efab0941d14.zip
drm/amd/amdgpu: add power profile sysfs entry
Add the sysfs entries pp_gfx_power_profile and pp_compute_power_profile which give user a way to set power profile through parameters minimum sclk, minimum mclk, activity threshold, up hysteresis and down hysteresis only when the entry power_dpm_force_performance_level is in default value "auto". It is read and write. Example: echo 500 800 20 0 5 > /sys/class/drm/card0/device/pp_*_power_profile cat /sys/class/drm/card0/device/pp_*_power_profile 500 800 20 0 5 Note: first parameter is sclk in MHz, second is mclk in MHz, third is activity threshold in percentage, fourth is up hysteresis in ms and fifth is down hysteresis in ms. echo set > /sys/class/drm/card0/device/pp_*_power_profile To set power profile state if it exists. echo reset > /sys/class/drm/card0/device/pp_*_power_profile To restore default state and clear previous setting. Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Acked-by: Rex Zhu <Rex.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/inc/hwmgr.h')
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hwmgr.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 7275a29293eb..768f81f365ca 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -358,6 +358,8 @@ struct pp_hwmgr_func {
int (*read_sensor)(struct pp_hwmgr *hwmgr, int idx, int32_t *value);
int (*request_firmware)(struct pp_hwmgr *hwmgr);
int (*release_firmware)(struct pp_hwmgr *hwmgr);
+ int (*set_power_profile_state)(struct pp_hwmgr *hwmgr,
+ struct amd_pp_profile *request);
};
struct pp_table_func {
@@ -650,6 +652,13 @@ struct pp_hwmgr {
struct pp_power_state *uvd_ps;
struct amd_pp_display_configuration display_config;
uint32_t feature_mask;
+
+ /* power profile */
+ struct amd_pp_profile gfx_power_profile;
+ struct amd_pp_profile compute_power_profile;
+ struct amd_pp_profile default_gfx_power_profile;
+ struct amd_pp_profile default_compute_power_profile;
+ enum amd_pp_profile_type current_power_profile;
};
extern int hwmgr_early_init(struct pp_instance *handle);