aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2015-10-20 22:34:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-12-21 16:42:24 -0500
commitfba4eef5847a1c9c8b49c039bc8aa6c9070d058e (patch)
tree7221481e064721250e9169bfb529649e7784b72d /drivers/gpu
parent251bb34fa44ef92dce1903e92af68f12a7f6d594 (diff)
drm/amdgpu/powerplay: add thermal control interface in hwmgr.
Thermal controller interface. Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c29
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h16
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/power_state.h4
3 files changed, 47 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
index 620119feb0fd..9d910f3284d0 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
@@ -194,3 +194,32 @@ int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr)
194 194
195 return 0; 195 return 0;
196} 196}
197
198int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr)
199{
200 if (hwmgr == NULL || hwmgr->hwmgr_func->stop_thermal_controller == NULL)
201 return -EINVAL;
202
203 return hwmgr->hwmgr_func->stop_thermal_controller(hwmgr);
204}
205
206int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
207{
208 if (hwmgr == NULL || hwmgr->hwmgr_func->register_internal_thermal_interrupt == NULL)
209 return -EINVAL;
210
211 return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info);
212}
213
214/**
215* Initializes the thermal controller subsystem.
216*
217* @param pHwMgr the address of the powerplay hardware manager.
218* @param pTemperatureRange the address of the structure holding the temperature range.
219* @exception PP_Result_Failed if any of the paramters is NULL, otherwise the return value from the dispatcher.
220*/
221int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range)
222{
223
224 return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL);
225}
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
index 1d2976000a74..a868110d477c 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
@@ -29,6 +29,18 @@ struct pp_hwmgr;
29struct pp_hw_power_state; 29struct pp_hw_power_state;
30struct pp_power_state; 30struct pp_power_state;
31enum amd_dpm_forced_level; 31enum amd_dpm_forced_level;
32struct PP_TemperatureRange;
33
34struct phm_fan_speed_info {
35 uint32_t min_percent;
36 uint32_t max_percent;
37 uint32_t min_rpm;
38 uint32_t max_rpm;
39 bool supports_percent_read;
40 bool supports_percent_write;
41 bool supports_rpm_read;
42 bool supports_rpm_write;
43};
32 44
33/* Automatic Power State Throttling */ 45/* Automatic Power State Throttling */
34enum PHM_AutoThrottleSource 46enum PHM_AutoThrottleSource
@@ -330,4 +342,8 @@ extern int phm_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
330extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level); 342extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level);
331extern int phm_display_configuration_changed(struct pp_hwmgr *hwmgr); 343extern int phm_display_configuration_changed(struct pp_hwmgr *hwmgr);
332extern int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr); 344extern int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr);
345extern int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info);
346extern int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range);
347extern int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr);
333#endif /* _HARDWARE_MANAGER_H_ */ 348#endif /* _HARDWARE_MANAGER_H_ */
349
diff --git a/drivers/gpu/drm/amd/powerplay/inc/power_state.h b/drivers/gpu/drm/amd/powerplay/inc/power_state.h
index c63bcc7da832..a3f0ce4d5835 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/power_state.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/power_state.h
@@ -122,8 +122,8 @@ struct PP_StateSoftwareAlgorithmBlock {
122 * Type to hold a temperature range. 122 * Type to hold a temperature range.
123 */ 123 */
124struct PP_TemperatureRange { 124struct PP_TemperatureRange {
125 uint16_t min; 125 uint32_t min;
126 uint16_t max; 126 uint32_t max;
127}; 127};
128 128
129struct PP_StateValidationBlock { 129struct PP_StateValidationBlock {