Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion
@ 2026-11-16  9:11 Ville Syrjala
  2026-11-16  9:11 ` [PATCH 01/12] drm/atomic: Remove tall tales about tearing vs. "async updates" Ville Syrjala
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The weird uapi semantics of the atomic async flip support make it
really hard for drivers to implement. Try to fix that by filtering
out the no-op junk from the commit that userspace likes to put there.

Also a lot of people are apparently confusing the
.atomic_async_{update,check}() hack with async flips. The two
are completely orthogonal, so try to clear up that mess by
renaming the hack to .atomic_bypass_{update,check}().

TODO: atomic+async is in serious need to proper tests, somehow
      all that seems to have gotten skipped when the feature
      was added :(

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>

Ville Syrjälä (12):
  drm/atomic: Remove tall tales about tearing vs. "async updates"
  drm/atomic: s/async/bypass/
  drm/atomic: Add FIXMEs around the incorrect use of the
    .atomic_bypass_check() for async flips
  drm/atomic: Highlight that bypass commits need care
  drm/atomic/uapi: Eliminate the confusing
    drm_atomic_check_prop_changes()
  drm/atomic/uapi: Improve the async flip property rejection debugs
  drm/atomic/uapi: Document the non-obvious fence/fb_id prop behaviour
  drm/atomic/uapi: Add a FIXME about colorop vs. async flips
  drm/atomic-helper: Mark drm_atomic_crtc_state_for_each_plane_state()
    unsafe
  drm/i915: Complete no-op "async flips" by hand
  drm/atomic/uapi: Make async flips a bit more palatable through atomic
  drm/atomic/uapi: Extract {connector,crtc,plane}_async_flip_check()

 .clang-format                                 |   2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  12 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |  20 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.h   |   6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_trace.h   |  16 +-
 .../amdgpu_dm/tests/amdgpu_dm_plane_test.c    |  32 +--
 drivers/gpu/drm/arm/malidp_crtc.c             |   6 +-
 drivers/gpu/drm/drm_atomic.c                  |  97 ++++++++
 drivers/gpu/drm/drm_atomic_helper.c           |  49 ++---
 drivers/gpu/drm/drm_atomic_uapi.c             | 208 ++++++++++++++----
 drivers/gpu/drm/drm_crtc_internal.h           |   9 +
 drivers/gpu/drm/drm_self_refresh_helper.c     |   4 +-
 drivers/gpu/drm/i915/display/i9xx_wm.c        |   2 +-
 drivers/gpu/drm/i915/display/intel_display.c  |  38 ++++
 drivers/gpu/drm/i915/display/intel_display.h  |   4 +-
 drivers/gpu/drm/loongson/lsdc_plane.c         |  18 +-
 drivers/gpu/drm/mediatek/mtk_plane.c          |  12 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |   2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |   2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c    |  12 +-
 drivers/gpu/drm/msm/msm_atomic.c              |   2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c   |  12 +-
 drivers/gpu/drm/tegra/dc.c                    |  18 +-
 drivers/gpu/drm/vc4/vc4_hvs.c                 |   2 +-
 drivers/gpu/drm/vc4/vc4_plane.c               |  16 +-
 include/drm/drm_atomic.h                      |  10 +-
 include/drm/drm_atomic_helper.h               |  20 +-
 include/drm/drm_modeset_helper_vtables.h      |  50 +++--
 29 files changed, 482 insertions(+), 201 deletions(-)

-- 
2.56.0


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

* [PATCH 01/12] drm/atomic: Remove tall tales about tearing vs. "async updates"
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 02/12] drm/atomic: s/async/bypass/ Ville Syrjala
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The "async update" stuff has nothing to do with async vs.
sync updates as far as the hardware is concerned (as in
tearing vs. not). What it does is bypass the normal commit
machinery and just let the driver directly perform the
update (as it sees fit) and swap the plane state without
involving the whole crtc commit machinery.

The actual hardware update it does could be an async flip
(as in tearing) or a mailbox flip, depending on how the
driver decides to do it.

I also suspect some drivers abusing this for async flips might
be performing mailbox updates under the hood, which is
very broken because the commits complete in completely random
order and userspace has no idea when the hardware has stopped
scanning out from the old framebuffer. That means userspace
thinks it can start rendering new stuff to what is still the
current hardware scanout buffer. That will lead to incomplete
live rendering appearing on the screen, which is never OK.
Effectively one is performing front buffer rendering at that
point. This kind of fake async flip implementation would
immediately fail igt/kms_async_flips/crc, but that test
requires the driver/hardware to have working CRC support.
To make mailbox updates actually correct we would need
out fences, and a mechanism to signal them in the correct
order.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c      | 9 ++++-----
 include/drm/drm_modeset_helper_vtables.h | 6 ++----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ccfe3840d505..f81eb29d9ac8 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2187,11 +2187,10 @@ EXPORT_SYMBOL(drm_atomic_helper_async_check);
  * @dev: DRM device
  * @state: the driver state object
  *
- * This function commits a state asynchronously, i.e., not vblank
- * synchronized. It should be used on a state only when
- * drm_atomic_async_check() succeeds. Async commits are not supposed to swap
- * the states like normal sync commits, but just do in-place changes on the
- * current state.
+ * This function commits a state asynchronously. It should be used on a state
+ * only when drm_atomic_async_check() succeeds. Async commits are not supposed
+ * to swap the states like normal sync commits, but just do in-place changes
+ * on the current state.
  *
  * TODO: Implement full swap instead of doing in-place changes.
  */
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index 60b30cc26940..c2431c08a60a 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1424,8 +1424,7 @@ struct drm_plane_helper_funcs {
 	 * @atomic_async_check:
 	 *
 	 * Drivers should set this function pointer to check if the plane's
-	 * atomic state can be updated in a async fashion. Here async means
-	 * "not vblank synchronized".
+	 * atomic state can be updated in a async fashion.
 	 *
 	 * This hook is called by drm_atomic_async_check() to establish if a
 	 * given update can be committed asynchronously, that is, if it can
@@ -1449,8 +1448,7 @@ struct drm_plane_helper_funcs {
 	 *
 	 * Drivers should set this function pointer to perform asynchronous
 	 * updates of planes, that is, jump ahead of the currently queued
-	 * state and update the plane. Here async means "not vblank
-	 * synchronized".
+	 * state and update the plane.
 	 *
 	 * This hook is called by drm_atomic_helper_async_commit().
 	 *
-- 
2.56.0


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

* [PATCH 02/12] drm/atomic: s/async/bypass/
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
  2026-11-16  9:11 ` [PATCH 01/12] drm/atomic: Remove tall tales about tearing vs. "async updates" Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 03/12] drm/atomic: Add FIXMEs around the incorrect use of the .atomic_bypass_check() for async flips Ville Syrjala
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The "async update" stuff has nothing to do with async vs.
sync updates as far as the hardware is concerned (as in
tearing vs. not). What it does is bypass the normal commit
machinery and just let the driver directly perform the
update (as it sees fit) and swap the plane state without
involving the whole crtc commit machinery.

The actual hardware update it does could be an async flip
(as in tearing) or a mailbox flip, depending on how the
driver decides to do it.

Rename the framework to talk about "bypass updates" rather
than "async updates" to avoid confusion.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 20 ++++----
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.h   |  6 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_trace.h   | 16 +++----
 .../amdgpu_dm/tests/amdgpu_dm_plane_test.c    | 32 ++++++-------
 drivers/gpu/drm/drm_atomic_helper.c           | 48 +++++++++----------
 drivers/gpu/drm/drm_atomic_uapi.c             |  4 +-
 drivers/gpu/drm/drm_self_refresh_helper.c     |  4 +-
 drivers/gpu/drm/loongson/lsdc_plane.c         | 18 +++----
 drivers/gpu/drm/mediatek/mtk_plane.c          | 12 ++---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c    | 12 ++---
 drivers/gpu/drm/msm/msm_atomic.c              |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c   | 12 ++---
 drivers/gpu/drm/tegra/dc.c                    | 12 ++---
 drivers/gpu/drm/vc4/vc4_plane.c               | 16 +++----
 include/drm/drm_atomic.h                      |  4 +-
 include/drm/drm_atomic_helper.h               |  8 ++--
 include/drm/drm_modeset_helper_vtables.h      | 38 +++++++--------
 18 files changed, 138 insertions(+), 138 deletions(-)

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 94d45e5d2a3b..d43ca823e905 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6581,20 +6581,20 @@ STATIC_IFN_KUNIT int amdgpu_dm_atomic_check(struct drm_device *dev,
 	if (state->legacy_cursor_update) {
 		/*
 		 * This is a fast cursor update coming from the plane update
-		 * helper, check if it can be done asynchronously for better
-		 * performance.
+		 * helper, check if it can be bypass the atomic machinery
+		 * for better performance.
 		 */
-		state->async_update =
-			!drm_atomic_helper_async_check(dev, state);
+		state->bypass_update =
+			!drm_atomic_helper_bypass_check(dev, state);
 
 		/*
-		 * Skip the remaining global validation if this is an async
+		 * Skip the remaining global validation if this is a bypass
 		 * update. Cursor updates can be done without affecting
 		 * state or bandwidth calcs and this avoids the performance
 		 * penalty of locking the private state object and
 		 * allocating a new dc_state.
 		 */
-		if (state->async_update)
+		if (state->bypass_update)
 			return 0;
 	}
 
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index b224d9596fd2..0936594c651c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1565,8 +1565,8 @@ STATIC_IFN_KUNIT int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
 }
 EXPORT_IF_KUNIT(amdgpu_dm_plane_atomic_check);
 
-STATIC_IFN_KUNIT int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
-							struct drm_atomic_commit *state, bool flip)
+STATIC_IFN_KUNIT int amdgpu_dm_plane_atomic_bypass_check(struct drm_plane *plane,
+							 struct drm_atomic_commit *state, bool flip)
 {
 	struct drm_crtc_state *new_crtc_state;
 	struct drm_plane_state *new_plane_state;
@@ -1588,7 +1588,7 @@ STATIC_IFN_KUNIT int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
 
 	return 0;
 }
-EXPORT_IF_KUNIT(amdgpu_dm_plane_atomic_async_check);
+EXPORT_IF_KUNIT(amdgpu_dm_plane_atomic_bypass_check);
 
 int amdgpu_dm_plane_get_cursor_position(struct drm_plane *plane, struct drm_crtc *crtc,
 					struct dc_cursor_position *position)
@@ -1725,8 +1725,8 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
 }
 EXPORT_IF_KUNIT(amdgpu_dm_plane_handle_cursor_update);
 
-STATIC_IFN_KUNIT void amdgpu_dm_plane_atomic_async_update(struct drm_plane *plane,
-							  struct drm_atomic_commit *state)
+STATIC_IFN_KUNIT void amdgpu_dm_plane_atomic_bypass_update(struct drm_plane *plane,
+							   struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
 									   plane);
@@ -1748,7 +1748,7 @@ STATIC_IFN_KUNIT void amdgpu_dm_plane_atomic_async_update(struct drm_plane *plan
 
 	amdgpu_dm_plane_handle_cursor_update(plane, old_state);
 }
-EXPORT_IF_KUNIT(amdgpu_dm_plane_atomic_async_update);
+EXPORT_IF_KUNIT(amdgpu_dm_plane_atomic_bypass_update);
 
 STATIC_IFN_KUNIT void amdgpu_dm_plane_panic_flush(struct drm_plane *plane)
 {
@@ -1769,16 +1769,16 @@ static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
 	.prepare_fb = amdgpu_dm_plane_helper_prepare_fb,
 	.cleanup_fb = amdgpu_dm_plane_helper_cleanup_fb,
 	.atomic_check = amdgpu_dm_plane_atomic_check,
-	.atomic_async_check = amdgpu_dm_plane_atomic_async_check,
-	.atomic_async_update = amdgpu_dm_plane_atomic_async_update
+	.atomic_bypass_check = amdgpu_dm_plane_atomic_bypass_check,
+	.atomic_bypass_update = amdgpu_dm_plane_atomic_bypass_update
 };
 
 static const struct drm_plane_helper_funcs dm_primary_plane_helper_funcs = {
 	.prepare_fb = amdgpu_dm_plane_helper_prepare_fb,
 	.cleanup_fb = amdgpu_dm_plane_helper_cleanup_fb,
 	.atomic_check = amdgpu_dm_plane_atomic_check,
-	.atomic_async_check = amdgpu_dm_plane_atomic_async_check,
-	.atomic_async_update = amdgpu_dm_plane_atomic_async_update,
+	.atomic_bypass_check = amdgpu_dm_plane_atomic_bypass_check,
+	.atomic_bypass_update = amdgpu_dm_plane_atomic_bypass_update,
 	.get_scanout_buffer = amdgpu_display_get_scanout_buffer,
 	.panic_flush = amdgpu_dm_plane_panic_flush,
 };
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
index a432aad41b8f..7e85195d42fb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h
@@ -112,8 +112,8 @@ void amdgpu_dm_plane_get_min_max_dc_plane_scaling(struct drm_device *dev,
 						  struct drm_framebuffer *fb,
 						  int *min_downscale,
 						  int *max_upscale);
