Commit 7ea86aec authored by Rex Zhu's avatar Rex Zhu Committed by Tim Gardner

drm/amd/powerplay: enable power down asic task. (v2)

BugLink: http://bugs.launchpad.net/bugs/1546572

v2: AGD: rebase on upstream
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e1d32e60)
Signed-off-by: default avatarAlberto Milone <alberto.milone@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent af5fc3ec
...@@ -68,8 +68,7 @@ int pem_task_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_d ...@@ -68,8 +68,7 @@ int pem_task_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_d
int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
{ {
/* TODO */ return phm_power_down_asic(eventmgr->hwmgr);
return 0;
} }
int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
......
...@@ -90,6 +90,22 @@ int phm_setup_asic(struct pp_hwmgr *hwmgr) ...@@ -90,6 +90,22 @@ int phm_setup_asic(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
int phm_power_down_asic(struct pp_hwmgr *hwmgr)
{
PHM_FUNC_CHECK(hwmgr);
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
PHM_PlatformCaps_TablelessHardwareInterface)) {
if (NULL != hwmgr->hwmgr_func->power_off_asic)
return hwmgr->hwmgr_func->power_off_asic(hwmgr);
} else {
return phm_dispatch_table(hwmgr, &(hwmgr->power_down_asic),
NULL, NULL);
}
return 0;
}
int phm_set_power_state(struct pp_hwmgr *hwmgr, int phm_set_power_state(struct pp_hwmgr *hwmgr,
const struct pp_hw_power_state *pcurrent_state, const struct pp_hw_power_state *pcurrent_state,
const struct pp_hw_power_state *pnew_power_state) 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,7 +263,6 @@ int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
*/ */
int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range) int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range)
{ {
return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL); return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL);
} }
......
...@@ -379,5 +379,7 @@ extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr, ...@@ -379,5 +379,7 @@ extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr); extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
extern int phm_power_down_asic(struct pp_hwmgr *hwmgr);
#endif /* _HARDWARE_MANAGER_H_ */ #endif /* _HARDWARE_MANAGER_H_ */
...@@ -326,7 +326,8 @@ struct pp_hwmgr_func { ...@@ -326,7 +326,8 @@ struct pp_hwmgr_func {
bool cc6_disable, bool pstate_disable, bool cc6_disable, bool pstate_disable,
bool pstate_switch_disable); bool pstate_switch_disable);
int (*get_dal_power_level)(struct pp_hwmgr *hwmgr, int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
struct amd_pp_dal_clock_info*info); struct amd_pp_dal_clock_info *info);
int (*power_off_asic)(struct pp_hwmgr *hwmgr);
}; };
struct pp_table_func { struct pp_table_func {
...@@ -577,9 +578,10 @@ struct pp_hwmgr { ...@@ -577,9 +578,10 @@ struct pp_hwmgr {
void *pptable; void *pptable;
struct phm_platform_descriptor platform_descriptor; struct phm_platform_descriptor platform_descriptor;
void *backend; void *backend;
enum PP_DAL_POWERLEVEL dal_power_level; enum PP_DAL_POWERLEVEL dal_power_level;
struct phm_dynamic_state_info dyn_state; struct phm_dynamic_state_info dyn_state;
struct phm_runtime_table_header setup_asic; struct phm_runtime_table_header setup_asic;
struct phm_runtime_table_header power_down_asic;
struct phm_runtime_table_header disable_dynamic_state_management; struct phm_runtime_table_header disable_dynamic_state_management;
struct phm_runtime_table_header enable_dynamic_state_management; struct phm_runtime_table_header enable_dynamic_state_management;
struct phm_runtime_table_header set_power_state; struct phm_runtime_table_header set_power_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment