mirror of https://gitee.com/openkylin/linux.git
drm/amd/powerplay: add event task of disable dynamic state management
Add an interface to disable dpm so that we can disable dpm before updating pptables at runtime. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
cf17039f48
commit
80597521e6
|
@ -132,8 +132,7 @@ int pem_task_enable_dynamic_state_management(struct pp_eventmgr *eventmgr, struc
|
|||
|
||||
int pem_task_disable_dynamic_state_management(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
|
||||
{
|
||||
/* TODO */
|
||||
return 0;
|
||||
return phm_disable_dynamic_state_management(eventmgr->hwmgr);
|
||||
}
|
||||
|
||||
int pem_task_enable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
|
||||
|
|
|
@ -154,6 +154,30 @@ int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int phm_disable_dynamic_state_management(struct pp_hwmgr *hwmgr)
|
||||
{
|
||||
int ret = -1;
|
||||
bool enabled;
|
||||
|
||||
PHM_FUNC_CHECK(hwmgr);
|
||||
|
||||
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
|
||||
PHM_PlatformCaps_TablelessHardwareInterface)) {
|
||||
if (hwmgr->hwmgr_func->dynamic_state_management_disable)
|
||||
ret = hwmgr->hwmgr_func->dynamic_state_management_disable(hwmgr);
|
||||
} else {
|
||||
ret = phm_dispatch_table(hwmgr,
|
||||
&(hwmgr->disable_dynamic_state_management),
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
enabled = ret == 0 ? false : true;
|
||||
|
||||
cgs_notify_dpm_enabled(hwmgr->device, enabled);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int phm_force_dpm_levels(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_level level)
|
||||
{
|
||||
PHM_FUNC_CHECK(hwmgr);
|
||||
|
|
|
@ -340,6 +340,7 @@ extern int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate);
|
|||
extern int phm_powerdown_uvd(struct pp_hwmgr *hwmgr);
|
||||
extern int phm_setup_asic(struct pp_hwmgr *hwmgr);
|
||||
extern int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr);
|
||||
extern int phm_disable_dynamic_state_management(struct pp_hwmgr *hwmgr);
|
||||
extern void phm_init_dynamic_caps(struct pp_hwmgr *hwmgr);
|
||||
extern bool phm_is_hw_access_blocked(struct pp_hwmgr *hwmgr);
|
||||
extern int phm_block_hw_access(struct pp_hwmgr *hwmgr, bool block);
|
||||
|
|
|
@ -278,6 +278,8 @@ struct pp_hwmgr_func {
|
|||
|
||||
int (*dynamic_state_management_enable)(
|
||||
struct pp_hwmgr *hw_mgr);
|
||||
int (*dynamic_state_management_disable)(
|
||||
struct pp_hwmgr *hw_mgr);
|
||||
|
||||
int (*patch_boot_state)(struct pp_hwmgr *hwmgr,
|
||||
struct pp_hw_power_state *hw_ps);
|
||||
|
|
Loading…
Reference in New Issue