Skip to contentSkip to conversation

amdgpu: fix compressed buffer config routine waiting time

RFC In review Antonio Quartulli 2 participants 4 messages May 19 – Jun 1

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 amdgpu: fix compressed buffer config routine waiting time

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.")
Suggested-by Giuseppe Ranieri
---
 .../gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c +4 -4
index 3c298192f3596..9dc1db4524500 100644
@@ -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
Signature · 1 line
2.53.0
#1 lore raw

AMD General

Hi Antonio,

Thanks for the patch. We'll add it to our weekly cycle for testing.

--

Regards,
Jay
________________________________
From: Antonio Quartulli <[email protected]>
Sent: Tuesday, May 19, 2026 10:45 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Leung, Martin <[email protected]>; Pinninti, Bhuvana Chandra <[email protected]>; Pillai, Aurabindo <[email protected]>; Ahmed, Muhammad <[email protected]>; Chen, Karen <[email protected]>; Chen, Leo <[email protected]>; Khachatrian, Gaghik <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Kazlauskas, Nicholas <[email protected]>; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>
Subject: [RFC] amdgpu: fix compressed buffer config routine waiting time

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.")
Suggested-by Giuseppe Ranieri
---
 .../gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/hubbub/dcn31/dcn31_hubbub.c +4 -4
index 3c298192f3596..9dc1db4524500 100644
@@ -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

#2 lore raw
Quoted 5 lines · Aurabindo

AMD General

Hi Antonio,

Thanks for the patch. We'll add it to our weekly cycle for testing.

Hi there,

just checking if this RFC had a chance to be considered. If there is anything I can do on my side, please let me know.

As of now the only option for many users is to patch the kernel manually, because otherwise the video is basically unstable.

Thanks a lot!
Best Regards,

Signature · 5 lines
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com
#3 lore raw
Quoted 9 lines · Antonio Quartulli

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/ LearnAboutSenderIdentification ]

Quoted 5 lines · Aurabindo

AMD General

Hi Antonio,

Thanks for the patch. We'll add it to our weekly cycle for testing.

Quoted 7 lines

Hi there,

just checking if this RFC had a chance to be considered. If there is anything I can do on my side, please let me know.

As of now the only option for many users is to patch the kernel manually, because otherwise the video is basically unstable.

Thanks for the patch. We'll add it to this week's testing candidates.

Quoted 13 lines

Thanks a lot!
Best Regards,

Signature · 5 lines
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com