-int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
-				       struct drm_atomic_commit *state, bool flip);
+int amdgpu_dm_plane_atomic_bypass_check(struct drm_plane *plane,
+					struct drm_atomic_commit *state, bool flip);
 int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
 				 struct drm_atomic_commit *state);
 void amdgpu_dm_plane_panic_flush(struct drm_plane *plane);
@@ -136,6 +136,6 @@ bool amdgpu_dm_plane_gfx6_format_mod_supported(const struct amdgpu_device *adev,
 					       const u64 modifier);
 int amdgpu_dm_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state);
 void amdgpu_dm_plane_helper_cleanup_fb(struct drm_plane *plane, struct drm_plane_state *old_state);
-void amdgpu_dm_plane_atomic_async_update(struct drm_plane *plane, struct drm_atomic_commit *state);
+void amdgpu_dm_plane_atomic_bypass_update(struct drm_plane *plane, struct drm_atomic_commit *state);
 #endif
 #endif
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 9027933cec3f..b075cabfaaf5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -316,7 +316,7 @@ DECLARE_EVENT_CLASS(amdgpu_dm_atomic_state_template,
 		    TP_STRUCT__entry(__field(const struct drm_atomic_commit *, state)
 				     __field(bool, allow_modeset)
 				     __field(bool, legacy_cursor_update)
-				     __field(bool, async_update)
+				     __field(bool, bypass_update)
 				     __field(bool, duplicated)
 				     __field(int, num_connector)
 				     __field(int, num_private_objs)
@@ -324,16 +324,16 @@ DECLARE_EVENT_CLASS(amdgpu_dm_atomic_state_template,
 		    TP_fast_assign(__entry->state = state;
 				   __entry->allow_modeset = state->allow_modeset;
 				   __entry->legacy_cursor_update = state->legacy_cursor_update;
-				   __entry->async_update = state->async_update;
+				   __entry->bypass_update = state->bypass_update;
 				   __entry->duplicated = state->duplicated;
 				   __entry->num_connector = state->num_connector;
 				   __entry->num_private_objs = state->num_private_objs;
 		    ),
 		    TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
-			      "async_update=%d duplicated=%d num_connector=%d "
+			      "bypass_update=%d duplicated=%d num_connector=%d "
 			      "num_private_objs=%d",
 			      __entry->state, __entry->allow_modeset,
-			      __entry->legacy_cursor_update, __entry->async_update,
+			      __entry->legacy_cursor_update, __entry->bypass_update,
 			      __entry->duplicated, __entry->num_connector,
 			      __entry->num_private_objs)
 );
@@ -357,20 +357,20 @@ TRACE_EVENT(amdgpu_dm_atomic_check_finish,
 	    TP_STRUCT__entry(
 			     __field(const struct drm_atomic_commit *, state)
 			     __field(int, res)
-			     __field(bool, async_update)
+			     __field(bool, bypass_update)
 			     __field(bool, allow_modeset)
 	    ),
 
 	    TP_fast_assign(
 			   __entry->state = state;
 			   __entry->res = res;
-			   __entry->async_update = state->async_update;
+			   __entry->bypass_update = state->bypass_update;
 			   __entry->allow_modeset = state->allow_modeset;
 	    ),
 
-	    TP_printk("state=%p res=%d async_update=%d allow_modeset=%d",
+	    TP_printk("state=%p res=%d bypass_update=%d allow_modeset=%d",
 		      __entry->state, __entry->res,
-		      __entry->async_update, __entry->allow_modeset)
+		      __entry->bypass_update, __entry->allow_modeset)
 );
 
 TRACE_EVENT(amdgpu_dm_dc_pipe_state,
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
index 1f5ee7a0d741..d6b00aeade3b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_plane_test.c
@@ -1936,13 +1936,13 @@ static void dm_test_format_mod_supported_d_swizzle_reject(struct kunit *test)
 }
 
 /**
- * dm_test_atomic_async_check_rejects() - Verify async check rejections.
+ * dm_test_atomic_bypass_check_rejects() - Verify async check rejections.
  * @test: KUnit test context.
  *
  * Verify if async flip on non-overlay planes and async cursor update on
  * non-cursor planes are rejected.
  */
-static void dm_test_atomic_async_check_rejects(struct kunit *test)
+static void dm_test_atomic_bypass_check_rejects(struct kunit *test)
 {
 	struct drm_plane *plane;
 
@@ -1951,21 +1951,21 @@ static void dm_test_atomic_async_check_rejects(struct kunit *test)
 
 	plane->type = DRM_PLANE_TYPE_PRIMARY;
 	KUNIT_EXPECT_EQ(test,
-			amdgpu_dm_plane_atomic_async_check(plane, NULL, true),
+			amdgpu_dm_plane_atomic_bypass_check(plane, NULL, true),
 			-EINVAL);
 	KUNIT_EXPECT_EQ(test,
-			amdgpu_dm_plane_atomic_async_check(plane, NULL, false),
+			amdgpu_dm_plane_atomic_bypass_check(plane, NULL, false),
 			-EINVAL);
 }
 
 /**
- * dm_test_atomic_async_check_overlay_cursor() - Verify overlay cursor rejection.
+ * dm_test_atomic_bypass_check_overlay_cursor() - Verify overlay cursor rejection.
  * @test: KUnit test context.
  *
  * Verify if async cursor updates are rejected while the CRTC is using an
  * overlay cursor mode.
  */
-static void dm_test_atomic_async_check_overlay_cursor(struct kunit *test)
+static void dm_test_atomic_bypass_check_overlay_cursor(struct kunit *test)
 {
 	struct drm_atomic_commit *state;
 	struct __drm_planes_state *planes;
@@ -2001,12 +2001,12 @@ static void dm_test_atomic_async_check_overlay_cursor(struct kunit *test)
 	state->crtcs[0].new_state = &dm_crtc_state->base;
 
 	KUNIT_EXPECT_EQ(test,
-			amdgpu_dm_plane_atomic_async_check(plane, state, false),
+			amdgpu_dm_plane_atomic_bypass_check(plane, state, false),
 			-EINVAL);
 
 	dm_crtc_state->cursor_mode = DM_CURSOR_NATIVE_MODE;
 	KUNIT_EXPECT_EQ(test,
-			amdgpu_dm_plane_atomic_async_check(plane, state, false),
+			amdgpu_dm_plane_atomic_bypass_check(plane, state, false),
 			0);
 }
 
@@ -2878,13 +2878,13 @@ static void dm_test_handle_cursor_update_no_fb(struct kunit *test)
 }
 
 /**
- * dm_test_atomic_async_update_copies_state() - Verify async cursor state copy.
+ * dm_test_atomic_bypass_update_copies_state() - Verify async cursor state copy.
  * @test: KUnit test context.
  *
  * Verify if the async update swaps the framebuffer and copies the source and
  * CRTC rectangles from the new state into the current plane state.
  */
