drm/amd/display: ensure PSR force_static flag can always be set
authorEvgenii Krasnikov <Evgenii.Krasnikov@amd.com>
Wed, 26 Jan 2022 20:11:53 +0000 (15:11 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 12 Apr 2022 18:17:56 +0000 (14:17 -0400)
[HOW&WHY]
Make sure psr_force_static() can always be called regardless of
psr_allow_active value.

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: Evgenii Krasnikov <Evgenii.Krasnikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index c1a727f..b625b46 100644 (file)
@@ -3092,6 +3092,10 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active
                        psr->funcs->psr_set_power_opt(psr, link->psr_settings.psr_power_opt, panel_inst);
        }
 
+       if (psr != NULL && link->psr_settings.psr_feature_enabled &&
+                       force_static && psr->funcs->psr_force_static)
+               psr->funcs->psr_force_static(psr, panel_inst);
+
        /* Enable or Disable PSR */
        if (allow_active && link->psr_settings.psr_allow_active != *allow_active) {
                link->psr_settings.psr_allow_active = *allow_active;
@@ -3102,8 +3106,6 @@ bool dc_link_set_psr_allow_active(struct dc_link *link, const bool *allow_active
 #endif
 
                if (psr != NULL && link->psr_settings.psr_feature_enabled) {
-                       if (force_static && psr->funcs->psr_force_static)
-                               psr->funcs->psr_force_static(psr, panel_inst);
                        psr->funcs->psr_enable(psr, link->psr_settings.psr_allow_active, wait, panel_inst);
                } else if ((dmcu != NULL && dmcu->funcs->is_dmcu_initialized(dmcu)) &&
                        link->psr_settings.psr_feature_enabled)