aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/powerplay/eventmgr/psm.c13
-rw-r--r--drivers/gpu/drm/amd/powerplay/eventmgr/psm.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c
index 08b75bd70c0f..82774ace8bdb 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c
@@ -86,9 +86,10 @@ int psm_set_performance_states(struct pp_eventmgr *eventmgr, unsigned long *stat
86int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip) 86int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip)
87{ 87{
88 88
89 const struct pp_power_state *pcurrent; 89 struct pp_power_state *pcurrent;
90 struct pp_power_state *requested; 90 struct pp_power_state *requested;
91 struct pp_hwmgr *hwmgr; 91 struct pp_hwmgr *hwmgr;
92 bool equal;
92 93
93 if (skip) 94 if (skip)
94 return 0; 95 return 0;
@@ -97,7 +98,13 @@ int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip)
97 pcurrent = hwmgr->current_ps; 98 pcurrent = hwmgr->current_ps;
98 requested = hwmgr->request_ps; 99 requested = hwmgr->request_ps;
99 100
100 if ((pcurrent != NULL || requested != NULL) && (pcurrent != requested)) { 101 if (requested == NULL)
102 return 0;
103
104 if (pcurrent == NULL || (0 != phm_check_states_equal(hwmgr, &pcurrent->hardware, &requested->hardware, &equal)))
105 equal = false;
106
107 if (!equal || phm_check_smc_update_required_for_display_configuration(hwmgr)) {
101 phm_apply_state_adjust_rules(hwmgr, requested, pcurrent); 108 phm_apply_state_adjust_rules(hwmgr, requested, pcurrent);
102 phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware); 109 phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware);
103 hwmgr->current_ps = requested; 110 hwmgr->current_ps = requested;
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h
index 15abfac720ee..1380470fdb1c 100644
--- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h
+++ b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h
@@ -25,6 +25,7 @@
25#include "eventmanagement.h" 25#include "eventmanagement.h"
26#include "eventmanager.h" 26#include "eventmanager.h"
27#include "power_state.h" 27#include "power_state.h"
28#include "hardwaremanager.h"
28 29
29int psm_get_ui_state(struct pp_eventmgr *eventmgr, enum PP_StateUILabel ui_label, unsigned long *state_id); 30int psm_get_ui_state(struct pp_eventmgr *eventmgr, enum PP_StateUILabel ui_label, unsigned long *state_id);
30 31