-static void dm_test_atomic_async_update_copies_state(struct kunit *test)
+static void dm_test_atomic_bypass_update_copies_state(struct kunit *test)
 {
 	struct amdgpu_device *adev;
 	struct drm_atomic_commit *state;
@@ -2928,7 +2928,7 @@ static void dm_test_atomic_async_update_copies_state(struct kunit *test)
 	state->planes[0].new_state = new_state;
 	state->planes[0].old_state = old_state;
 
-	amdgpu_dm_plane_atomic_async_update(plane, state);
+	amdgpu_dm_plane_atomic_bypass_update(plane, state);
 
 	KUNIT_EXPECT_PTR_EQ(test, cur_state->fb, NULL);
 	KUNIT_EXPECT_PTR_EQ(test, new_state->fb, &afb->base);
@@ -3294,11 +3294,11 @@ static struct kunit_case amdgpu_dm_plane_test_cases[] = {
 	KUNIT_CASE(dm_test_handle_cursor_update_no_fb),
 	KUNIT_CASE(dm_test_handle_cursor_update_disabled),
 	KUNIT_CASE(dm_test_handle_cursor_update_no_stream),
-	/* amdgpu_dm_plane_atomic_async_update() */
-	KUNIT_CASE(dm_test_atomic_async_update_copies_state),
-	/* amdgpu_dm_plane_atomic_async_check() */
-	KUNIT_CASE(dm_test_atomic_async_check_rejects),
-	KUNIT_CASE(dm_test_atomic_async_check_overlay_cursor),
+	/* amdgpu_dm_plane_atomic_bypass_update() */
+	KUNIT_CASE(dm_test_atomic_bypass_update_copies_state),
+	/* amdgpu_dm_plane_atomic_bypass_check() */
+	KUNIT_CASE(dm_test_atomic_bypass_check_rejects),
+	KUNIT_CASE(dm_test_atomic_bypass_check_overlay_cursor),
 	/* amdgpu_dm_plane_atomic_check() */
 	KUNIT_CASE(dm_test_atomic_check_no_dc_state),
 	KUNIT_CASE(dm_test_atomic_check_missing_crtc_state),
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index f81eb29d9ac8..4e6dade4fb39 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1130,7 +1130,7 @@ int drm_atomic_helper_check(struct drm_device *dev,
 		return ret;
 
 	if (state->legacy_cursor_update)
-		state->async_update = !drm_atomic_helper_async_check(dev, state);
+		state->bypass_update = !drm_atomic_helper_bypass_check(dev, state);
 
 	drm_self_refresh_helper_alter_state(state);
 
@@ -2099,7 +2099,7 @@ static void commit_work(struct work_struct *work)
 }
 
 /**
- * drm_atomic_helper_async_check - check if state can be committed asynchronously
+ * drm_atomic_helper_bypass_check - check if state can be committed bypassing the normal commit tracking
  * @dev: DRM device
  * @state: the driver state object
  *
@@ -2111,7 +2111,7 @@ static void commit_work(struct work_struct *work)
  * if not. Note that error just mean it can't be committed asynchronously, if it
  * fails the commit should be treated like a normal synchronous commit.
  */
-int drm_atomic_helper_async_check(struct drm_device *dev,
+int drm_atomic_helper_bypass_check(struct drm_device *dev,
 				   struct drm_atomic_commit *state)
 {
 	struct drm_crtc *crtc;
@@ -2146,56 +2146,56 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
 	}
 
 	funcs = plane->helper_private;
-	if (!funcs->atomic_async_update) {
+	if (!funcs->atomic_bypass_update) {
 		drm_dbg_atomic(dev,
-			       "[PLANE:%d:%s] driver does not support async updates\n",
+			       "[PLANE:%d:%s] driver does not support bypass updates\n",
 			       plane->base.id, plane->name);
 		return -EINVAL;
 	}
 
 	if (new_plane_state->fence) {
 		drm_dbg_atomic(dev,
-			       "[PLANE:%d:%s] missing fence for async update\n",
+			       "[PLANE:%d:%s] missing fence for bypass update\n",
 			       plane->base.id, plane->name);
 		return -EINVAL;
 	}
 
 	/*
 	 * Don't do an async update if there is an outstanding commit modifying
-	 * the plane.  This prevents our async update's changes from getting
-	 * overridden by a previous synchronous update's state.
+	 * the plane.  This prevents our bypass update's changes from getting
+	 * overridden by a previous normal update's state.
 	 */
 	if (old_plane_state->commit &&
 	    !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
 		drm_dbg_atomic(dev,
-			       "[PLANE:%d:%s] inflight previous commit preventing async commit\n",
+			       "[PLANE:%d:%s] inflight previous commit preventing bypass commit\n",
 			       plane->base.id, plane->name);
 		return -EBUSY;
 	}
 
-	ret = funcs->atomic_async_check(plane, state, false);
+	ret = funcs->atomic_bypass_check(plane, state, false);
 	if (ret != 0)
 		drm_dbg_atomic(dev,
-			       "[PLANE:%d:%s] driver async check failed\n",
+			       "[PLANE:%d:%s] driver bypass check failed\n",
 			       plane->base.id, plane->name);
 	return ret;
 }
-EXPORT_SYMBOL(drm_atomic_helper_async_check);
+EXPORT_SYMBOL(drm_atomic_helper_bypass_check);
 
 /**
- * drm_atomic_helper_async_commit - commit state asynchronously
+ * drm_atomic_helper_bypass_commit - commit state asynchronously bypassing normal commit tracking
  * @dev: DRM device
  * @state: the driver state object
  *
- * This function commits a state asynchronously. It should be used on a state
- * only when drm_atomic_async_check() succeeds. Async commits are not supposed
- * to swap the states like normal sync commits, but just do in-place changes
- * on the current state.
+ * This function commits a state asynchronously bypassing the normal commit
+ * tracking. It should be used on a state only when drm_atomic_bypass_check()
+ * succeeds. Bypass commits are not supposed to swap the states like normal
+ * commits, but just do in-place changes on the current state.
  *
  * TODO: Implement full swap instead of doing in-place changes.
  */
-void drm_atomic_helper_async_commit(struct drm_device *dev,
-				    struct drm_atomic_commit *state)
+void drm_atomic_helper_bypass_commit(struct drm_device *dev,
+				     struct drm_atomic_commit *state)
 {
 	struct drm_plane *plane;
 	struct drm_plane_state *plane_state;
@@ -2207,10 +2207,10 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
 		struct drm_framebuffer *old_fb = plane->state->fb;
 
 		funcs = plane->helper_private;
-		funcs->atomic_async_update(plane, state);
+		funcs->atomic_bypass_update(plane, state);
 
 		/*
-		 * ->atomic_async_update() is supposed to update the
+		 * ->atomic_bypass_update() is supposed to update the
 		 * plane->state in-place, make sure at least common
 		 * properties have been properly updated.
 		 */
@@ -2227,7 +2227,7 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
 		WARN_ON_ONCE(plane_state->fb != old_fb);
 	}
 }
-EXPORT_SYMBOL(drm_atomic_helper_async_commit);
+EXPORT_SYMBOL(drm_atomic_helper_bypass_commit);
 
 /**
  * drm_atomic_helper_commit - commit validated state object
@@ -2253,12 +2253,12 @@ int drm_atomic_helper_commit(struct drm_device *dev,
 {
 	int ret;
 
-	if (state->async_update) {
+	if (state->bypass_update) {
 		ret = drm_atomic_helper_prepare_planes(dev, state);
 		if (ret)
 			return ret;
 
-		drm_atomic_helper_async_commit(dev, state);
+		drm_atomic_helper_bypass_commit(dev, state);
 		drm_atomic_helper_unprepare_planes(dev, state);
 
 		return 0;
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 1eebcf6f5e05..04fcaa72c46f 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1292,8 +1292,8 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 
 			if (ret && plane->type != DRM_PLANE_TYPE_PRIMARY) {
 				/* ask the driver if this non-primary plane is supported */
-				if (plane_funcs && plane_funcs->atomic_async_check)
-					ret = plane_funcs->atomic_async_check(plane, state, true);
+				if (plane_funcs && plane_funcs->atomic_bypass_check)
+					ret = plane_funcs->atomic_bypass_check(plane, state, true);
 
 				if (ret) {
 					drm_dbg_atomic(prop->dev,
diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c
index 37ec7fb00f03..9cc7f0526df5 100644
--- a/drivers/gpu/drm/drm_self_refresh_helper.c
+++ b/drivers/gpu/drm/drm_self_refresh_helper.c
@@ -191,10 +191,10 @@ void drm_self_refresh_helper_alter_state(struct drm_atomic_commit *state)
 	struct drm_crtc_state *crtc_state;
 	int i;
 
-	if (state->async_update || !state->allow_modeset) {
+	if (state->bypass_update || !state->allow_modeset) {
 		for_each_old_crtc_in_state(state, crtc, crtc_state, i) {
 			if (crtc_state->self_refresh_active) {
-				state->async_update = false;
+				state->bypass_update = false;
 				state->allow_modeset = true;
 				break;
 			}
diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
index c425288ba490..59f85072273a 100644
--- a/drivers/gpu/drm/loongson/lsdc_plane.c
+++ b/drivers/gpu/drm/loongson/lsdc_plane.c
@@ -172,9 +172,9 @@ static const struct drm_plane_helper_funcs lsdc_primary_helper_funcs = {
 	.atomic_disable = lsdc_primary_atomic_disable,
 };
 
-static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
-						struct drm_atomic_commit *state,
-						bool flip)
+static int lsdc_cursor_plane_atomic_bypass_check(struct drm_plane *plane,
+						 struct drm_atomic_commit *state,
+						 bool flip)
 {
 	struct drm_plane_state *new_state;
 	struct drm_crtc_state *crtc_state;
@@ -219,8 +219,8 @@ static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
 						   true, true);
 }
 
-static void lsdc_cursor_plane_atomic_async_update(struct drm_plane *plane,
-						  struct drm_atomic_commit *state)
+static void lsdc_cursor_plane_atomic_bypass_update(struct drm_plane *plane,
+						   struct drm_atomic_commit *state)
 {
 	struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
 	const struct lsdc_cursor_plane_ops *ops = cursor->ops;
@@ -335,8 +335,8 @@ static const struct drm_plane_helper_funcs ls7a1000_cursor_plane_helper_funcs =
 	.atomic_check = ls7a1000_cursor_plane_atomic_check,
 	.atomic_update = ls7a1000_cursor_plane_atomic_update,
 	.atomic_disable = ls7a1000_cursor_plane_atomic_disable,
-	.atomic_async_check = lsdc_cursor_plane_atomic_async_check,
-	.atomic_async_update = lsdc_cursor_plane_atomic_async_update,
+	.atomic_bypass_check = lsdc_cursor_plane_atomic_bypass_check,
+	.atomic_bypass_update = lsdc_cursor_plane_atomic_bypass_update,
 };
 
 /* ls7a2000 cursor plane helpers */
@@ -431,8 +431,8 @@ static const struct drm_plane_helper_funcs ls7a2000_cursor_plane_helper_funcs =
 	.atomic_check = ls7a2000_cursor_plane_atomic_check,
 	.atomic_update = ls7a2000_cursor_plane_atomic_update,
 	.atomic_disable = ls7a2000_cursor_plane_atomic_disable,
-	.atomic_async_check = lsdc_cursor_plane_atomic_async_check,
-	.atomic_async_update = lsdc_cursor_plane_atomic_async_update,
+	.atomic_bypass_check = lsdc_cursor_plane_atomic_bypass_check,
+	.atomic_bypass_update = lsdc_cursor_plane_atomic_bypass_update,
 };
 
 static void lsdc_plane_atomic_print_state(struct drm_printer *p,
diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
index 3fad7f2ff004..18d22ab35184 100644
--- a/drivers/gpu/drm/mediatek/mtk_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_plane.c
@@ -74,8 +74,8 @@ static void mtk_plane_destroy_state(struct drm_plane *plane,
 	kfree(to_mtk_plane_state(state));
 }
 
-static int mtk_plane_atomic_async_check(struct drm_plane *plane,
-					struct drm_atomic_commit *state, bool flip)
+static int mtk_plane_atomic_bypass_check(struct drm_plane *plane,
+					 struct drm_atomic_commit *state, bool flip)
 {
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
 										 plane);
@@ -187,8 +187,8 @@ static void mtk_plane_update_new_state(struct drm_plane_state *new_state,
 	mtk_plane_state->pending.color_encoding = new_state->color_encoding;
 }
 
-static void mtk_plane_atomic_async_update(struct drm_plane *plane,
-					  struct drm_atomic_commit *state)
+static void mtk_plane_atomic_bypass_update(struct drm_plane *plane,
+					   struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
 									   plane);
@@ -295,8 +295,8 @@ static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
 	.atomic_check = mtk_plane_atomic_check,
 	.atomic_update = mtk_plane_atomic_update,
 	.atomic_disable = mtk_plane_atomic_disable,
-	.atomic_async_update = mtk_plane_atomic_async_update,
-	.atomic_async_check = mtk_plane_atomic_async_check,
+	.atomic_bypass_update = mtk_plane_atomic_bypass_update,
+	.atomic_bypass_check = mtk_plane_atomic_bypass_check,
 };
 
 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index 7e878c698247..55ef62999484 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -358,8 +358,8 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane,
 	}
 }
 
-static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
-					 struct drm_atomic_commit *state, bool flip)
+static int mdp5_plane_atomic_bypass_check(struct drm_plane *plane,
+					  struct drm_atomic_commit *state, bool flip)
 {
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
 										 plane);
@@ -412,8 +412,8 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
 	return 0;
 }
 
-static void mdp5_plane_atomic_async_update(struct drm_plane *plane,
-					   struct drm_atomic_commit *state)
+static void mdp5_plane_atomic_bypass_update(struct drm_plane *plane,
+					    struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
 									   plane);
@@ -450,8 +450,8 @@ static const struct drm_plane_helper_funcs mdp5_plane_helper_funcs = {
 		.cleanup_fb = mdp5_plane_cleanup_fb,
 		.atomic_check = mdp5_plane_atomic_check,
 		.atomic_update = mdp5_plane_atomic_update,
-		.atomic_async_check = mdp5_plane_atomic_async_check,
-		.atomic_async_update = mdp5_plane_atomic_async_update,
+		.atomic_bypass_check = mdp5_plane_atomic_bypass_check,
+		.atomic_bypass_update = mdp5_plane_atomic_bypass_update,
 };
 
 static void set_scanout_locked(struct mdp5_kms *mdp5_kms,
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index a8babf1dbe0d..030f479b2246 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -145,7 +145,7 @@ static bool can_do_async(struct drm_atomic_commit *state,
 	struct drm_crtc *crtc;
 	int i, num_crtcs = 0;
 
-	if (!(state->legacy_cursor_update || state->async_update))
+	if (!(state->legacy_cursor_update || state->bypass_update))
 		return false;
 
 	/* any connector change, means slow path: */
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 69e72727da24..dd768f9c8934 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1070,8 +1070,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
 	spin_unlock(&vop->reg_lock);
 }
 
-static int vop_plane_atomic_async_check(struct drm_plane *plane,
-					struct drm_atomic_commit *state, bool flip)
+static int vop_plane_atomic_bypass_check(struct drm_plane *plane,
+					 struct drm_atomic_commit *state, bool flip)
 {
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
 										 plane);
@@ -1104,8 +1104,8 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane,
 						   true, true);
 }
 
-static void vop_plane_atomic_async_update(struct drm_plane *plane,
-					  struct drm_atomic_commit *state)
+static void vop_plane_atomic_bypass_update(struct drm_plane *plane,
+					   struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
 									   plane);
