aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-03-21 01:11:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-03-21 15:36:58 -0400
commit4d2003721c2bd6add6746426eec1d879432c92dd (patch)
tree4c2322e42c44c5a7368e15bd3d9ad8b984d57e21 /drivers/gpu/drm
parent160b8e75932fd51a49607d32dbfa1d417977b79c (diff)
drm/amd/pp: Refine register_thermal_interrupt function
v2: add Vega12 support 1. delete useless argument in function register_thermal_interrupt 2. rename function name register_thermal_interrupt to register_irq_handlers 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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c6
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c5
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c3
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h3
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/hwmgr.h3
9 files changed, 12 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
index b784131d0f87..ae2e9339dd6b 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
@@ -202,12 +202,12 @@ int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr)
202 return hwmgr->hwmgr_func->stop_thermal_controller(hwmgr); 202 return hwmgr->hwmgr_func->stop_thermal_controller(hwmgr);
203} 203}
204 204
205int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info) 205int phm_register_irq_handlers(struct pp_hwmgr *hwmgr)
206{ 206{
207 PHM_FUNC_CHECK(hwmgr); 207 PHM_FUNC_CHECK(hwmgr);
208 208
209 if (hwmgr->hwmgr_func->register_internal_thermal_interrupt != NULL) 209 if (hwmgr->hwmgr_func->register_irq_handlers != NULL)
210 return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info); 210 return hwmgr->hwmgr_func->register_irq_handlers(hwmgr);
211 211
212 return 0; 212 return 0;
213} 213}
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index ce581ae1103a..bafcfd2cf156 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -206,7 +206,7 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)
206 if (ret) 206 if (ret)
207 goto err2; 207 goto err2;
208 208
209 ret = phm_register_thermal_interrupt(hwmgr, NULL); 209 ret = phm_register_irq_handlers(hwmgr);
210 if (ret) 210 if (ret)
211 goto err2; 211 goto err2;
212 212
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 478e31d5da0f..d699861fd76d 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3998,8 +3998,7 @@ static int smu7_set_max_fan_rpm_output(struct pp_hwmgr *hwmgr, uint16_t us_max_f
3998 PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm); 3998 PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm);
3999} 3999}
4000 4000
4001static int smu7_register_internal_thermal_interrupt(struct pp_hwmgr *hwmgr, 4001static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr)
4002 const void *thermal_interrupt_info)
4003{ 4002{
4004 return 0; 4003 return 0;
4005} 4004}
@@ -4984,7 +4983,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
4984 .get_fan_speed_rpm = smu7_fan_ctrl_get_fan_speed_rpm, 4983 .get_fan_speed_rpm = smu7_fan_ctrl_get_fan_speed_rpm,
4985 .set_fan_speed_rpm = smu7_fan_ctrl_set_fan_speed_rpm, 4984 .set_fan_speed_rpm = smu7_fan_ctrl_set_fan_speed_rpm,
4986 .uninitialize_thermal_controller = smu7_thermal_ctrl_uninitialize_thermal_controller, 4985 .uninitialize_thermal_controller = smu7_thermal_ctrl_uninitialize_thermal_controller,
4987 .register_internal_thermal_interrupt = smu7_register_internal_thermal_interrupt, 4986 .register_irq_handlers = smu7_register_irq_handlers,
4988 .check_smc_update_required_for_display_configuration = smu7_check_smc_update_required_for_display_configuration, 4987 .check_smc_update_required_for_display_configuration = smu7_check_smc_update_required_for_display_configuration,
4989 .check_states_equal = smu7_check_states_equal, 4988 .check_states_equal = smu7_check_states_equal,
4990 .set_fan_control_mode = smu7_set_fan_control_mode, 4989 .set_fan_control_mode = smu7_set_fan_control_mode,
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
index 1f6d481826ff..598122854ab5 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
@@ -581,8 +581,7 @@ static const struct amdgpu_irq_src_funcs smu9_irq_funcs = {
581 .process = phm_irq_process, 581 .process = phm_irq_process,
582}; 582};
583 583
584int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 584int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr)
585 const void *info)
586{ 585{
587 struct amdgpu_irq_src *source = 586 struct amdgpu_irq_src *source =
588 kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL); 587 kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL);
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h
index 6a43a2ac5304..6429dc2f2df9 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h
@@ -77,8 +77,7 @@ int phm_irq_process(struct amdgpu_device *adev,
77 struct amdgpu_irq_src *source, 77 struct amdgpu_irq_src *source,
78 struct amdgpu_iv_entry *entry); 78 struct amdgpu_iv_entry *entry);
79 79
80int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 80int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr);
81 const void *info);
82 81
83#define PHM_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT 82#define PHM_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
84#define PHM_FIELD_MASK(reg, field) reg##__##field##_MASK 83#define PHM_FIELD_MASK(reg, field) reg##__##field##_MASK
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index bb2eb1cd05a9..7cbb56ba6fab 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4939,7 +4939,7 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
4939 .avfs_control = vega10_avfs_enable, 4939 .avfs_control = vega10_avfs_enable,
4940 .notify_cac_buffer_info = vega10_notify_cac_buffer_info, 4940 .notify_cac_buffer_info = vega10_notify_cac_buffer_info,
4941 .get_thermal_temperature_range = vega10_get_thermal_temperature_range, 4941 .get_thermal_temperature_range = vega10_get_thermal_temperature_range,
4942 .register_internal_thermal_interrupt = smu9_register_thermal_interrupt, 4942 .register_irq_handlers = smu9_register_irq_handlers,
4943 .start_thermal_controller = vega10_start_thermal_controller, 4943 .start_thermal_controller = vega10_start_thermal_controller,
4944 .get_power_profile_mode = vega10_get_power_profile_mode, 4944 .get_power_profile_mode = vega10_get_power_profile_mode,
4945 .set_power_profile_mode = vega10_set_power_profile_mode, 4945 .set_power_profile_mode = vega10_set_power_profile_mode,
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index b9f8ec5df8a7..da2053e10671 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -2557,7 +2557,7 @@ static const struct pp_hwmgr_func vega12_hwmgr_funcs = {
2557#endif 2557#endif
2558 .notify_cac_buffer_info = vega12_notify_cac_buffer_info, 2558 .notify_cac_buffer_info = vega12_notify_cac_buffer_info,
2559 .get_thermal_temperature_range = vega12_get_thermal_temperature_range, 2559 .get_thermal_temperature_range = vega12_get_thermal_temperature_range,
2560 .register_internal_thermal_interrupt = smu9_register_thermal_interrupt, 2560 .register_irq_handlers = smu9_register_irq_handlers,
2561 .start_thermal_controller = vega12_start_thermal_controller, 2561 .start_thermal_controller = vega12_start_thermal_controller,
2562}; 2562};
2563 2563
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
index 19f2e43480cb..8b78bbecd1bc 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
@@ -417,7 +417,7 @@ extern int phm_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,
417extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level); 417extern int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level);
418extern int phm_display_configuration_changed(struct pp_hwmgr *hwmgr); 418extern int phm_display_configuration_changed(struct pp_hwmgr *hwmgr);
419extern int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr); 419extern int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hwmgr);
420extern int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info); 420extern int phm_register_irq_handlers(struct pp_hwmgr *hwmgr);
421extern int phm_start_thermal_controller(struct pp_hwmgr *hwmgr); 421extern int phm_start_thermal_controller(struct pp_hwmgr *hwmgr);
422extern int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr); 422extern int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr);
423extern bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr); 423extern bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr);
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
index 985fe8d5bf7d..d742d9d087f0 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
@@ -287,8 +287,7 @@ struct pp_hwmgr_func {
287 int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed); 287 int (*get_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t *speed);
288 int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr); 288 int (*reset_fan_speed_to_default)(struct pp_hwmgr *hwmgr);
289 int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr); 289 int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
290 int (*register_internal_thermal_interrupt)(struct pp_hwmgr *hwmgr, 290 int (*register_irq_handlers)(struct pp_hwmgr *hwmgr);
291 const void *thermal_interrupt_info);
292 bool (*check_smc_update_required_for_display_configuration)(struct pp_hwmgr *hwmgr); 291 bool (*check_smc_update_required_for_display_configuration)(struct pp_hwmgr *hwmgr);
293 int (*check_states_equal)(struct pp_hwmgr *hwmgr, 292 int (*check_states_equal)(struct pp_hwmgr *hwmgr,
294 const struct pp_hw_power_state *pstate1, 293 const struct pp_hw_power_state *pstate1,