[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123000537.2450496-1-someguy@effective-light.com>
Date: Thu, 22 Jan 2026 19:05:27 -0500
From: Hamza Mahfooz <someguy@...ective-light.com>
To: dri-devel@...ts.freedesktop.org
Cc: Hamza Mahfooz <someguy@...ective-light.com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <siqueira@...lia.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Sunil Khatri <sunil.khatri@....com>,
Ce Sun <cesun102@....com>,
Lijo Lazar <lijo.lazar@....com>,
Kenneth Feng <kenneth.feng@....com>,
Ivan Lipski <ivan.lipski@....com>,
Alex Hung <alex.hung@....com>,
Tom Chung <chiahsuan.chung@....com>,
Melissa Wen <mwen@...lia.com>,
Michel Dänzer <mdaenzer@...hat.com>,
Fangzhi Zuo <Jerry.Zuo@....com>,
Timur Kristóf <timur.kristof@...il.com>,
amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] drm: introduce page_flip_timeout()
There should be a mechanism for drivers to respond to flip_done
time outs. Since, as it stands it is possible for the display
to stall indefinitely, necessitating a hard reset. So, introduce
a new crtc callback that is called by
drm_atomic_helper_wait_for_flip_done() to give drivers a shot
at recovering from page flip timeouts.
Signed-off-by: Hamza Mahfooz <someguy@...ective-light.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
include/drm/drm_crtc.h | 9 +++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5840e9cc6f66..3a144c324b19 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1881,9 +1881,13 @@ void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev,
continue;
ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
- if (ret == 0)
+ if (!ret) {
drm_err(dev, "[CRTC:%d:%s] flip_done timed out\n",
crtc->base.id, crtc->name);
+
+ if (crtc->funcs->page_flip_timeout)
+ crtc->funcs->page_flip_timeout(crtc);
+ }
}
if (state->fake_commit)
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 66278ffeebd6..45dc5a76e915 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -609,6 +609,15 @@ struct drm_crtc_funcs {
uint32_t flags, uint32_t target,
struct drm_modeset_acquire_ctx *ctx);
+ /**
+ * @page_flip_timeout:
+ *
+ * This optional hook is called if &drm_crtc_commit.flip_done times out,
+ * and can be used by drivers to attempt to recover from a page flip
+ * timeout.
+ */
+ void (*page_flip_timeout)(struct drm_crtc *crtc);
+
/**
* @set_property:
*
--
2.52.0
Powered by blists - more mailing lists