diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-08-31 18:30:42 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-02 15:32:09 (GMT) |
commit | 48fad3aff638c7bc16656e31047f689aa44020a1 (patch) | |
tree | 1ed434f0798cea87ce4761843e030b84185fe45d /drivers/gpu/drm/amd/powerplay/eventmgr | |
parent | cfcc283cee50e98e47a56ab2b3f85540a1f93ab4 (diff) | |
download | linux-48fad3aff638c7bc16656e31047f689aa44020a1.tar.xz |
drm/amd/powerplay: original power state table should not be changed.
power state table was set based on vbios and should not be changed.
when client need to change power state, just make a copy and send to
smu.
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/powerplay/eventmgr')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/eventmgr/psm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c index a46225c..1d1875a 100644 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c +++ b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c @@ -70,11 +70,12 @@ int psm_set_states(struct pp_eventmgr *eventmgr, unsigned long *state_id) int i; table_entries = hwmgr->num_ps; + state = hwmgr->ps; for (i = 0; i < table_entries; i++) { if (state->id == *state_id) { - hwmgr->request_ps = state; + memcpy(hwmgr->request_ps, state, hwmgr->ps_size); return 0; } state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size); @@ -106,7 +107,7 @@ int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip) if (!equal || phm_check_smc_update_required_for_display_configuration(hwmgr)) { phm_apply_state_adjust_rules(hwmgr, requested, pcurrent); phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware); - hwmgr->current_ps = requested; + memcpy(hwmgr->current_ps, hwmgr->request_ps, hwmgr->ps_size); } return 0; } |