mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] amdgpu: fix compressed buffer config routine waiting time
@ 2026-05-19 14:45 Antonio Quartulli
       [not found] ` <CH0PR12MB52849BD9E94D9290EFB51B528B002@CH0PR12MB5284.namprd12.prod.outlook.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2026-05-19 14:45 UTC (permalink / raw)
  To: amd-gfx
  Cc: antonio, linux-kernel, dri-devel, martin.leung, bpinnint,
	aurabindo.pillai, Muhammad.Ahmed, Karen.Chen, leo.chen,
	gaghik.khachatrian, roman.li, wayne.lin, nicholas.kazlauskas,
	christian.koenig, alexander.deucher, siqueira, simona, airlied,
	sunpeng.li, harry.wentland

Starting with commit 592c5b80110d5 ("drm/amd/display: Migrate HUBBUB register access from hwseq to hubbub component.")
the amdgpu driver is reporting the following WARNING in the kernel log
during boot time:

[   15.464476] amdgpu 0000:0c:00.0: [drm] REG_WAIT timeout 1us * 100 tries - dcn31_program_compbuf_size line:141
[   15.464522] ------------[ cut here ]------------
[   15.464523] !(generic_reg_get(hubbub2->base.ctx, hubbub2->regs->DCHUBBUB_COMPBUF_CTRL, hubbub2->shifts->CONFIG_ERROR, hubbub2->masks->CONFIG_ERROR, &compbuf_size_segments) && !compbuf_size_segments)
[   15.464524] WARNING: drivers/gpu/drm/amd/amdgpu/../display/dc/hubbub/dcn31/dcn31_hubbub.c:151 at dcn31_program_compbuf_size+0x20e/0x220 [amdgpu], CPU#2: kworker/2:2/184
[   15.464906] Workqueue: events drm_mode_rmfb_work_fn
[   15.464910] RIP: 0010:dcn31_program_compbuf_size+0x20e/0x220 [amdgpu]
[   15.465200]  <TASK>
[   15.465202]  dcn20_optimize_bandwidth+0x110/0x210 [amdgpu]
[   15.465556]  dc_commit_state_no_check+0x14ff/0x18a0 [amdgpu]
[   15.465925]  dc_commit_streams+0x471/0x640 [amdgpu]
[   15.466252]  amdgpu_dm_atomic_commit_tail+0x903/0x4430 [amdgpu]
[   15.467401]  commit_tail+0x242/0x2e0
[   15.467405]  drm_atomic_helper_commit+0x28b/0x2a0
[   15.467407]  drm_atomic_commit+0xc3/0xf0
[   15.467416]  drm_mode_rmfb_work_fn+0x85/0xb0
[   15.467436]  ret_from_fork_asm+0x1a/0x30
[   15.467441]  </TASK>

After boot this results in unstable video output, specifically after
resuming from screen sleep. The video may not come back at all
or may come up partly messed up.

This problem seems to affect various people on AMD iGPU, as discussed
on the related GitHub issue.

Giuseppe Ranieri digged up the issue and suggested the proposed code
change.

There was also a previous report on the amd-gfx ml (see related link below)
but it got nowhere.

By looking at the offending commit I am not truly able to understand why
it is breaking. Hence I am posting this patch as RFC only.

What I can say is that this fix has been solid on my platform running
7.1.0-rc3 with this patch.

I am on:
Gigabyte Technology Co., Ltd. B850M DS3H/B850M DS3H + AMD Ryzen 9 9950X

Fixes: 592c5b80110d5 ("drm/amd/display: Migrate HUBBUB register access from hwseq to hubbub component.")
Link: https://github.com/CachyOS/linux-cachyos/issues/810
Link: https://lore.kernel.org/amd-gfx/20260316094232.6bb6f0bf@schienar/
Suggested-by: Giuseppe Ranieri
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
 .../gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c b/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c
index 3c298192f3596..9dc1db4524500 100644
--- a/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c
@@ -138,10 +138,10 @@ static void dcn31_program_compbuf_size(struct hubbub *hubbub, unsigned int compb
 
 	if (safe_to_increase || compbuf_size_segments <= hubbub2->compbuf_size_segments) {
 		if (compbuf_size_segments > hubbub2->compbuf_size_segments) {
-			REG_WAIT(DCHUBBUB_DET0_CTRL, DET0_SIZE_CURRENT, hubbub2->det0_size, 1, 100);
-			REG_WAIT(DCHUBBUB_DET1_CTRL, DET1_SIZE_CURRENT, hubbub2->det1_size, 1, 100);
-			REG_WAIT(DCHUBBUB_DET2_CTRL, DET2_SIZE_CURRENT, hubbub2->det2_size, 1, 100);
-			REG_WAIT(DCHUBBUB_DET3_CTRL, DET3_SIZE_CURRENT, hubbub2->det3_size, 1, 100);
+			dcn31_wait_for_det_apply(hubbub, 0);
+			dcn31_wait_for_det_apply(hubbub, 1);
+			dcn31_wait_for_det_apply(hubbub, 2);
+			dcn31_wait_for_det_apply(hubbub, 3);
 		}
 		/* Should never be hit, if it is we have an erroneous hw config*/
 		ASSERT(hubbub2->det0_size + hubbub2->det1_size + hubbub2->det2_size
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-01 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19 14:45 [RFC] amdgpu: fix compressed buffer config routine waiting time Antonio Quartulli
     [not found] ` <CH0PR12MB52849BD9E94D9290EFB51B528B002@CH0PR12MB5284.namprd12.prod.outlook.com>
2026-05-31 20:40   ` Antonio Quartulli
2026-06-01 18:41     ` Aurabindo Pillai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®