Skip to content

Commit f5e8f7a

Browse files
Dmytro Laktyushkingregkh
authored andcommitted
drm/amd/display: set per pipe dppclk to 0 when dpp is off
commit 6609141 upstream. The 'commit 52e4fdf09ebc ("drm/amd/display: use low clocks for no plane configs")' introduced a change that set low clock values for DCN31 and DCN32. As a result of these changes, DC started to spam the log with the following warning: ------------[ cut here ]------------ WARNING: CPU: 8 PID: 1486 at drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dccg.c:58 dccg2_update_dpp_dto+0x3f/0xf0 [amdgpu] [..] CPU: 8 PID: 1486 Comm: kms_atomic Tainted: G W 5.18.0+ #1 RIP: 0010:dccg2_update_dpp_dto+0x3f/0xf0 [amdgpu] RSP: 0018:ffffbbd8025334d0 EFLAGS: 00010206 RAX: 00000000000001ee RBX: ffffa02c87dd3de0 RCX: 00000000000a7f80 RDX: 000000000007dec3 RSI: 0000000000000000 RDI: ffffa02c87dd3de0 RBP: ffffbbd8025334e8 R08: 0000000000000001 R09: 0000000000000005 R10: 00000000000331a0 R11: ffffffffc0b03d80 R12: ffffa02ca576d000 R13: ffffa02cd02c0000 R14: 00000000001453bc R15: ffffa02cdc280000 [..] dcn20_update_clocks_update_dpp_dto+0x4e/0xa0 [amdgpu] dcn32_update_clocks+0x5d9/0x650 [amdgpu] dcn20_prepare_bandwidth+0x49/0x100 [amdgpu] dcn30_prepare_bandwidth+0x63/0x80 [amdgpu] dc_commit_state_no_check+0x39d/0x13e0 [amdgpu] dc_commit_streams+0x1f9/0x3b0 [amdgpu] dc_commit_state+0x37/0x120 [amdgpu] amdgpu_dm_atomic_commit_tail+0x5e5/0x2520 [amdgpu] ? _raw_spin_unlock_irqrestore+0x1f/0x40 ? down_trylock+0x2c/0x40 ? vprintk_emit+0x186/0x2c0 ? vprintk_default+0x1d/0x20 ? vprintk+0x4e/0x60 We can easily trigger this issue by using a 4k@120 or a 2k@165 and running some of the kms_atomic tests. This warning is triggered because the per-pipe clock update is not happening; this commit fixes this issue by ensuring that DPPCLK is updated when calculating the watermark and dlg is invoked. Fixes: 2641c7b ("drm/amd/display: use low clocks for no plane configs") Reported-by: Mark Broadworth <[email protected]> Reviewed-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Dmytro Laktyushkin <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 73679f8 commit f5e8f7a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ void dcn31_calculate_wm_and_dlg_fp(
559559
context->bw_ctx.bw.dcn.clk.dramclk_khz = 0;
560560
context->bw_ctx.bw.dcn.clk.fclk_khz = 0;
561561
context->bw_ctx.bw.dcn.clk.p_state_change_support = true;
562+
for (i = 0; i < dc->res_pool->pipe_count; i++)
563+
if (context->res_ctx.pipe_ctx[i].stream)
564+
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz = 0;
562565
}
563566
for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) {
564567
if (!context->res_ctx.pipe_ctx[i].stream)

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,10 @@ static void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context,
13051305

13061306
if (context->bw_ctx.bw.dcn.clk.dppclk_khz < pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000)
13071307
context->bw_ctx.bw.dcn.clk.dppclk_khz = pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
1308-
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz = pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
1308+
if (context->res_ctx.pipe_ctx[i].plane_state)
1309+
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz = pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000;
1310+
else
1311+
context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz = 0;
13091312
context->res_ctx.pipe_ctx[i].pipe_dlg_param = pipes[pipe_idx].pipe.dest;
13101313
pipe_idx++;
13111314
}

0 commit comments

Comments
 (0)