drm/amd/display: Increase compbuf size prior to updating clocks
authorDillon Varone <Dillon.Varone@amd.com>
Wed, 21 Sep 2022 00:50:49 +0000 (20:50 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Oct 2022 16:00:54 +0000 (12:00 -0400)
[WHY?]
Clocks are updating based on the incoming context's support, however the new
compbuf size is not programmed prior to udpating clocks, which can result in
P-State hangs.

[HOW?]
Increase compbuf size prior to updating clocks.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Dillon Varone <Dillon.Varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c

index e1d271fe9e641fdba06f219b326963d33e092a58..7de511fd004b5ae5ba52234469a7c77d45d80f6f 100644 (file)
@@ -2018,6 +2018,10 @@ void dcn20_optimize_bandwidth(
                                context->bw_ctx.bw.dcn.clk.dramclk_khz <= dc->clk_mgr->bw_params->dc_mode_softmax_memclk * 1000)
                        dc->clk_mgr->funcs->set_max_memclk(dc->clk_mgr, dc->clk_mgr->bw_params->dc_mode_softmax_memclk);
 
+       /* increase compbuf size */
+       if (hubbub->funcs->program_compbuf_size)
+               hubbub->funcs->program_compbuf_size(hubbub, context->bw_ctx.bw.dcn.compbuf_size_kb, true);
+
        dc->clk_mgr->funcs->update_clocks(
                        dc->clk_mgr,
                        context,
@@ -2033,9 +2037,6 @@ void dcn20_optimize_bandwidth(
                                                pipe_ctx->dlg_regs.optimized_min_dst_y_next_start);
                }
        }
-       /* increase compbuf size */
-       if (hubbub->funcs->program_compbuf_size)
-               hubbub->funcs->program_compbuf_size(hubbub, context->bw_ctx.bw.dcn.compbuf_size_kb, true);
 }
 
 bool dcn20_update_bandwidth(