@@ -1149,8 +1149,8 @@ static const struct drm_plane_helper_funcs plane_helper_funcs = {
 	.atomic_check = vop_plane_atomic_check,
 	.atomic_update = vop_plane_atomic_update,
 	.atomic_disable = vop_plane_atomic_disable,
-	.atomic_async_check = vop_plane_atomic_async_check,
-	.atomic_async_update = vop_plane_atomic_async_update,
+	.atomic_bypass_check = vop_plane_atomic_bypass_check,
+	.atomic_bypass_update = vop_plane_atomic_bypass_update,
 };
 
 static const struct drm_plane_funcs vop_plane_funcs = {
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index c9df14544ced..9cd6399b85bb 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1127,8 +1127,8 @@ static void tegra_cursor_atomic_disable(struct drm_plane *plane,
 	tegra_dc_writel(dc, value, DC_DISP_DISP_WIN_OPTIONS);
 }
 
-static int tegra_cursor_atomic_async_check(struct drm_plane *plane, struct drm_atomic_commit *state,
-					   bool flip)
+static int tegra_cursor_atomic_bypass_check(struct drm_plane *plane, struct drm_atomic_commit *state,
+					    bool flip)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
 	struct drm_crtc_state *crtc_state;
@@ -1165,8 +1165,8 @@ static int tegra_cursor_atomic_async_check(struct drm_plane *plane, struct drm_a
 	return 0;
 }
 
-static void tegra_cursor_atomic_async_update(struct drm_plane *plane,
-					     struct drm_atomic_commit *state)
+static void tegra_cursor_atomic_bypass_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
 	struct tegra_dc *dc = to_tegra_dc(new_state->crtc);
@@ -1198,8 +1198,8 @@ static const struct drm_plane_helper_funcs tegra_cursor_plane_helper_funcs = {
 	.atomic_check = tegra_cursor_atomic_check,
 	.atomic_update = tegra_cursor_atomic_update,
 	.atomic_disable = tegra_cursor_atomic_disable,
-	.atomic_async_check = tegra_cursor_atomic_async_check,
-	.atomic_async_update = tegra_cursor_atomic_async_update,
+	.atomic_bypass_check = tegra_cursor_atomic_bypass_check,
+	.atomic_bypass_update = tegra_cursor_atomic_bypass_update,
 };
 
 static const uint64_t linear_modifiers[] = {
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 20c9fc9283a8..c90b9921a617 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -2257,8 +2257,8 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
 	drm_dev_exit(idx);
 }
 
-static void vc4_plane_atomic_async_update(struct drm_plane *plane,
-					  struct drm_atomic_commit *state)
+static void vc4_plane_atomic_bypass_update(struct drm_plane *plane,
+					   struct drm_atomic_commit *state)
 {
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
 										 plane);
@@ -2331,8 +2331,8 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane,
 	drm_dev_exit(idx);
 }
 
