drm/amd/display: Reinit DPG when exiting dynamic ODM
authorDillon Varone <Dillon.Varone@amd.com>
Mon, 17 Oct 2022 22:51:15 +0000 (18:51 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Nov 2022 15:46:47 +0000 (11:46 -0400)
[WHY]
DPG must be returned to initialized state when pipe is disabled.

[HOW]
Reinit DPG on unused pipes when exiting dynamic ODM.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c

index feff834..b465a83 100644 (file)
@@ -1079,6 +1079,29 @@ void dcn20_blank_pixel_data(
                                0);
        }
 
+       if (!blank && dc->debug.enable_single_display_2to1_odm_policy) {
+               /* when exiting dynamic ODM need to reinit DPG state for unused pipes */
+               struct pipe_ctx *old_odm_pipe = dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx].next_odm_pipe;
+
+               odm_pipe = pipe_ctx->next_odm_pipe;
+
+               while (old_odm_pipe) {
+                       if (!odm_pipe || old_odm_pipe->pipe_idx != odm_pipe->pipe_idx)
+                               dc->hwss.set_disp_pattern_generator(dc,
+                                               old_odm_pipe,
+                                               CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
+                                               CONTROLLER_DP_COLOR_SPACE_UDEFINED,
+                                               COLOR_DEPTH_888,
+                                               NULL,
+                                               0,
+                                               0,
+                                               0);
+                       old_odm_pipe = old_odm_pipe->next_odm_pipe;
+                       if (odm_pipe)
+                               odm_pipe = odm_pipe->next_odm_pipe;
+               }
+       }
+
        if (!blank)
                if (stream_res->abm) {
                        dc->hwss.set_pipe(pipe_ctx);