drm/amd/display: Allow idle optimization after turning off all pipes
authorAlvin Lee <Alvin.Lee2@amd.com>
Thu, 5 Jan 2023 15:46:47 +0000 (10:46 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Jan 2023 17:25:35 +0000 (12:25 -0500)
[Why]
In certain D3 cases (BOCO / BOMACO) the hardware is reset but
software state still has idle_optimizations = true. This prevents
us from entering idle optimizations again if no display is connected.

[How]
In hw init, reset the idle optimization state, and allow idle
optimizations after all pipes have been turned off.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c

index 56c90752df6db81a6baae7bd178dbe242f274670..c5d225c36a935491284e0e89102035e38d7c3b17 100644 (file)
@@ -807,6 +807,16 @@ void dcn32_init_hw(struct dc *dc)
                                        !dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
 
                dcn32_initialize_min_clocks(dc);
+
+               /* On HW init, allow idle optimizations after pipes have been turned off.
+                *
+                * In certain D3 cases (i.e. BOCO / BOMACO) it's possible that hardware state
+                * is reset (i.e. not in idle at the time hw init is called), but software state
+                * still has idle_optimizations = true, so we must disable idle optimizations first
+                * (i.e. set false), then re-enable (set true).
+                */
+               dc_allow_idle_optimizations(dc, false);
+               dc_allow_idle_optimizations(dc, true);
        }
 
        /* In headless boot cases, DIG may be turned