aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Leung <[email protected]>2021-02-19 17:40:09 -0500
committerAlex Deucher <[email protected]>2021-03-23 23:02:11 -0400
commitd3cf9fa6baced06fce3cfb100258c0dcb9fb1305 (patch)
treeec00da67e75ddecb5d874e99cb2dc0ffe9a895c8
parentffe5650af0a140c0b3bf16f0d196c356fc849b3e (diff)
drm/amd/display: Skip powerstate DC hw access if virtual dal
[Why] On baco-enabled systems running virtual dal, can get set power state when hw is not initialized [How] Skip DC hw part of setPowerState when hw not available Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Martin Leung <[email protected]> Reviewed-by: Aric Cyr <[email protected]> Acked-by: Eryk Brol <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 86de6eed8450..3dc49964ea7f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2969,6 +2969,9 @@ void dc_set_power_state(
struct kref refcount;
struct display_mode_lib *dml;
+ if (!dc->current_state)
+ return;
+
switch (power_state) {
case DC_ACPI_CM_POWER_STATE_D0:
dc_resource_state_construct(dc, dc->current_state);