All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: add module param to disable immediate vblank off
@ 2026-02-11  7:45 Michele Palazzi
  2026-02-11  9:19 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Michele Palazzi @ 2026-02-11  7:45 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	mario.limonciello, Rodrigo.Siqueira, alex.hung, aurabindo.pillai,
	stable, Michele Palazzi

Add amdgpu.no_vblank_immediate parameter to optionally disable the
immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
a 2-frame offdelay is used instead, matching the behavior used for
older hardware and DGPUs.

This works around flip_done timeouts and GPU hangs that some users
experience with the immediate vblank disable path, particularly with
DisplayPort connections. The default behavior is unchanged.

This is a temporary workaround, to be removed once the underlying
vblank/DM locking issue is properly resolved.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3787
Signed-off-by: Michele Palazzi <sysdadmin@m1k.cloud>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h             |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c         | 16 ++++++++++++++++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   | 17 ++++++++++++++---
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index b20a06abb65d..5de60af8c5f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -213,6 +213,7 @@ extern uint amdgpu_dc_visual_confirm;
 extern int amdgpu_dm_abm_level;
 extern int amdgpu_backlight;
 extern int amdgpu_damage_clips;
+extern int amdgpu_no_vblank_immediate;
 extern struct amdgpu_mgpu_info mgpu_info;
 extern int amdgpu_ras_enable;
 extern uint amdgpu_ras_mask;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 39387da8586b..94cab76805ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -924,6 +924,22 @@ MODULE_PARM_DESC(damageclips,
 		 "Damage clips support (0 = disable, 1 = enable, -1 auto (default))");
 module_param_named(damageclips, amdgpu_damage_clips, int, 0444);
 
