diff options
author | Chengming Gui | 2019-01-22 10:56:16 +0100 |
---|---|---|
committer | Alex Deucher | 2019-03-19 21:04:01 +0100 |
commit | 014c4440161b96ad237b1795f9dfdff24c419342 (patch) | |
tree | b489cc7006fecb83941a5415ab65b68e840642a7 /drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | |
parent | drm/amd/powerplay: add fan input interface for hwmon (diff) | |
download | kernel-qcow2-linux-014c4440161b96ad237b1795f9dfdff24c419342.tar.gz kernel-qcow2-linux-014c4440161b96ad237b1795f9dfdff24c419342.tar.xz kernel-qcow2-linux-014c4440161b96ad237b1795f9dfdff24c419342.zip |
drm/amd/powerplay: implement power1_cap and power1_cap_max interface for SMU11 (v2)
add get_power_limit and set_power_limit functions
to support hwmon for SMU11.
v2: fix the code style issue.
Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-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/amdgpu_smu.h')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h index 2cc7129b53aa..d49bdee76f0e 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h @@ -484,7 +484,8 @@ struct smu_funcs int (*disable_all_mask)(struct smu_context *smu); int (*update_feature_enable_state)(struct smu_context *smu, uint32_t feature_id, bool enabled); int (*notify_display_change)(struct smu_context *smu); - int (*get_power_limit)(struct smu_context *smu); + int (*get_power_limit)(struct smu_context *smu, uint32_t *limit, bool def); + int (*set_power_limit)(struct smu_context *smu, uint32_t n); int (*get_current_clk_freq)(struct smu_context *smu, uint32_t clk_id, uint32_t *value); int (*init_max_sustainable_clocks)(struct smu_context *smu); int (*start_thermal_control)(struct smu_context *smu); @@ -619,8 +620,10 @@ struct smu_funcs ((smu)->ppt_funcs->set_default_od8_settings ? (smu)->ppt_funcs->set_default_od8_settings((smu)) : 0) #define smu_update_specified_od8_value(smu, index, value) \ ((smu)->ppt_funcs->update_specified_od8_value ? (smu)->ppt_funcs->update_specified_od8_value((smu), (index), (value)) : 0) -#define smu_get_power_limit(smu) \ - ((smu)->funcs->get_power_limit? (smu)->funcs->get_power_limit((smu)) : 0) +#define smu_get_power_limit(smu, limit, def) \ + ((smu)->funcs->get_power_limit ? (smu)->funcs->get_power_limit((smu), (limit), (def)) : 0) +#define smu_set_power_limit(smu, limit) \ + ((smu)->funcs->set_power_limit ? (smu)->funcs->set_power_limit((smu), (limit)) : 0) #define smu_get_current_clk_freq(smu, clk_id, value) \ ((smu)->funcs->get_current_clk_freq? (smu)->funcs->get_current_clk_freq((smu), (clk_id), (value)) : 0) #define smu_print_clk_levels(smu, type, buf) \ |