drm/amd/display: Disallow entering PSR when panel is disconnected
authorMax Erenberg <merenber@amd.com>
Tue, 23 Nov 2021 20:10:16 +0000 (15:10 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Apr 2022 17:51:32 +0000 (13:51 -0400)
[WHY]
The dGPU cannot enter PSR when it is not connected to a panel.

[HOW]
Added a check to dc_link_set_psr_allow_active
which returns early if panel is disconnected.

Reviewed-by: Harry Vanzylldejong <harry.vanzylldejong@amd.com>
Reviewed-by: Evgenii Krasnikov <Evgenii.Krasnikov@amd.com>
Reviewed-by: Nicholas Choi <Nicholas.Choi@amd.com>
Acked-by: Pavle Kotarac <Pavle.Kotarac@amd.com>
Signed-off-by: Max Erenberg <merenber@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index 47b67fd..22f2d88 100644 (file)
@@ -3079,6 +3079,11 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active
        if (!dc_get_edp_link_panel_inst(dc, link, &panel_inst))
                return false;
 
+       if (allow_active && link->type == dc_connection_none) {
+               // Don't enter PSR if panel is not connected
+               return false;
+       }
+
        /* Set power optimization flag */
        if (power_opts && link->psr_settings.psr_power_opt != *power_opts) {
                link->psr_settings.psr_power_opt = *power_opts;