diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2015-12-28 22:22:34 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-01-08 15:39:27 -0500 |
commit | e1d32e607b5ce25a7852bef4ab4de2a80f30c546 (patch) | |
tree | f40273d902b5237b924228e235206fc46868f67f /drivers/gpu/drm/amd | |
parent | 018462d015c5672de0be8045b1acff19f5df6010 (diff) |
drm/amd/powerplay: enable power down asic task. (v2)
v2: AGD: rebase on upstream
Signed-off-by: Rex Zhu <Rex.Zhu@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')
4 files changed, 23 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c index f0b449157653..5cd123472db4 100644 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c +++ b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c | |||
@@ -68,8 +68,7 @@ int pem_task_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_d | |||
68 | 68 | ||
69 | int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | 69 | int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) |
70 | { | 70 | { |
71 | /* TODO */ | 71 | return phm_power_down_asic(eventmgr->hwmgr); |
72 | return 0; | ||
73 | } | 72 | } |
74 | 73 | ||
75 | int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | 74 | int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c index f9bf4fccbc79..0f2d5e4bc241 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | |||
@@ -90,6 +90,22 @@ int phm_setup_asic(struct pp_hwmgr *hwmgr) | |||
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
93 | int phm_power_down_asic(struct pp_hwmgr *hwmgr) | ||
94 | { | ||
95 | PHM_FUNC_CHECK(hwmgr); | ||
96 | |||
97 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, | ||
98 | PHM_PlatformCaps_TablelessHardwareInterface)) { | ||
99 | if (NULL != hwmgr->hwmgr_func->power_off_asic) | ||
100 | return hwmgr->hwmgr_func->power_off_asic(hwmgr); | ||
101 | } else { | ||
102 | return phm_dispatch_table(hwmgr, &(hwmgr->power_down_asic), | ||
103 | NULL, NULL); | ||
104 | } | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | |||
93 | int phm_set_power_state(struct pp_hwmgr *hwmgr, | 109 | int phm_set_power_state(struct pp_hwmgr *hwmgr, |
94 | const struct pp_hw_power_state *pcurrent_state, | 110 | const struct pp_hw_power_state *pcurrent_state, |
95 | const struct pp_hw_power_state *pnew_power_state) | 111 | const struct pp_hw_power_state *pnew_power_state) |
@@ -247,7 +263,6 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info) | |||
247 | */ | 263 | */ |
248 | int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range) | 264 | int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range) |
249 | { | 265 | { |
250 | |||
251 | return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL); | 266 | return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL); |
252 | } | 267 | } |
253 | 268 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h index a503306c3d0e..91795efe1336 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | |||
@@ -379,5 +379,7 @@ extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, | |||
379 | 379 | ||
380 | extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr); | 380 | extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr); |
381 | 381 | ||
382 | extern int phm_power_down_asic(struct pp_hwmgr *hwmgr); | ||
383 | |||
382 | #endif /* _HARDWARE_MANAGER_H_ */ | 384 | #endif /* _HARDWARE_MANAGER_H_ */ |
383 | 385 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index eb0f1b22d42d..aeaa3dbba525 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | |||
@@ -325,7 +325,8 @@ struct pp_hwmgr_func { | |||
325 | bool cc6_disable, bool pstate_disable, | 325 | bool cc6_disable, bool pstate_disable, |
326 | bool pstate_switch_disable); | 326 | bool pstate_switch_disable); |
327 | int (*get_dal_power_level)(struct pp_hwmgr *hwmgr, | 327 | int (*get_dal_power_level)(struct pp_hwmgr *hwmgr, |
328 | struct amd_pp_dal_clock_info*info); | 328 | struct amd_pp_dal_clock_info *info); |
329 | int (*power_off_asic)(struct pp_hwmgr *hwmgr); | ||
329 | }; | 330 | }; |
330 | 331 | ||
331 | struct pp_table_func { | 332 | struct pp_table_func { |
@@ -576,9 +577,10 @@ struct pp_hwmgr { | |||
576 | void *pptable; | 577 | void *pptable; |
577 | struct phm_platform_descriptor platform_descriptor; | 578 | struct phm_platform_descriptor platform_descriptor; |
578 | void *backend; | 579 | void *backend; |
579 | enum PP_DAL_POWERLEVEL dal_power_level; | 580 | enum PP_DAL_POWERLEVEL dal_power_level; |
580 | struct phm_dynamic_state_info dyn_state; | 581 | struct phm_dynamic_state_info dyn_state; |
581 | struct phm_runtime_table_header setup_asic; | 582 | struct phm_runtime_table_header setup_asic; |
583 | struct phm_runtime_table_header power_down_asic; | ||
582 | struct phm_runtime_table_header disable_dynamic_state_management; | 584 | struct phm_runtime_table_header disable_dynamic_state_management; |
583 | struct phm_runtime_table_header enable_dynamic_state_management; | 585 | struct phm_runtime_table_header enable_dynamic_state_management; |
584 | struct phm_runtime_table_header set_power_state; | 586 | struct phm_runtime_table_header set_power_state; |