[PATCH 02/14] drm/amd/display: Skip powerstate DC hw access if virtual dal

Eryk Brol eryk.brol at amd.com
Fri Mar 5 20:02:49 UTC 2021


From: Martin Leung <martin.leung at amd.com>

[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

Signed-off-by: Martin Leung <martin.leung at amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr at amd.com>
Acked-by: Eryk Brol <eryk.brol at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 87b8315cfbb8..daf1b20028b8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2887,6 +2887,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);
-- 
2.25.1



More information about the amd-gfx mailing list