+/**
+ * DOC: no_vblank_immediate (int)
+ * Disable immediate vblank disable on DCN35+ non-PSR CRTCs. Use a 2-frame
+ * offdelay instead, matching the behavior used for older hardware and DGPUs.
+ * This works around flip_done timeouts that cause GPU hangs on some hardware
+ * with DisplayPort connections.
+ * (0 = use default immediate disable (default), 1 = use 2-frame offdelay)
+ *
+ * This is a temporary workaround and should be removed once the underlying
+ * vblank/DM locking issue is resolved.
+ */
+int amdgpu_no_vblank_immediate;
+MODULE_PARM_DESC(no_vblank_immediate,
+	"Disable immediate vblank off on DCN35+ (0 = default, 1 = use 2-frame offdelay)");
+module_param_named(no_vblank_immediate, amdgpu_no_vblank_immediate, int, 0444);
+
 /**
  * DOC: tmz (int)
  * Trusted Memory Zone (TMZ) is a method to protect data being written
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a8a59126b2d2..e18ad3949826 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9335,9 +9335,20 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
 
 			config.offdelay_ms = offdelay ?: 30;
 		} else {
-			/* offdelay_ms = 0 will never disable vblank */
-			config.offdelay_ms = 1;
-			config.disable_immediate = true;
+			if (amdgpu_no_vblank_immediate) {
+				/*
+				 * Use 2-frame offdelay instead of immediate
+				 * disable to work around flip_done timeouts.
+				 */
+				offdelay = DIV64_U64_ROUND_UP((u64)20 *
+							      timing->v_total *
+							      timing->h_total,
+							      timing->pix_clk_100hz);
+				config.offdelay_ms = offdelay ?: 30;
+			} else {
+				config.offdelay_ms = 1;
+				config.disable_immediate = true;
+			}
 		}
 
 		drm_crtc_vblank_on_config(&acrtc->base,
-- 
2.53.0


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

* Re: [PATCH] drm/amd/display: add module param to disable immediate vblank off
  2026-02-11  7:45 [PATCH] drm/amd/display: add module param to disable immediate vblank off Michele Palazzi
@ 2026-02-11  9:19 ` Greg KH
  2026-02-11  9:51   ` Michele Palazzi
  2026-02-11 10:07   ` Christian König
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2026-02-11  9:19 UTC (permalink / raw)
  To: Michele Palazzi
  Cc: amd-gfx, dri-devel, harry.wentland, sunpeng.li, alexander.deucher,
	christian.koenig, mario.limonciello, Rodrigo.Siqueira, alex.hung,
	aurabindo.pillai, stable

On Wed, Feb 11, 2026 at 08:45:29AM +0100, Michele Palazzi wrote:
> Add amdgpu.no_vblank_immediate parameter to optionally disable the
> immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
> a 2-frame offdelay is used instead, matching the behavior used for
> older hardware and DGPUs.

Please no more module parameters, this is not the 1990's with only one
one device in the system.  Please fix this the proper way.

Also, this isn't the correct way to submit patches to stable.

thanks,

greg k-h

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

* Re: [PATCH] drm/amd/display: add module param to disable immediate vblank off
  2026-02-11  9:19 ` Greg KH
@ 2026-02-11  9:51   ` Michele Palazzi
  2026-02-11 10:07   ` Christian König
  1 sibling, 0 replies; 6+ messages in thread
From: Michele Palazzi @ 2026-02-11  9:51 UTC (permalink / raw)
  To: Greg KH
  Cc: amd-gfx, dri-devel, harry.wentland, sunpeng.li, alexander.deucher,
	christian.koenig, mario.limonciello, Rodrigo.Siqueira, alex.hung,
	aurabindo.pillai, stable

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

Thanks for the feedback. The AMD display subsystem developer had agreed 
to this approach as a temporary workaround while the underlying locking 
fix is being developed, but I understand the policy against new module 
parameters. I'll defer to the AMD team to submit the proper fix.

Apologies for the incorrect stable process - first time submitting upstream

On 2/11/26 10:19, Greg KH wrote:
> On Wed, Feb 11, 2026 at 08:45:29AM +0100, Michele Palazzi wrote:
>> Add amdgpu.no_vblank_immediate parameter to optionally disable the
>> immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
>> a 2-frame offdelay is used instead, matching the behavior used for
>> older hardware and DGPUs.
> Please no more module parameters, this is not the 1990's with only one
> one device in the system.  Please fix this the proper way.
>
> Also, this isn't the correct way to submit patches to stable.
>
> thanks,
>
> greg k-h

[-- Attachment #2: Type: text/html, Size: 1533 bytes --]

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

* Re: [PATCH] drm/amd/display: add module param to disable immediate vblank off
  2026-02-11  9:19 ` Greg KH
  2026-02-11  9:51   ` Michele Palazzi
@ 2026-02-11 10:07   ` Christian König
  2026-02-11 15:04     ` Mario Limonciello
  2026-02-12 10:20     ` Michel Dänzer
  1 sibling, 2 replies; 6+ messages in thread
From: Christian König @ 2026-02-11 10:07 UTC (permalink / raw)
  To: Michele Palazzi
  Cc: amd-gfx, dri-devel, harry.wentland, sunpeng.li, alexander.deucher,
	mario.limonciello, Rodrigo.Siqueira, alex.hung, aurabindo.pillai

Dropping stable, putting Grep on BCC.

On 2/11/26 10:19, Greg KH wrote:
> On Wed, Feb 11, 2026 at 08:45:29AM +0100, Michele Palazzi wrote:
>> Add amdgpu.no_vblank_immediate parameter to optionally disable the
>> immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
>> a 2-frame offdelay is used instead, matching the behavior used for
>> older hardware and DGPUs.
> 
> Please no more module parameters, this is not the 1990's with only one
> one device in the system.  Please fix this the proper way.

I just wanted to write the same.

We can of course implement something in DAL/DC, but clearly not behind a module parameter.

Or is there any other negative consequence except for that the display blanking is delayed by ~40ms?

Regards,
Christian.

> Also, this isn't the correct way to submit patches to stable.
> 
> thanks,
> 
> greg k-h


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

* Re: [PATCH] drm/amd/display: add module param to disable immediate vblank off
  2026-02-11 10:07   ` Christian König
@ 2026-02-11 15:04     ` Mario Limonciello
  2026-02-12 10:20     ` Michel Dänzer
  1 sibling, 0 replies; 6+ messages in thread
From: Mario Limonciello @ 2026-02-11 15:04 UTC (permalink / raw)
  To: Christian König, Michele Palazzi
  Cc: amd-gfx, dri-devel, harry.wentland, sunpeng.li, alexander.deucher,
	Rodrigo.Siqueira, alex.hung, aurabindo.pillai

On 2/11/26 4:07 AM, Christian König wrote:
> Dropping stable, putting Grep on BCC.
> 
> On 2/11/26 10:19, Greg KH wrote:
>> On Wed, Feb 11, 2026 at 08:45:29AM +0100, Michele Palazzi wrote:
>>> Add amdgpu.no_vblank_immediate parameter to optionally disable the
>>> immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
>>> a 2-frame offdelay is used instead, matching the behavior used for
>>> older hardware and DGPUs.
>>
>> Please no more module parameters, this is not the 1990's with only one
>> one device in the system.  Please fix this the proper way.
> 
> I just wanted to write the same.
> 
> We can of course implement something in DAL/DC, but clearly not behind a module parameter.
> 
> Or is there any other negative consequence except for that the display blanking is delayed by ~40ms?
> 

If there is a strong enough interest in keeping something like this as a 
debugging mechanism, there is already an amdgpu.dcdebugmask parameter. 
This accepts a bitmask of debug bits.  Assign this functionality to a 
new bit.

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

* Re: [PATCH] drm/amd/display: add module param to disable immediate vblank off
  2026-02-11 10:07   ` Christian König
  2026-02-11 15:04     ` Mario Limonciello
@ 2026-02-12 10:20     ` Michel Dänzer
  1 sibling, 0 replies; 6+ messages in thread
From: Michel Dänzer @ 2026-02-12 10:20 UTC (permalink / raw)
  To: Christian König, Michele Palazzi
  Cc: amd-gfx, dri-devel, harry.wentland, sunpeng.li, alexander.deucher,
	mario.limonciello, Rodrigo.Siqueira, alex.hung, aurabindo.pillai

On 2/11/26 11:07, Christian König wrote:
> Dropping stable, putting Grep on BCC.
> 
> On 2/11/26 10:19, Greg KH wrote:
>> On Wed, Feb 11, 2026 at 08:45:29AM +0100, Michele Palazzi wrote:
>>> Add amdgpu.no_vblank_immediate parameter to optionally disable the
>>> immediate vblank disable path on DCN35+ non-PSR CRTCs. When set to 1,
>>> a 2-frame offdelay is used instead, matching the behavior used for
>>> older hardware and DGPUs.
>>
>> Please no more module parameters, this is not the 1990's with only one
>> one device in the system.  Please fix this the proper way.
> 
> I just wanted to write the same.
> 
> We can of course implement something in DAL/DC, but clearly not behind a module parameter.
> 
> Or is there any other negative consequence except for that the display blanking is delayed by ~40ms?

It doesn't affect display blanking, only how long the vblank interrupt stays enabled. (If it stays enabled unnecessarily, that might waste some energy)


-- 
Earthling Michel Dänzer       \        GNOME / Xwayland / Mesa developer
https://redhat.com             \               Libre software enthusiast

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

end of thread, other threads:[~2026-02-12 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11  7:45 [PATCH] drm/amd/display: add module param to disable immediate vblank off Michele Palazzi
2026-02-11  9:19 ` Greg KH
2026-02-11  9:51   ` Michele Palazzi
2026-02-11 10:07   ` Christian König
2026-02-11 15:04     ` Mario Limonciello
2026-02-12 10:20     ` Michel Dänzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.