Hi
Am 06.11.26 um 09:28 schrieb Liang, Prike:
AMD General
Regards,
Prike
-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Thursday, November 5, 2026 11:04 PM
To: Liang, Prike <[email protected]>; [email protected]; dri-
[email protected]
Cc: David Airlie <[email protected]>; Wentland, Harry
<[email protected]>; Li, Sun peng (Leo) <[email protected]>;
Deucher, Alexander <[email protected]>; Koenig, Christian
<[email protected]>
Subject: Re: [PATCH] drm/client: Don't warn when a client's VBLANK wait times
out
Hi
Am 04.11.26 um 03:41 schrieb Prike Liang:
drm_client_modeset_wait_for_vblank() only rate-limits fbdev damage
updates and serves FBIO_WAITFORVSYNC, but it waits with
drm_crtc_wait_one_vblank(), which warns if no VBLANK arrives in time.
VBLANK interrupts can stop while the fbdev client keeps running. Since
commit ebc3351cc4a9 ("drm/amdgpu: remove suspend/resume DRM clients
during GPU recovery"), amdgpu no longer suspends DRM clients for GPU
recovery, as that made recovery wait for clientlist_mutex, the console
Isn't that rather a bug in amdgpu?
Hi Thomas,
Yes, it is a trade-off solution. While the vblank interrupt is disabled during
GPU reset, suspending the DRM clients blocks on waits that cause
lock-order problems with the reset. Not suspending them avoids those
problems, but then the fbdev damage worker's vblank wait times out.
I'll look into whether this can be fixed in amdgpu instead, by
stopping vblank waits once the display core has disabled the vblank
interrupts.
What does user space do in the case of a GPU reset? Ideally, we'd do
something similar for kernel clients.
We could make waiting for the vblank [1] interruptible in some way.
[1]
https://elixir.bootlin.com/linux/v7.3.1/source/drivers/gpu/drm/drm_vblank.c#L1325
Best regards
Thomas
Thanks,
Prike
Best regards
Thomas
lock and the damage worker, whose holders can depend on fences that
only signal after the reset. The display is still shut down for the
reset, so the damage worker now times out and warns:
amdgpu 0000:03:00.0: [drm] vblank wait timed out on crtc 0
WARNING: drivers/gpu/drm/drm_vblank.c:1320 at
drm_crtc_wait_one_vblank+0x194/0x200
Workqueue: events drm_fb_helper_damage_work
Call Trace:
drm_client_modeset_wait_for_vblank+0x63/0x80
drm_fb_helper_damage_work+0x89/0x1a0
Userspace can trigger the same warning with FBIO_WAITFORVSYNC. Wait on
the VBLANK queue with the same timeout, but log a debug message
instead of warning when it expires; a missed VBLANK only means the
update isn't synchronized.
Fixes: d8c4bddcd8bc ("drm/fb-helper: Synchronize dirty worker with
vblank")
Signed-off-by: Prike Liang <[email protected]>
Cc: David Airlie <[email protected]>
Cc: [email protected]
Cc: Harry Wentland <[email protected]>
Cc: Leo Li <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
---
drivers/gpu/drm/drm_client_modeset.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_client_modeset.c
b/drivers/gpu/drm/drm_client_modeset.c
index 0080a8e9556a..7b3193d73bbf 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -1301,7 +1301,8 @@ EXPORT_SYMBOL(drm_client_modeset_dpms);
*
* Block the caller until the given CRTC has seen a VBLANK. Do nothing
* if the CRTC is disabled. If there's another DRM master present,
fail
- * with -EBUSY.
+ * with -EBUSY. Give up without a warning if no VBLANK arrives within
+ a
+ * second, e.g. while the driver resets the display hardware.
*
* Returns:
* 0 on success, or negative error code otherwise.
@@ -1328,7 +1329,14 @@ int drm_client_modeset_wait_for_vblank(struct
drm_client_dev *client, unsigned i
*/
ret = drm_crtc_vblank_get(crtc);
if (!ret) {
- drm_crtc_wait_one_vblank(crtc);
+ u64 last = drm_crtc_vblank_count(crtc);
+
+ /* Unlike drm_crtc_wait_one_vblank(), don't warn if VBLANKs stop. */
+ if (!wait_event_timeout(*drm_crtc_vblank_waitqueue(crtc),
+ drm_crtc_vblank_count(crtc) != last,
+ msecs_to_jiffies(1000)))
+ drm_dbg_vbl(dev, "[CRTC:%d:%s] vblank wait timed out\n",
+ crtc->base.id, crtc->name);
drm_crtc_vblank_put(crtc);
}
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)