-static int vc4_plane_atomic_async_check(struct drm_plane *plane,
-					struct drm_atomic_commit *state, bool flip)
+static int vc4_plane_atomic_bypass_check(struct drm_plane *plane,
+					 struct drm_atomic_commit *state, bool flip)
 {
 	struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
 	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
@@ -2414,15 +2414,15 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
 	.atomic_update = vc4_plane_atomic_update,
 	.prepare_fb = vc4_prepare_fb,
 	.cleanup_fb = vc4_cleanup_fb,
-	.atomic_async_check = vc4_plane_atomic_async_check,
-	.atomic_async_update = vc4_plane_atomic_async_update,
+	.atomic_bypass_check = vc4_plane_atomic_bypass_check,
+	.atomic_bypass_update = vc4_plane_atomic_bypass_update,
 };
 
 static const struct drm_plane_helper_funcs vc5_plane_helper_funcs = {
 	.atomic_check = vc4_plane_atomic_check,
 	.atomic_update = vc4_plane_atomic_update,
-	.atomic_async_check = vc4_plane_atomic_async_check,
-	.atomic_async_update = vc4_plane_atomic_async_update,
+	.atomic_bypass_check = vc4_plane_atomic_bypass_check,
+	.atomic_bypass_update = vc4_plane_atomic_bypass_update,
 };
 
 static bool vc4_format_mod_supported(struct drm_plane *plane,
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 3ae35b09c0cf..f60a77ad9b9b 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -551,9 +551,9 @@ struct drm_atomic_commit {
 	bool legacy_cursor_update : 1;
 
 	/**
-	 * @async_update: hint for asynchronous plane update
+	 * @bypass_update: hint for bypass plane update
 	 */
-	bool async_update : 1;
+	bool bypass_update : 1;
 
 	/**
 	 * @duplicated:
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 4cfeec70d648..278560760e6e 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -73,10 +73,10 @@ void drm_atomic_helper_commit_tail_rpm(struct drm_atomic_commit *state);
 int drm_atomic_helper_commit(struct drm_device *dev,
 			     struct drm_atomic_commit *state,
 			     bool nonblock);
-int drm_atomic_helper_async_check(struct drm_device *dev,
-				  struct drm_atomic_commit *state);
-void drm_atomic_helper_async_commit(struct drm_device *dev,
-				    struct drm_atomic_commit *state);
+int drm_atomic_helper_bypass_check(struct drm_device *dev,
+				   struct drm_atomic_commit *state);
+void drm_atomic_helper_bypass_commit(struct drm_device *dev,
+				     struct drm_atomic_commit *state);
 
 int drm_atomic_helper_wait_for_fences(struct drm_device *dev,
 					struct drm_atomic_commit *state,
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index c2431c08a60a..cc511068f53a 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1237,7 +1237,7 @@ struct drm_plane_helper_funcs {
 	 * VRAM. Other possible preparatory work includes flushing caches.
 	 *
 	 * This function must not block for outstanding rendering, since it is
-	 * called in the context of the atomic IOCTL even for async commits to
+	 * called in the context of the atomic IOCTL even for bypass commits to
 	 * be able to return any errors to userspace. Instead the recommended
 	 * way is to fill out the &drm_plane_state.fence of the passed-in
 	 * &drm_plane_state. If the driver doesn't support native fences then
@@ -1421,14 +1421,14 @@ struct drm_plane_helper_funcs {
 			       struct drm_atomic_commit *state);
 
 	/**
-	 * @atomic_async_check:
+	 * @atomic_bypass_check:
 	 *
 	 * Drivers should set this function pointer to check if the plane's
-	 * atomic state can be updated in a async fashion.
+	 * atomic state can be updated in a bypass fashion.
 	 *
-	 * This hook is called by drm_atomic_async_check() to establish if a
-	 * given update can be committed asynchronously, that is, if it can
-	 * jump ahead of the state currently queued for update.
+	 * This hook is called by drm_atomic_bypass_check() to establish if a
+	 * given update can be committed bypassing the atomic commit machinery.
+	 * That is, if it can jump ahead of the state currently queued for update.
 	 *
 	 * This function is also used by drm_atomic_set_property() to determine
 	 * if the plane can be flipped in async. The flip flag is used to
@@ -1438,35 +1438,35 @@ struct drm_plane_helper_funcs {
 	 * RETURNS:
 	 *
 	 * Return 0 on success and any error returned indicates that the update
-	 * can not be applied in asynchronous manner.
+	 * can not be applied bypassing the normal machinery.
 	 */
-	int (*atomic_async_check)(struct drm_plane *plane,
-				  struct drm_atomic_commit *state, bool flip);
+	int (*atomic_bypass_check)(struct drm_plane *plane,
+				   struct drm_atomic_commit *state, bool flip);
 
 	/**
-	 * @atomic_async_update:
+	 * @atomic_bypass_update:
 	 *
 	 * Drivers should set this function pointer to perform asynchronous
-	 * updates of planes, that is, jump ahead of the currently queued
-	 * state and update the plane.
+	 * updates of planes, bypassing the commit machinery. That is, jump
+	 * ahead of the currently queued state and update the plane.
 	 *
-	 * This hook is called by drm_atomic_helper_async_commit().
+	 * This hook is called by drm_atomic_helper_bypass_commit().
 	 *
-	 * An async update will happen on legacy cursor updates. An async
+	 * A bypass update will happen on legacy cursor updates. A bypass
 	 * update won't happen if there is an outstanding commit modifying
 	 * the same plane.
 	 *
-	 * When doing async_update drivers shouldn't replace the
+	 * When doing bypass_update drivers shouldn't replace the
 	 * &drm_plane_state but update the current one with the new plane
 	 * configurations in the new plane_state.
 	 *
 	 * Drivers should also swap the framebuffers between current plane
 	 * state (&drm_plane.state) and new_state.
-	 * This is required since cleanup for async commits is performed on
+	 * This is required since cleanup for bypass commits is performed on
 	 * the new state, rather than old state like for traditional commits.
 	 * Since we want to give up the reference on the current (old) fb
 	 * instead of our brand new one, swap them in the driver during the
-	 * async commit.
+	 * bypass commit.
 	 *
 	 * FIXME:
 	 *  - It only works for single plane updates
@@ -1476,8 +1476,8 @@ struct drm_plane_helper_funcs {
 	 *    we run this hook. For now drivers must implement their own workers
 	 *    for deferring if needed, until a common solution is created.
 	 */
-	void (*atomic_async_update)(struct drm_plane *plane,
-				    struct drm_atomic_commit *state);
+	void (*atomic_bypass_update)(struct drm_plane *plane,
+				     struct drm_atomic_commit *state);
 
 	/**
 	 * @get_scanout_buffer:
-- 
2.56.0


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

* [PATCH 03/12] drm/atomic: Add FIXMEs around the incorrect use of the .atomic_bypass_check() for async flips
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
  2026-11-16  9:11 ` [PATCH 01/12] drm/atomic: Remove tall tales about tearing vs. "async updates" Ville Syrjala
  2026-11-16  9:11 ` [PATCH 02/12] drm/atomic: s/async/bypass/ Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 04/12] drm/atomic: Highlight that bypass commits need care Ville Syrjala
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The "bypass update" stuff has nothing to do with async vs.
sync updates as far as the hardware is concerned (as in
tearing vs. not). What it does is bypass the normal commit
machinery and just let the driver directly perform the
update (as it sees fit) and swap the plane state without
involving the whole crtc commit machinery.

The actual hardware update it does could be an async flip
(as in tearing) or a mailbox flip, depending on how the
driver decides to do it.

The use of bypass updates vs. not is a driver decision, and
the high level atomic code should not be making incorrect
assumptions about it. Toss in some FIXMEs in the hopes
that people will relocate this stuff to a more appropriate
place.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c        | 6 ++++++
 include/drm/drm_modeset_helper_vtables.h | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 04fcaa72c46f..eb002799497c 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1290,6 +1290,12 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 				break;
 			}
 
+			/*
+			 * FIXME this is in the wrong place. Whether to do a
+			 * bypass commit for async flips would is a driver
+			 * decision. Drivers that want this need to just do
+			 * these checks themselves somewhere.
+			 */
 			if (ret && plane->type != DRM_PLANE_TYPE_PRIMARY) {
 				/* ask the driver if this non-primary plane is supported */
 				if (plane_funcs && plane_funcs->atomic_bypass_check)
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index cc511068f53a..d28d8ffc66b4 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1430,10 +1430,10 @@ struct drm_plane_helper_funcs {
 	 * given update can be committed bypassing the atomic commit machinery.
 	 * That is, if it can jump ahead of the state currently queued for update.
 	 *
-	 * This function is also used by drm_atomic_set_property() to determine
+	 * This function is also abused by drm_atomic_set_property() to determine
 	 * if the plane can be flipped in async. The flip flag is used to
 	 * distinguish if the function is used for just the plane state or for a
-	 * flip.
+	 * flip. FIXME this is wrong, and needs to be moved into the drivers.
 	 *
 	 * RETURNS:
 	 *
-- 
2.56.0


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

* [PATCH 04/12] drm/atomic: Highlight that bypass commits need care
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (2 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 03/12] drm/atomic: Add FIXMEs around the incorrect use of the .atomic_bypass_check() for async flips Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 05/12] drm/atomic/uapi: Eliminate the confusing drm_atomic_check_prop_changes() Ville Syrjala
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Document the fact that implementing bypass commits
need actual care and attention to make sure the
effective commit reordering is actually safe.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 include/drm/drm_modeset_helper_vtables.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index d28d8ffc66b4..1036744b9922 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1430,6 +1430,12 @@ struct drm_plane_helper_funcs {
 	 * given update can be committed bypassing the atomic commit machinery.
 	 * That is, if it can jump ahead of the state currently queued for update.
 	 *
+	 * Extreme care is needed to make this safe as the already queued commits
+	 * will not be aware of the bypass commit that overtook them. And the
+	 * state that the bypass commit will observe is the final already queued
+	 * state, not the current state at the point when the bypass commit
+	 * will actually execute.
+	 *
 	 * This function is also abused by drm_atomic_set_property() to determine
 	 * if the plane can be flipped in async. The flip flag is used to
 	 * distinguish if the function is used for just the plane state or for a
-- 
2.56.0


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

* [PATCH 05/12] drm/atomic/uapi: Eliminate the confusing drm_atomic_check_prop_changes()
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (3 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 04/12] drm/atomic: Highlight that bypass commits need care Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 07/12] drm/atomic/uapi: Document the non-obvious fence/fb_id prop behaviour Ville Syrjala
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

drm_atomic_check_prop_changes() is a very confusing for
many reasons:
- the 'ret' propagation through it is completely non-obvious
- for planes it prints the debug message about rejecting the
  update before we actually decide whether the update needs
  to be rejected or not
- the debug message is also printed if the property doesn't
  exist, which is confusing
- the debug message lacks the KMS object type/ID/name,
  which could be helpful during debugging

Just get rid of the whole drm_atomic_check_prop_changes() and
do things by hand.

Also remove the debug message for the case where the property
doesn't exist as drm_atomic_*_get_property() will already print
its own debug message in that situation.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 51 +++++++++++++++++++------------
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index eb002799497c..2ea03b4b0be9 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1194,19 +1194,6 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_commit *state,
 	return ret;
 }
 
-static int drm_atomic_check_prop_changes(int ret, uint64_t old_val, uint64_t prop_value,
-					 struct drm_property *prop)
-{
-	if (ret != 0 || old_val != prop_value) {
-		drm_dbg_atomic(prop->dev,
-			       "[PROP:%d:%s] No prop can be changed during async flip\n",
-			       prop->base.id, prop->name);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
 int drm_atomic_set_property(struct drm_atomic_commit *state,
 			    struct drm_file *file_priv,
 			    struct drm_mode_object *obj,
@@ -1235,8 +1222,16 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		if (async_flip) {
 			ret = drm_atomic_connector_get_property(connector, connector_state,
 								prop, &old_val);
-			ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
-			break;
+			if (ret)
+				break;
+
+			if (old_val != prop_value) {
+				drm_dbg_atomic(prop->dev,
+					       "[PROP:%d:%s] No prop can be changed during async flip\n",
+					       prop->base.id, prop->name);
+				ret = -EINVAL;
+				break;
+			}
 		}
 
 		ret = drm_atomic_connector_set_property(connector,
@@ -1257,8 +1252,16 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		if (async_flip) {
 			ret = drm_atomic_crtc_get_property(crtc, crtc_state,
 							   prop, &old_val);
-			ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
-			break;
+			if (ret)
+				break;
+
+			if (old_val != prop_value) {
+				drm_dbg_atomic(prop->dev,
+					       "[PROP:%d:%s] No prop can be changed during async flip\n",
+					       prop->base.id, prop->name);
+				ret = -EINVAL;
+				break;
+			}
 		}
 
 		ret = drm_atomic_crtc_set_property(crtc,
@@ -1281,12 +1284,18 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			/* no-op changes are always allowed */
 			ret = drm_atomic_plane_get_property(plane, plane_state,
 							    prop, &old_val);
-			ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
+			if (ret)
+				break;
 
 			/* fail everything that isn't no-op or a pure flip */
-			if (ret && prop != config->prop_fb_id &&
+			if (old_val != prop_value &&
+			    prop != config->prop_fb_id &&
 			    prop != config->prop_in_fence_fd &&
 			    prop != config->prop_fb_damage_clips) {
+				drm_dbg_atomic(prop->dev,
+					       "[PROP:%d:%s] No prop can be changed during async flip\n",
+					       prop->base.id, prop->name);
+				ret = -EINVAL;
 				break;
 			}
 
@@ -1296,10 +1305,12 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			 * decision. Drivers that want this need to just do
 			 * these checks themselves somewhere.
 			 */
-			if (ret && plane->type != DRM_PLANE_TYPE_PRIMARY) {
+			if (old_val != prop_value && plane->type != DRM_PLANE_TYPE_PRIMARY) {
 				/* ask the driver if this non-primary plane is supported */
 				if (plane_funcs && plane_funcs->atomic_bypass_check)
 					ret = plane_funcs->atomic_bypass_check(plane, state, true);
+				else
+					ret = -EINVAL;
 
 				if (ret) {
 					drm_dbg_atomic(prop->dev,
-- 
2.56.0


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

* [PATCH 07/12] drm/atomic/uapi: Document the non-obvious fence/fb_id prop behaviour
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (4 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 05/12] drm/atomic/uapi: Eliminate the confusing drm_atomic_check_prop_changes() Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 08/12] drm/atomic/uapi: Add a FIXME about colorop vs. async flips Ville Syrjala
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The atomic async flip checks want to compare the old vs. new
property values. For normal properties that is all perfectly
clear, but for the fence/fb_id properties the old value is
not what one might expect. Add some notes to remind the reader
what is happening.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index aad71d3e2105..cf1edcb242cc 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1225,6 +1225,11 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			if (ret)
 				break;
 
+			/*
+			 * Note that for WRITEBACK_FB_ID and WRITEBACK_OUT_FENCE_PTR
+			 * the old value will always be 0. So any commit that sets either
+			 * property to any other value will not be considered a no-op.
+			 */
 			if (old_val != prop_value) {
 				drm_dbg_atomic(prop->dev,
 					       "[CONNECTOR:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
@@ -1256,6 +1261,11 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			if (ret)
 				break;
 
+			/*
+			 * Note that for OUT_FENCE_PTR the old value will always be 0.
+			 * So any commit that sets the property to any other value
+			 * will not be considered a no-op.
+			 */
 			if (old_val != prop_value) {
 				drm_dbg_atomic(prop->dev,
 					       "[CRTC:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
@@ -1289,7 +1299,13 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			if (ret)
 				break;
 
-			/* fail everything that isn't no-op or a pure flip */
+			/*
+			 * Fail everything that isn't no-op or a pure flip.
+			 *
+			 * Note that for IN_FENCE_FD the old value will always be -1.
+			 * So any commit that sets the property to any other value
+			 * will not be considered a no-op.
+			 */
 			if (old_val != prop_value &&
 			    prop != config->prop_fb_id &&
 			    prop != config->prop_in_fence_fd &&
-- 
2.56.0


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

* [PATCH 08/12] drm/atomic/uapi: Add a FIXME about colorop vs. async flips
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (5 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 07/12] drm/atomic/uapi: Document the non-obvious fence/fb_id prop behaviour Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 09/12] drm/atomic-helper: Mark drm_atomic_crtc_state_for_each_plane_state() unsafe Ville Syrjala
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The colorop stuff in the atomic ioctl handler is completely
missing any async flip handling. Add a FIXME in the hopes
that someone will fix it.

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index cf1edcb242cc..7517950d2e51 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1352,6 +1352,8 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		struct drm_colorop_state *colorop_state;
 		bool replaced = false;
 
+		/* FIXME async flip checks completely missing here */
+
 		colorop_state = drm_atomic_get_colorop_state(state, colorop);
 		if (IS_ERR(colorop_state)) {
 			ret = PTR_ERR(colorop_state);
-- 
2.56.0


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

* [PATCH 09/12] drm/atomic-helper: Mark drm_atomic_crtc_state_for_each_plane_state() unsafe
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (6 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 08/12] drm/atomic/uapi: Add a FIXME about colorop vs. async flips Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 10/12] drm/i915: Complete no-op "async flips" by hand Ville Syrjala
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, Miguel Ojeda, amd-gfx,
	André Almeida, Boris Brezillon, Christopher Snowhill,
	Dave Stevenson, Dharma Balasubiramani, Dmitry Baryshkov,
	freedreno, Gustavo Padovan, Huacai Chen, Icenowy Zheng,
	Jianmin Lv, linux-arm-msm, linux-mediatek, linux-rockchip,
	linux-tegra, Liviu Dudau, Maíra Canal,
	Manikandan Muralidharan, Maxime Ripard, Mingcong Bai, nouveau,
	Qianhai Wu, Raspberry Pi Kernel Maintenance, Simon Ser,
	wayland-devel, Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

drm_atomic_crtc_state_for_each_plane_state() uses the unsafe
__drm_atomic_get_current_plane_state() under the hood. Mark
it all unsafe and give it a __drm prefix to make it doubly
clear that it's a footgun waiting to happen.

I want the old name for a slightly different (safer) purpose.

Everyone really should stop using this, and find a better
way to do things.

Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .clang-format                                 |  2 +-
 drivers/gpu/drm/arm/malidp_crtc.c             |  6 +++---
 drivers/gpu/drm/i915/display/i9xx_wm.c        |  2 +-
 drivers/gpu/drm/i915/display/intel_display.h  |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c     |  2 +-
 drivers/gpu/drm/tegra/dc.c                    |  6 +++---
 drivers/gpu/drm/vc4/vc4_hvs.c                 |  2 +-
 include/drm/drm_atomic.h                      |  6 +++---
 include/drm/drm_atomic_helper.h               | 12 ++++++++----
 11 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/.clang-format b/.clang-format
index 395292ab2ac6..db707fd6a684 100644
--- a/.clang-format
+++ b/.clang-format
@@ -160,7 +160,7 @@ ForEachMacros:
   - 'do_for_each_ftrace_op'
   - 'drm_atomic_crtc_for_each_plane'
   - 'drm_atomic_crtc_state_for_each_plane'
-  - 'drm_atomic_crtc_state_for_each_plane_state'
+  - '__drm_atomic_crtc_state_for_each_plane_state_unsafe'
   - 'drm_atomic_for_each_plane_damage'
   - 'drm_client_for_each_connector_iter'
   - 'drm_client_for_each_modeset'
diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c
index ec7b9db8b0b4..3c02f7ec92b8 100644
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -268,7 +268,7 @@ static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
 	if (scaling & (scaling - 1))
 		return -EINVAL;
 
-	drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, pstate, state) {
 		struct malidp_plane *mp = to_malidp_plane(plane);
 		u32 phase;
 
@@ -373,7 +373,7 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
 	 */
 
 	/* first count the number of rotated planes */
-	drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, pstate, crtc_state) {
 		struct drm_framebuffer *fb = pstate->fb;
 
 		if ((pstate->rotation & MALIDP_ROTATED_MASK) || fb->modifier)
@@ -389,7 +389,7 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
 		rot_mem_free += hwdev->rotation_memory[1];
 
 	/* now validate the rotation memory requirements */
-	drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, pstate, crtc_state) {
 		struct malidp_plane *mp = to_malidp_plane(plane);
 		struct malidp_plane_state *ms = to_malidp_plane_state(pstate);
 		struct drm_framebuffer *fb = pstate->fb;
diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.c b/drivers/gpu/drm/i915/display/i9xx_wm.c
index 46bfada7c060..efd1791efd5f 100644
--- a/drivers/gpu/drm/i915/display/i9xx_wm.c
+++ b/drivers/gpu/drm/i915/display/i9xx_wm.c
@@ -2931,7 +2931,7 @@ static int ilk_compute_pipe_wm(struct intel_atomic_state *state,
 
 	pipe_wm = &crtc_state->wm.ilk.optimal;
 
-	intel_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
+	__intel_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, crtc_state) {
 		if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)
 			pristate = plane_state;
 		else if (plane->base.type == DRM_PLANE_TYPE_OVERLAY)
diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index d53b7b4a80e7..43701325b3de 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -307,13 +307,13 @@ enum phy_fia {
 		for_each_if(((old_crtc_state) = intel_atomic_get_old_crtc_state((__state), (crtc)), \
 			     (new_crtc_state) = intel_atomic_get_new_crtc_state((__state), (crtc))))
 
-#define intel_atomic_crtc_state_for_each_plane_state( \
+#define __intel_atomic_crtc_state_for_each_plane_state_unsafe( \
 		  plane, plane_state, \
 		  crtc_state) \
 	for_each_intel_plane_mask(((crtc_state)->uapi.state->dev), (plane), \
 				((crtc_state)->uapi.plane_mask)) \
 		for_each_if ((plane_state = \
-			      to_intel_plane_state(__drm_atomic_get_current_plane_state((crtc_state)->uapi.state, &plane->base))))
+			      to_intel_plane_state(__drm_atomic_get_current_plane_state_unsafe((crtc_state)->uapi.state, &plane->base))))
 
 #define for_each_new_intel_connector_in_state(__state, connector, new_connector_state, __i) \
 	for ((__i) = 0; \
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 9fa55904dba1..6f45adb9c7ae 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -65,7 +65,7 @@ static u64 _dpu_core_perf_calc_bw(const struct dpu_perf_cfg *perf_cfg,
 	u64 crtc_plane_bw = 0;
 	u32 bw_factor;
 
-	drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, state)
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, state)
 		crtc_plane_bw += to_dpu_plane_state(plane_state)->plane_fetch_bw;
 
 	bw_factor = perf_cfg->bw_inefficiency_factor;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 77a2d1f6700d..f5cf9cae732e 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1568,7 +1568,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
 	}
 
 	/* FIXME: move this to dpu_plane_atomic_check? */
-	drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, pstate, crtc_state) {
 		struct dpu_plane_state *dpu_pstate = to_dpu_plane_state(pstate);
 
 		if (IS_ERR_OR_NULL(pstate)) {
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
index 1e1fff37380c..df85027b7ee0 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
@@ -711,7 +711,7 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
 
 	DBG("%s: check", crtc->name);
 
-	drm_atomic_crtc_state_for_each_plane_state(plane, pstate, crtc_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, pstate, crtc_state) {
 		struct mdp5_plane_state *mdp5_pstate =
 				to_mdp5_plane_state(pstate);
 
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 9cd6399b85bb..4ce93b2ef300 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2471,7 +2471,7 @@ tegra_plane_overlap_mask(struct drm_crtc_state *state,
 	if (tegra_plane_is_cursor(plane_state))
 		return 0;
 
-	drm_atomic_crtc_state_for_each_plane_state(plane, other_state, state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, other_state, state) {
 		rect = plane_state->dst;
 
 		tegra = to_tegra_plane(other_state->plane);
@@ -2529,7 +2529,7 @@ static int tegra_crtc_calculate_memory_bandwidth(struct drm_crtc *crtc,
 	 * overlap. Note that bitmask[plane] includes BIT(plane) in order
 	 * to make further code nicer and simpler.
 	 */
-	drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, new_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, new_state) {
 		tegra_state = to_const_tegra_plane_state(plane_state);
 		tegra = to_tegra_plane(plane);
 
@@ -2559,7 +2559,7 @@ static int tegra_crtc_calculate_memory_bandwidth(struct drm_crtc *crtc,
 	 * in order to set up latency allowance based on the peak BW, see
 	 * tegra_crtc_update_memory_bandwidth().
 	 */
-	drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, new_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, new_state) {
 		u32 i, old_peak_bw, new_peak_bw, overlap_bw = 0;
 
 		/*
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
index 537aaa992129..abda0309393b 100644
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -806,7 +806,7 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
 	if (hweight32(crtc_state->connector_mask) > 1)
 		return -EINVAL;
 
-	drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) {
+	__drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, crtc_state) {
 		u32 plane_dlist_count = vc4_plane_dlist_size(plane_state);
 
 		drm_dbg_driver(dev, "[CRTC:%d:%s] Found [PLANE:%d:%s] with DLIST size: %u\n",
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index f60a77ad9b9b..b6414229dc8f 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -887,7 +887,7 @@ drm_atomic_get_new_connector_state(const struct drm_atomic_commit *state,
 }
 
 /**
- * __drm_atomic_get_current_plane_state - get current plane state
+ * __drm_atomic_get_current_plane_state_unsafe - get current plane state
  * @state: global atomic state object
  * @plane: plane to grab
  *
@@ -913,8 +913,8 @@ drm_atomic_get_new_connector_state(const struct drm_atomic_commit *state,
  * Read-only pointer to the current plane state.
  */
 static inline const struct drm_plane_state *
-__drm_atomic_get_current_plane_state(const struct drm_atomic_commit *state,
-				     struct drm_plane *plane)
+__drm_atomic_get_current_plane_state_unsafe(const struct drm_atomic_commit *state,
+					    struct drm_plane *plane)
 {
 	struct drm_plane_state *plane_state;
 
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 278560760e6e..06b6dc9bc4be 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -214,7 +214,7 @@ int drm_atomic_helper_page_flip_target(
 	drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask)
 
 /**
- * drm_atomic_crtc_state_for_each_plane_state - iterate over attached planes in new state
+ * __drm_atomic_crtc_state_for_each_plane_state_unsafe - iterate over attached planes in new state
  * @plane: the loop cursor
  * @plane_state: loop cursor for the plane's state, must be const
  * @crtc_state: the incoming CRTC state
@@ -227,12 +227,16 @@ int drm_atomic_helper_page_flip_target(
  * Compared to just drm_atomic_crtc_state_for_each_plane() this also fills in a
  * const plane_state. This is useful when a driver just wants to peek at other
  * active planes on this CRTC, but does not need to change it.
+ *
+ * WARNING:
+ * This is generally unsafe to use. See
+ * __drm_atomic_get_current_plane_state_unsafe() for further details.
  */
-#define drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, crtc_state) \
+#define __drm_atomic_crtc_state_for_each_plane_state_unsafe(plane, plane_state, crtc_state) \
 	drm_for_each_plane_mask(plane, (crtc_state)->state->dev, (crtc_state)->plane_mask) \
 		for_each_if ((plane_state = \
-			      __drm_atomic_get_current_plane_state((crtc_state)->state, \
-								   plane)))
+			      __drm_atomic_get_current_plane_state_unsafe((crtc_state)->state, \
+									  plane)))
 
 /**
  * drm_atomic_plane_enabling - check whether a plane is being enabled
-- 
2.56.0


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

* [PATCH 10/12] drm/i915: Complete no-op "async flips" by hand
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (7 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 09/12] drm/atomic-helper: Mark drm_atomic_crtc_state_for_each_plane_state() unsafe Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 11/12] drm/atomic/uapi: Make async flips a bit more palatable through atomic Ville Syrjala
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

If no planes appear in an async flip commit there will be
no flip done interrupt. Complete the commit by hand in
that case. Shouldn't really matter where we do this exactly,
but just before the wait stuff near the end of the commit
seems reasonable.

This can't happen via the legacy page flip ioctl path,
but nothing prevents fully no-op (as far as planes are
concerned) "async flips" via the atomic ioctl.

TODO: igt tests for atomic+async uapi don't really exist :(

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 38 ++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f4d9148efde3..afaaf3fc4646 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1190,6 +1190,42 @@ static void intel_crtc_disable_flip_done(struct intel_atomic_state *state,
 	}
 }
 
+static void intel_crtc_complete_noop_async_flip(struct intel_crtc_state *crtc_state)
+{
+	struct intel_display *display = to_intel_display(crtc_state);
+	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+	if (!crtc_state->do_async_flip)
+		return;
+
+	/*
+	 * If there are planes actually performing the async flip then
+	 * the commit will be completed via the flip done interrupt
+	 * handler. For a fully no-op "async flip" the commit must
+	 * be completed by hand as no interrupt will be raised.
+	 */
+	if (crtc_state->update_planes)
+		return;
+
+	if (crtc_state->uapi.event) {
+		spin_lock_irq(&display->drm->event_lock);
+		drm_crtc_send_vblank_event(&crtc->base,
+					   crtc_state->uapi.event);
+		spin_unlock_irq(&display->drm->event_lock);
+
+		crtc_state->uapi.event = NULL;
+	}
+}
+
+static void intel_atomic_complete_noop_async_flips(struct intel_atomic_state *state)
+{
+	struct intel_crtc_state *new_crtc_state;
+	struct intel_crtc *crtc;
+
+	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state)
+		intel_crtc_complete_noop_async_flip(new_crtc_state);
+}
+
 static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state,
 					     struct intel_crtc *crtc)
 {
@@ -7852,6 +7888,8 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 	if (intel_display_power_dc3co_allowed(display))
 		intel_cmtg_program(state);
 
+	intel_atomic_complete_noop_async_flips(state);
+
 	intel_wait_for_vblank_workers(state);
 
 	/* FIXME: We should call drm_atomic_helper_commit_hw_done() here
-- 
2.56.0


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

* [PATCH 11/12] drm/atomic/uapi: Make async flips a bit more palatable through atomic
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (8 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 10/12] drm/i915: Complete no-op "async flips" by hand Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16  9:11 ` [PATCH 12/12] drm/atomic/uapi: Extract {connector,crtc,plane}_async_flip_check() Ville Syrjala
  2026-11-16 17:29 ` [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Erwin Springer
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Userspace developers are supremely lazy, and apparently not willing
to spend any effort on trimming out no-op property changes from
their atomic commits.

For normal atomic commits it just means that the kernel and/or
hardware will need to do a bit more work to deal with the redundant
updates. Eg. on i915/xe we don't bother doing an exhaustive comparison
of all the state to filter out no-ops, and thus we end up feeding
most of it to the hardware. Apart from wasted power (not an
insignificant amount probably in some cases) that is kinda fine.

For normal atomic commit the rule is also that all side effects
of the commit must be observed. For example, if the plane's
framebuffer appears on the property list, we have to make sure
that any shadow copies of the framebuffer contents (PSR,
i915/xe FBC, etc.) are updated (even if the FB_ID stays the
same) in case there was any front buffer rendering done to
the buffer.

But for async flips the uapi has completely separate rules,
essentially saying that a plane that is part of the atomic
commit can be completely ignored by the driver if none its
properties are changing values. Ie. side effects need not
be observed.

The current scheme can sort of work without any extra state
comparisons, but only if every plane on the device supports
async flips. That is generally not the case. Eg. on i915/xe
we only support async flips on the primary plane. Later
hardware generations do support async flips on sprite planes
as well, but we've not hooked that up yet. And cursor planes
don't support async flips on any hardware generation.

Currently the only way to implement the no-op checks is by
having the driver perform that exhaustive comparison of the
full state. That would be tedious and supremely fragile as
it would be very easy to forget to update those checks when
adding a new piece of state.

Let's avoid that whole mess by doing the no-op filtering
directly in the atomic ioctl handler. It's pretty easy on
this level as all we really have to care about is the actual
uapi property values, not how they get stored in the state
objects (since we reuse the normal drm_atomic_get_property()
for that), and derived state is not a factor on this level
at all. The code is in fact mostly already there, just for
input validation purposes. It just needs to be extended
slightly to completely filter out the no-ops.

This way we can completely skip adding planes and connectors
to the state if all they have is no-op property changes. The
driver never even sees the no-op objects, and thus can't think
it needs to reject the commit due to their presence. CRTCs
we have to add even if none of their properties change state.
This is because the uapi rules say that any CRTC named in the
commit (either directly, or indirectly via a plane/connector)
must actually perform the commit, and send back the completion
event. For that reason we must also always add the
plane's/connector's current crtc to the state in the new
bespoke __drm_atomic_get_current_*_state() helpers.

TODO: igt tests for atomic+async uapi don't really exist :(

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic.c        |  97 +++++++++++++++++++
 drivers/gpu/drm/drm_atomic_uapi.c   | 139 ++++++++++++++++++++--------
 drivers/gpu/drm/drm_crtc_internal.h |   9 ++
 3 files changed, 205 insertions(+), 40 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 81591173265d..176520aec21c 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -497,6 +497,28 @@ drm_atomic_get_crtc_state(struct drm_atomic_commit *state,
 }
 EXPORT_SYMBOL(drm_atomic_get_crtc_state);
 
+const struct drm_crtc_state *
+__drm_atomic_get_current_crtc_state(struct drm_atomic_commit *state,
+				    struct drm_crtc *crtc)
+{
+	const struct drm_crtc_state *crtc_state;
+	int ret;
+
+	WARN_ON(!state->acquire_ctx);
+	drm_WARN_ON(state->dev, state->checked);
+
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	if (crtc_state)
+		return crtc_state;
+
+	ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return crtc->state;
+}
+/* Do not export! Only meant for drm_atomic_set_property(). */
+
 static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state,
 				 const struct drm_crtc_state *new_crtc_state)
 {
@@ -704,6 +726,43 @@ drm_atomic_get_plane_state(struct drm_atomic_commit *state,
 }
 EXPORT_SYMBOL(drm_atomic_get_plane_state);
 
+const struct drm_plane_state *
+__drm_atomic_get_current_plane_state(struct drm_atomic_commit *state,
+				     struct drm_plane *plane)
+{
+	const struct drm_plane_state *plane_state;
+	int ret;
+
+	WARN_ON(!state->acquire_ctx);
+	drm_WARN_ON(state->dev, state->checked);
+
+	plane_state = drm_atomic_get_new_plane_state(state, plane);
+	if (plane_state)
+		return plane_state;
+
+	ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx);
+	if (ret)
+		return ERR_PTR(ret);
+
+	plane_state = plane->state;
+
+	/*
+	 * The plane's current crtc must always be added
+	 * to the commit for completion/event purposes.
+	 */
+	if (plane_state->crtc) {
+		struct drm_crtc_state *crtc_state;
+
+		crtc_state = drm_atomic_get_crtc_state(state,
+						       plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return ERR_CAST(crtc_state);
+	}
+
+	return plane_state;
+}
+/* Do not export! Only meant for drm_atomic_set_property(). */
+
 static void drm_atomic_commit_set_colorop_state(struct drm_atomic_commit *commit,
 						struct drm_colorop *colorop,
 						struct drm_colorop_state *colorop_state)
@@ -1496,6 +1555,44 @@ drm_atomic_get_connector_state(struct drm_atomic_commit *state,
 }
 EXPORT_SYMBOL(drm_atomic_get_connector_state);
 
+const struct drm_connector_state *
+__drm_atomic_get_current_connector_state(struct drm_atomic_commit *state,
+					 struct drm_connector *connector)
+{
+	struct drm_mode_config *config = &connector->dev->mode_config;
+	const struct drm_connector_state *connector_state;
+	int ret;
+
+	WARN_ON(!state->acquire_ctx);
+	drm_WARN_ON(state->dev, state->checked);
+
+	connector_state = drm_atomic_get_new_connector_state(state, connector);
+	if (connector_state)
+		return connector_state;
+
+	ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx);
+	if (ret)
+		return ERR_PTR(ret);
+
+	connector_state = connector->state;
+
+	/*
+	 * The connectors's current crtc must always be added
+	 * to the commit for completion/event purposes.
+	 */
+	if (connector_state->crtc) {
+		struct drm_crtc_state *crtc_state;
+
+		crtc_state = drm_atomic_get_crtc_state(state,
+						       connector_state->crtc);
+		if (IS_ERR(crtc_state))
+			return ERR_CAST(crtc_state);
+	}
+
+	return connector_state;
+}
+/* Do not export! Only meant for drm_atomic_set_property(). */
+
 static void drm_atomic_connector_print_state(struct drm_printer *p,
 		const struct drm_connector_state *state)
 {
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 7517950d2e51..87181aba1451 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1212,15 +1212,19 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 	case DRM_MODE_OBJECT_CONNECTOR: {
 		struct drm_connector *connector = obj_to_connector(obj);
 		struct drm_connector_state *connector_state;
-
-		connector_state = drm_atomic_get_connector_state(state, connector);
-		if (IS_ERR(connector_state)) {
-			ret = PTR_ERR(connector_state);
-			break;
-		}
+		bool is_noop = false;
 
 		if (async_flip) {
-			ret = drm_atomic_connector_get_property(connector, connector_state,
+			const struct drm_connector_state *current_connector_state;
+
+			current_connector_state =
+				__drm_atomic_get_current_connector_state(state, connector);
+			if (IS_ERR(current_connector_state)) {
+				ret = PTR_ERR(current_connector_state);
+				break;
+			}
+
+			ret = drm_atomic_connector_get_property(connector, current_connector_state,
 								prop, &old_val);
 			if (ret)
 				break;
@@ -1238,6 +1242,21 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 				ret = -EINVAL;
 				break;
 			}
+
+			if (old_val == prop_value)
+				is_noop = true;
+		}
+
+		/* No-op connector property changes can be completely skipped */
+		if (is_noop) {
+			ret = 0;
+			break;
+		}
+
+		connector_state = drm_atomic_get_connector_state(state, connector);
+		if (IS_ERR(connector_state)) {
+			ret = PTR_ERR(connector_state);
+			break;
 		}
 
 		ret = drm_atomic_connector_set_property(connector,
@@ -1248,15 +1267,19 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 	case DRM_MODE_OBJECT_CRTC: {
 		struct drm_crtc *crtc = obj_to_crtc(obj);
 		struct drm_crtc_state *crtc_state;
-
-		crtc_state = drm_atomic_get_crtc_state(state, crtc);
-		if (IS_ERR(crtc_state)) {
-			ret = PTR_ERR(crtc_state);
-			break;
-		}
+		bool is_noop = false;
 
 		if (async_flip) {
-			ret = drm_atomic_crtc_get_property(crtc, crtc_state,
+			const struct drm_crtc_state *current_crtc_state;
+
+			current_crtc_state =
+				__drm_atomic_get_current_crtc_state(state, crtc);
+			if (IS_ERR(current_crtc_state)) {
+				ret = PTR_ERR(current_crtc_state);
+				break;
+			}
+
+			ret = drm_atomic_crtc_get_property(crtc, current_crtc_state,
 							   prop, &old_val);
 			if (ret)
 				break;
@@ -1274,6 +1297,24 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 				ret = -EINVAL;
 				break;
 			}
+
+			if (old_val == prop_value)
+				is_noop = true;
+		}
+
+		/*
+		 * CRTCs must always be included in the commit,
+		 * even for no-op property changes.
+		 */
+		crtc_state = drm_atomic_get_crtc_state(state, crtc);
+		if (IS_ERR(crtc_state)) {
+			ret = PTR_ERR(crtc_state);
+			break;
+		}
+
+		if (is_noop) {
+			ret = 0;
+			break;
 		}
 
 		ret = drm_atomic_crtc_set_property(crtc,
@@ -1285,16 +1326,19 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		struct drm_plane_state *plane_state;
 		struct drm_mode_config *config = &plane->dev->mode_config;
 		const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
-
-		plane_state = drm_atomic_get_plane_state(state, plane);
-		if (IS_ERR(plane_state)) {
-			ret = PTR_ERR(plane_state);
-			break;
-		}
+		bool is_noop = false;
 
 		if (async_flip) {
-			/* no-op changes are always allowed */
-			ret = drm_atomic_plane_get_property(plane, plane_state,
+			const struct drm_plane_state *current_plane_state;
+
+			current_plane_state =
+				__drm_atomic_get_current_plane_state(state, plane);
+			if (IS_ERR(current_plane_state)) {
+				ret = PTR_ERR(current_plane_state);
+				break;
+			}
+
+			ret = drm_atomic_plane_get_property(plane, current_plane_state,
 							    prop, &old_val);
 			if (ret)
 				break;
@@ -1318,25 +1362,40 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 				break;
 			}
 
-			/*
-			 * FIXME this is in the wrong place. Whether to do a
-			 * bypass commit for async flips would is a driver
-			 * decision. Drivers that want this need to just do
-			 * these checks themselves somewhere.
-			 */
-			if (old_val != prop_value && plane->type != DRM_PLANE_TYPE_PRIMARY) {
-				/* ask the driver if this non-primary plane is supported */
-				if (plane_funcs && plane_funcs->atomic_bypass_check)
-					ret = plane_funcs->atomic_bypass_check(plane, state, true);
-				else
-					ret = -EINVAL;
+			if (old_val == prop_value)
+				is_noop = true;
+		}
 
-				if (ret) {
-					drm_dbg_atomic(prop->dev,
-						       "[PLANE:%d:%s] does not support async flips\n",
-						       obj->id, plane->name);
-					break;
-				}
+		/* No-op plane property changes can be fully skipped */
+		if (is_noop) {
+			ret = 0;
+			break;
+		}
+
+		plane_state = drm_atomic_get_plane_state(state, plane);
+		if (IS_ERR(plane_state)) {
+			ret = PTR_ERR(plane_state);
+			break;
+		}
+
+		/*
+		 * FIXME this is in the wrong place. Whether to do a
+		 * bypass commit for async flips would is a driver
+		 * decision. Drivers that want this need to just do
+		 * these checks themselves somewhere.
+		 */
+		if (async_flip && !is_noop && plane->type != DRM_PLANE_TYPE_PRIMARY) {
+			/* ask the driver if this non-primary plane is supported */
+			if (plane_funcs && plane_funcs->atomic_bypass_check)
+				ret = plane_funcs->atomic_bypass_check(plane, state, true);
+			else
+				ret = -EINVAL;
+
+			if (ret) {
+				drm_dbg_atomic(prop->dev,
+					       "[PLANE:%d:%s] does not support async flips\n",
+					       obj->id, plane->name);
+				break;
 			}
 		}
 
diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
index 3492787c3697..5ae86d33e3ae 100644
--- a/drivers/gpu/drm/drm_crtc_internal.h
+++ b/drivers/gpu/drm/drm_crtc_internal.h
@@ -252,6 +252,15 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
 
 void drm_atomic_print_new_state(const struct drm_atomic_commit *state,
 		struct drm_printer *p);
+const struct drm_crtc_state *
+__drm_atomic_get_current_crtc_state(struct drm_atomic_commit *state,
+				    struct drm_crtc *crtc);
+const struct drm_connector_state *
+__drm_atomic_get_current_connector_state(struct drm_atomic_commit *state,
+					 struct drm_connector *connector);
+const struct drm_plane_state *
+__drm_atomic_get_current_plane_state(struct drm_atomic_commit *state,
+				     struct drm_plane *plane);
 
 /* drm_atomic_uapi.c */
 int drm_atomic_connector_commit_dpms(struct drm_atomic_commit *state,
-- 
2.56.0


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

* [PATCH 12/12] drm/atomic/uapi: Extract {connector,crtc,plane}_async_flip_check()
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (9 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 11/12] drm/atomic/uapi: Make async flips a bit more palatable through atomic Ville Syrjala
@ 2026-11-16  9:11 ` Ville Syrjala
  2026-11-16 17:29 ` [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Erwin Springer
  11 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjala @ 2026-11-16  9:11 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, intel-xe, Erwin Springer, amd-gfx, André Almeida,
	Boris Brezillon, Christopher Snowhill, Dave Stevenson,
	Dharma Balasubiramani, Dmitry Baryshkov, freedreno,
	Gustavo Padovan, Huacai Chen, Icenowy Zheng, Jianmin Lv,
	linux-arm-msm, linux-mediatek, linux-rockchip, linux-tegra,
	Liviu Dudau, Maíra Canal, Manikandan Muralidharan,
	Maxime Ripard, Mingcong Bai, nouveau, Qianhai Wu,
	Raspberry Pi Kernel Maintenance, Simon Ser, wayland-devel,
	Xaver Hugl, Xi Ruoyao

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reduce the clutter in drm_atomic_set_property() by
extracting the async flip related checks to
connector,crtc,plane}_async_flip_check().

Cc: amd-gfx@lists.freedesktop.org
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Christopher Snowhill <chris@kode54.net>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Dharma Balasubiramani <dharma.b@microchip.com>
Cc: Dmitry Baryshkov <lumag@kernel.org>
Cc: freedreno@lists.freedesktop.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: Jianmin Lv <lvjianmin@loongson.cn>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Manikandan Muralidharan <manikandan.m@microchip.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Mingcong Bai <jeffbai@aosc.io>
Cc: nouveau@lists.freedesktop.org
Cc: Qianhai Wu <wuqianhai@loongson.cn>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: wayland-devel@lists.freedesktop.org
Cc: Xaver Hugl <xaver.hugl@kde.org>
Cc: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 215 +++++++++++++++++-------------
 1 file changed, 124 insertions(+), 91 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 87181aba1451..65e1be6c4ad5 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1194,6 +1194,124 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_commit *state,
 	return ret;
 }
 
+static int connector_async_flip_check(struct drm_atomic_commit *state,
+				      struct drm_connector *connector,
+				      struct drm_property *prop,
+				      u64 prop_value, bool *is_noop)
+{
+	const struct drm_connector_state *current_connector_state;
+	u64 old_val = 0;
+	int ret;
+
+	current_connector_state =
+		__drm_atomic_get_current_connector_state(state, connector);
+	if (IS_ERR(current_connector_state))
+		return PTR_ERR(current_connector_state);
+
+	ret = drm_atomic_connector_get_property(connector, current_connector_state,
+						prop, &old_val);
+	if (ret)
+		return ret;
+
+	/*
+	 * Note that for WRITEBACK_FB_ID and WRITEBACK_OUT_FENCE_PTR
+	 * the old value will always be 0. So any commit that sets either
+	 * property to any other value will not be considered a no-op.
+	 */
+	if (old_val != prop_value) {
+		drm_dbg_atomic(prop->dev,
+			       "[CONNECTOR:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
+			       connector->base.id, connector->name,
+			       prop->base.id, prop->name);
+		return -EINVAL;
+	}
+
+	*is_noop = old_val == prop_value;
+
+	return 0;
+}
+
+static int crtc_async_flip_check(struct drm_atomic_commit *state,
+				 struct drm_crtc *crtc,
+				 struct drm_property *prop,
+				 u64 prop_value, bool *is_noop)
+{
+	const struct drm_crtc_state *current_crtc_state;
+	u64 old_val = 0;
+	int ret;
+
+	current_crtc_state =
+		__drm_atomic_get_current_crtc_state(state, crtc);
+	if (IS_ERR(current_crtc_state))
+		return PTR_ERR(current_crtc_state);
+
+	ret = drm_atomic_crtc_get_property(crtc, current_crtc_state,
+					   prop, &old_val);
+	if (ret)
+		return ret;
+
+	/*
+	 * Note that for OUT_FENCE_PTR the old value will always be 0.
+	 * So any commit that sets the property to any other value
+	 * will not be considered a no-op.
+	 */
+	if (old_val != prop_value) {
+		drm_dbg_atomic(prop->dev,
+			       "[CRTC:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
+			       crtc->base.id, crtc->name,
+			       prop->base.id, prop->name);
+		return -EINVAL;
+	}
+
+	*is_noop = old_val == prop_value;
+
+	return 0;
+}
+
+static int plane_async_flip_check(struct drm_atomic_commit *state,
+				  struct drm_plane *plane,
+				  struct drm_property *prop,
+				  u64 prop_value, bool *is_noop)
+{
+	struct drm_device *dev = plane->dev;
+	struct drm_mode_config *config = &dev->mode_config;
+	const struct drm_plane_state *current_plane_state;
+	u64 old_val = 0;
+	int ret;
+
+	current_plane_state =
+		__drm_atomic_get_current_plane_state(state, plane);
+	if (IS_ERR(current_plane_state))
+		return PTR_ERR(current_plane_state);
+
+	ret = drm_atomic_plane_get_property(plane, current_plane_state,
+					    prop, &old_val);
+	if (ret)
+		return ret;
+
+	/*
+	 * Fail everything that isn't no-op or a pure flip.
+	 *
+	 * Note that for IN_FENCE_FD the old value will always be -1.
+	 * So any commit that sets the property to any other value
+	 * will not be considered a no-op.
+	 */
+	if (old_val != prop_value &&
+	    prop != config->prop_fb_id &&
+	    prop != config->prop_in_fence_fd &&
+	    prop != config->prop_fb_damage_clips) {
+		drm_dbg_atomic(prop->dev,
+			       "[PLANE:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
+			       plane->base.id, plane->name,
+			       prop->base.id, prop->name);
+		return -EINVAL;
+	}
+
+	*is_noop = old_val == prop_value;
+
+	return 0;
+}
+
 int drm_atomic_set_property(struct drm_atomic_commit *state,
 			    struct drm_file *file_priv,
 			    struct drm_mode_object *obj,
@@ -1202,7 +1320,6 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			    bool async_flip)
 {
 	struct drm_mode_object *ref;
-	u64 old_val;
 	int ret;
 
 	if (!drm_property_change_valid_get(prop, prop_value, &ref))
@@ -1215,36 +1332,10 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		bool is_noop = false;
 
 		if (async_flip) {
-			const struct drm_connector_state *current_connector_state;
-
-			current_connector_state =
-				__drm_atomic_get_current_connector_state(state, connector);
-			if (IS_ERR(current_connector_state)) {
-				ret = PTR_ERR(current_connector_state);
-				break;
-			}
-
-			ret = drm_atomic_connector_get_property(connector, current_connector_state,
-								prop, &old_val);
+			ret = connector_async_flip_check(state, connector,
+							 prop, prop_value, &is_noop);
 			if (ret)
 				break;
-
-			/*
-			 * Note that for WRITEBACK_FB_ID and WRITEBACK_OUT_FENCE_PTR
-			 * the old value will always be 0. So any commit that sets either
-			 * property to any other value will not be considered a no-op.
-			 */
-			if (old_val != prop_value) {
-				drm_dbg_atomic(prop->dev,
-					       "[CONNECTOR:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
-					       connector->base.id, connector->name,
-					       prop->base.id, prop->name);
-				ret = -EINVAL;
-				break;
-			}
-
-			if (old_val == prop_value)
-				is_noop = true;
 		}
 
 		/* No-op connector property changes can be completely skipped */
@@ -1270,36 +1361,10 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		bool is_noop = false;
 
 		if (async_flip) {
-			const struct drm_crtc_state *current_crtc_state;
-
-			current_crtc_state =
-				__drm_atomic_get_current_crtc_state(state, crtc);
-			if (IS_ERR(current_crtc_state)) {
-				ret = PTR_ERR(current_crtc_state);
-				break;
-			}
-
-			ret = drm_atomic_crtc_get_property(crtc, current_crtc_state,
-							   prop, &old_val);
+			ret = crtc_async_flip_check(state, crtc,
+						    prop, prop_value, &is_noop);
 			if (ret)
 				break;
-
-			/*
-			 * Note that for OUT_FENCE_PTR the old value will always be 0.
-			 * So any commit that sets the property to any other value
-			 * will not be considered a no-op.
-			 */
-			if (old_val != prop_value) {
-				drm_dbg_atomic(prop->dev,
-					       "[CRTC:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
-					       crtc->base.id, crtc->name,
-					       prop->base.id, prop->name);
-				ret = -EINVAL;
-				break;
-			}
-
-			if (old_val == prop_value)
-				is_noop = true;
 		}
 
 		/*
@@ -1324,46 +1389,14 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 	case DRM_MODE_OBJECT_PLANE: {
 		struct drm_plane *plane = obj_to_plane(obj);
 		struct drm_plane_state *plane_state;
-		struct drm_mode_config *config = &plane->dev->mode_config;
 		const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
 		bool is_noop = false;
 
 		if (async_flip) {
-			const struct drm_plane_state *current_plane_state;
-
-			current_plane_state =
-				__drm_atomic_get_current_plane_state(state, plane);
-			if (IS_ERR(current_plane_state)) {
-				ret = PTR_ERR(current_plane_state);
-				break;
-			}
-
-			ret = drm_atomic_plane_get_property(plane, current_plane_state,
-							    prop, &old_val);
+			ret = plane_async_flip_check(state, plane,
+						     prop, prop_value, &is_noop);
 			if (ret)
 				break;
-
-			/*
-			 * Fail everything that isn't no-op or a pure flip.
-			 *
-			 * Note that for IN_FENCE_FD the old value will always be -1.
-			 * So any commit that sets the property to any other value
-			 * will not be considered a no-op.
-			 */
-			if (old_val != prop_value &&
-			    prop != config->prop_fb_id &&
-			    prop != config->prop_in_fence_fd &&
-			    prop != config->prop_fb_damage_clips) {
-				drm_dbg_atomic(prop->dev,
-					       "[PLANE:%d:%s][PROP:%d:%s] Unsupported property change during async flip\n",
-					       plane->base.id, plane->name,
-					       prop->base.id, prop->name);
-				ret = -EINVAL;
-				break;
-			}
-
-			if (old_val == prop_value)
-				is_noop = true;
 		}
 
 		/* No-op plane property changes can be fully skipped */
-- 
2.56.0


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

* Re: [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion
  2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
                   ` (10 preceding siblings ...)
  2026-11-16  9:11 ` [PATCH 12/12] drm/atomic/uapi: Extract {connector,crtc,plane}_async_flip_check() Ville Syrjala
@ 2026-11-16 17:29 ` Erwin Springer
  11 siblings, 0 replies; 13+ messages in thread
From: Erwin Springer @ 2026-11-16 17:29 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: intel-gfx, intel-xe, amd-gfx, André Almeida, Boris Brezillon,
	Christopher Snowhill, Dave Stevenson, Dharma Balasubiramani,
	Dmitry Baryshkov, freedreno, Gustavo Padovan, Huacai Chen,
	Icenowy Zheng, Jianmin Lv, linux-arm-msm, linux-mediatek,
	linux-rockchip, linux-tegra, Liviu Dudau, Maíra Canal,
	Manikandan Muralidharan, Maxime Ripard, Mingcong Bai, nouveau,
	Qianhai Wu, Raspberry Pi Kernel Maintenance, Simon Ser,
	wayland-devel, Xaver Hugl, Xi Ruoyao


Am 16.11.2026 um 10:11 schrieb Ville Syrjala:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The weird uapi semantics of the atomic async flip support make it
> really hard for drivers to implement. Try to fix that by filtering
> out the no-op junk from the commit that userspace likes to put there.
>
> Also a lot of people are apparently confusing the
> .atomic_async_{update,check}() hack with async flips. The two
> are completely orthogonal, so try to clear up that mess by
> renaming the hack to .atomic_bypass_{update,check}().
>
> TODO: atomic+async is in serious need to proper tests, somehow
>        all that seems to have gotten skipped when the feature
>        was added :(

thanks, this fixes the KWin case for me, so my patch is no longer
needed..

tested on Raptor Lake-U (Iris Xe) with unmodified KWin 6.8.2 and a
fullscreen client that requests tearing through wp_tearing_control_v1,
without my patch. I applied the series to the CachyOS 7.3.4 kernel,
the only conflicts were the renames in amdgpu and msm.

Before, none of about 350 frames per run was presented without vsync.
With the series 3330 of 3336 frames tear over four runs (with and
without CCS modifiers), and the "async flip not supported" message is
gone. What is still rejected is the first flip after the modifier or
format changed, once per run, as intended, and in three of the runs
one commit that touches the cursor plane, which can't do async flips:

   [PLANE:146:cursor A] does not support async flips
No warnings and no flip_done timeouts in the log.

If you think it fits, feel free to add:

Reported-by: Erwin Springer <aot.lerwin@gmail.com>
Tested-by: Erwin Springer <aot.lerwin@gmail.com>


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

end of thread, other threads:[~2026-11-16 18:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16  9:11 [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Ville Syrjala
2026-11-16  9:11 ` [PATCH 01/12] drm/atomic: Remove tall tales about tearing vs. "async updates" Ville Syrjala
2026-11-16  9:11 ` [PATCH 02/12] drm/atomic: s/async/bypass/ Ville Syrjala
2026-11-16  9:11 ` [PATCH 03/12] drm/atomic: Add FIXMEs around the incorrect use of the .atomic_bypass_check() for async flips Ville Syrjala
2026-11-16  9:11 ` [PATCH 04/12] drm/atomic: Highlight that bypass commits need care Ville Syrjala
2026-11-16  9:11 ` [PATCH 05/12] drm/atomic/uapi: Eliminate the confusing drm_atomic_check_prop_changes() Ville Syrjala
2026-11-16  9:11 ` [PATCH 07/12] drm/atomic/uapi: Document the non-obvious fence/fb_id prop behaviour Ville Syrjala
2026-11-16  9:11 ` [PATCH 08/12] drm/atomic/uapi: Add a FIXME about colorop vs. async flips Ville Syrjala
2026-11-16  9:11 ` [PATCH 09/12] drm/atomic-helper: Mark drm_atomic_crtc_state_for_each_plane_state() unsafe Ville Syrjala
2026-11-16  9:11 ` [PATCH 10/12] drm/i915: Complete no-op "async flips" by hand Ville Syrjala
2026-11-16  9:11 ` [PATCH 11/12] drm/atomic/uapi: Make async flips a bit more palatable through atomic Ville Syrjala
2026-11-16  9:11 ` [PATCH 12/12] drm/atomic/uapi: Extract {connector,crtc,plane}_async_flip_check() Ville Syrjala
2026-11-16 17:29 ` [PATCH 00/12] drm/atomic: Try to make atomic+async usable, and clear up the "async update" helper confusion Erwin Springer

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