dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really)
@ 2025-09-02  9:34 Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state Maxime Ripard
                   ` (38 more replies)
  0 siblings, 39 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:34 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Dmitry Baryshkov, Louis Chauvet,
	Haneen Mohammed, Melissa Wen, Jyri Sarha, Tomi Valkeinen,
	Paul Cercueil, linux-mips, Liviu Dudau, Russell King,
	Manikandan Muralidharan, Dharma Balasubiramani, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, linux-arm-kernel, Inki Dae,
	Seung-Woo Kim, Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Liu Ying, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Anitha Chrisanthus, Edmund Dea,
	Paul Kocialkowski, Sui Jingfeng, Chun-Kuang Hu, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-mediatek, linux-kernel,
	Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, linux-arm-msm, freedreno, Sandy Huang,
	Heiko Stübner, Andy Yan, linux-rockchip, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, linux-sunxi, Thierry Reding,
	Mikko Perttunen, Jonathan Hunter, linux-tegra, Hans de Goede,
	Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance

Hi,

Here's a series to get rid of the drm_atomic_helper_get_existing_*_state
accessors.

The initial intent was to remove the __drm_*_state->state pointer to
only rely on old and new states, but we still need it now to know which
of the two we need to free: if a state has not been committed (either
dropped or checked only), then we need to free the new one, if it has
been committed we need to free the old state. 

Thus, the state pointer is kept (and documented) only to point to the
state we should free eventually.

All users have been converted to the relevant old or new state
accessors.  

This was tested on tidss.

Let me know what you think,
Maxime

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
Changes in v2:
- Dropped the first and second patches
- Reworked the recipient list to be nicer with SMTPs
- Link to v1: https://lore.kernel.org/r/20250825-drm-no-more-existing-state-v1-0-f08ccd9f85c9@kernel.org

---
Maxime Ripard (37):
      drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
      drm/atomic: Remove unused drm_atomic_get_existing_connector_state()
      drm/atomic: Document __drm_connectors_state state pointer
      drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor
      drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state
      drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
      drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()
      drm/atomic: Remove unused drm_atomic_get_existing_plane_state()
      drm/atomic: Document __drm_planes_state state pointer
      drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state
      drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
      drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
      drm/armada: Switch to drm_atomic_get_new_crtc_state()
      drm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()
      drm/exynos: Switch to drm_atomic_get_new_crtc_state()
      drm/imx-dc: Switch to drm_atomic_get_new_crtc_state()
      drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
      drm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()
      drm/ingenic: Switch to drm_atomic_get_new_crtc_state()
      drm/kmb: Switch to drm_atomic_get_new_crtc_state()
      drm/logicvc: Switch to drm_atomic_get_new_crtc_state()
      drm/loongson: Switch to drm_atomic_get_new_crtc_state()
      drm/mediatek: Switch to drm_atomic_get_new_crtc_state()
      drm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()
      drm/omap: Switch to drm_atomic_get_new_crtc_state()
      drm/rockchip: Switch to drm_atomic_get_new_crtc_state()
      drm/sun4i: Switch to drm_atomic_get_new_crtc_state()
      drm/tegra: Switch to drm_atomic_get_new_crtc_state()
      drm/tilcdc: Switch to drm_atomic_get_new_crtc_state()
      drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
      drm/vc4: Switch to drm_atomic_get_new_crtc_state()
      drm/atomic: Switch to drm_atomic_get_new_crtc_state()
      drm/framebuffer: Switch to drm_atomic_get_new_crtc_state()
      drm/atomic: Remove unused drm_atomic_get_existing_crtc_state()
      drm/atomic: Document __drm_crtcs_state state pointer
      drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
      drm/atomic: Document __drm_private_objs_state state pointer

 drivers/gpu/drm/arm/malidp_planes.c             |   2 +-
 drivers/gpu/drm/armada/armada_plane.c           |   3 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |   2 +-
 drivers/gpu/drm/drm_atomic.c                    |  21 ++--
 drivers/gpu/drm/drm_framebuffer.c               |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_plane.c       |   2 +-
 drivers/gpu/drm/imx/dc/dc-plane.c               |   2 +-
 drivers/gpu/drm/imx/dcss/dcss-plane.c           |   4 +-
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c         |   3 +-
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c       |   3 +-
 drivers/gpu/drm/ingenic/ingenic-ipu.c           |   4 +-
 drivers/gpu/drm/kmb/kmb_plane.c                 |   3 +-
 drivers/gpu/drm/logicvc/logicvc_layer.c         |   4 +-
 drivers/gpu/drm/loongson/lsdc_plane.c           |   2 +-
 drivers/gpu/drm/mediatek/mtk_plane.c            |   3 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c      |   7 +-
 drivers/gpu/drm/omapdrm/omap_plane.c            |   2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   6 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c    |   2 +-
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c          |   3 +-
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c          |   3 +-
 drivers/gpu/drm/tegra/dc.c                      |   2 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |   9 +-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c           |   3 +-
 drivers/gpu/drm/vboxvideo/vbox_mode.c           |   8 +-
 drivers/gpu/drm/vc4/vc4_plane.c                 |   6 +-
 drivers/gpu/drm/vkms/vkms_crtc.c                |   4 +-
 include/drm/drm_atomic.h                        | 144 ++++++++++++------------
 28 files changed, 124 insertions(+), 135 deletions(-)
---
base-commit: 7fa4d8dc380fbd81a9d702a855c50690c9c6442c
change-id: 20250825-drm-no-more-existing-state-9b3252c1a33b

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


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

* [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 13:08   ` Dmitry Baryshkov
  2025-09-02  9:35 ` [PATCH v2 02/37] drm/atomic: Remove unused drm_atomic_get_existing_connector_state() Maxime Ripard
                   ` (37 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_connector_state() function calls a hand-rolled
implementation of the deprecated
drm_atomic_get_existing_connector_state() helper to get find if a
connector state had already been allocated and was part of the given
drm_atomic_state.

At the point in time where drm_atomic_get_connector_state() can be
called (ie, during atomic_check), the existing state is the new state
and drm_atomic_get_existing_connector_state() can thus be replaced by
drm_atomic_get_new_connector_state().

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_atomic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index cd15cf52f0c9144711da5879da57884674aea9e4..6d10a3e40b00c58030e4dc9fdf47bd252cac0189 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1150,12 +1150,13 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
 		       sizeof(*state->connectors) * (alloc - state->num_connector));
 
 		state->num_connector = alloc;
 	}
 
-	if (state->connectors[index].state)
-		return state->connectors[index].state;
+	connector_state = drm_atomic_get_new_connector_state(state, connector);
+	if (connector_state)
+		return connector_state;
 
 	connector_state = connector->funcs->atomic_duplicate_state(connector);
 	if (!connector_state)
 		return ERR_PTR(-ENOMEM);
 

-- 
2.50.1


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

* [PATCH v2 02/37] drm/atomic: Remove unused drm_atomic_get_existing_connector_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 03/37] drm/atomic: Document __drm_connectors_state state pointer Maxime Ripard
                   ` (36 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Dmitry Baryshkov

The drm_atomic_get_existing_connector_state() function is deprecated and
isn't used anymore, so let's remove it.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 38636a593c9d98cadda85ccd67326cb152f0dd27..321c866d5b0a46df7a9adbbf5e4cabd1ff987aad 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -729,33 +729,10 @@ drm_atomic_get_new_plane_state(const struct drm_atomic_state *state,
 			       struct drm_plane *plane)
 {
 	return state->planes[drm_plane_index(plane)].new_state;
 }
 
-/**
- * drm_atomic_get_existing_connector_state - get connector state, if it exists
- * @state: global atomic state object
- * @connector: connector to grab
- *
- * This function returns the connector state for the given connector,
- * or NULL if the connector is not part of the global atomic state.
- *
- * This function is deprecated, @drm_atomic_get_old_connector_state or
- * @drm_atomic_get_new_connector_state should be used instead.
- */
-static inline struct drm_connector_state *
-drm_atomic_get_existing_connector_state(const struct drm_atomic_state *state,
-					struct drm_connector *connector)
-{
-	int index = drm_connector_index(connector);
-
-	if (index >= state->num_connector)
-		return NULL;
-
-	return state->connectors[index].state;
-}
-
 /**
  * drm_atomic_get_old_connector_state - get connector state, if it exists
  * @state: global atomic state object
  * @connector: connector to grab
  *

-- 
2.50.1


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

* [PATCH v2 03/37] drm/atomic: Document __drm_connectors_state state pointer
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 02/37] drm/atomic: Remove unused drm_atomic_get_existing_connector_state() Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 04/37] drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor Maxime Ripard
                   ` (35 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 321c866d5b0a46df7a9adbbf5e4cabd1ff987aad..798d33b50ef7497ce938ce3dbabee32487dda2d6 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -180,11 +180,26 @@ struct __drm_crtcs_state {
 	u64 last_vblank_count;
 };
 
 struct __drm_connnectors_state {
 	struct drm_connector *ptr;
-	struct drm_connector_state *state, *old_state, *new_state;
+
+	/**
+	 * @state:
+	 *
+	 * Used to track the @drm_connector_state we will need to free
+	 * when tearing down the associated &drm_atomic_state.
+	 *
+	 * Before a commit, and the call to
+	 * drm_atomic_helper_swap_state() in particular, it points to
+	 * the same state than @new_state. After a commit, it points to
+	 * the same state than @old_state.
+	 */
+	struct drm_connector_state *state;
+
+	struct drm_connector_state *old_state, *new_state;
+
 	/**
 	 * @out_fence_ptr:
 	 *
 	 * User-provided pointer which the kernel uses to return a sync_file
 	 * file descriptor. Used by writeback connectors to signal completion of

-- 
2.50.1


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

* [PATCH v2 04/37] drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (2 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 03/37] drm/atomic: Document __drm_connectors_state state pointer Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 05/37] drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state Maxime Ripard
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The __drm_atomic_get_current_plane_state() function tries to get and
return the existing plane state, and if it doesn't exist returns the one
stored in the drm_plane->state field.

Using the current nomenclature, it tries to get the existing plane state
with an ad-hoc implementation of drm_atomic_get_existing_plane_state(),
and falls back to either the old or new plane state, depending on
whether it is called before or after drm_atomic_helper_swap_state().

The existing plane state itself is deprecated, because it also changes
when swapping states from the new state to the old state.

Fortunately for us, we can simplify things. Indeed,
__drm_atomic_get_current_plane_state() is only used in two macros:
intel_atomic_crtc_state_for_each_plane_state and
drm_atomic_crtc_state_for_each_plane_state().

The intel variant is only used through the intel_wm_compute() function
that is only ever called in intel_crtc_atomic_check().

The generic variant is more widely used, and can be found in the malidp,
msm, tegra and vc4 drivers. All of these call sites though are during
atomic_check(), so we end up in the same situation than Intel's.

Thus, we only ever use the existing state as the new state, and
plane->state is always going to be the old state. Any plane isn't
guaranteed to be part of the state though, so we can't rely on
drm_atomic_get_old_plane_state() and we still need to use plane->state.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 798d33b50ef7497ce938ce3dbabee32487dda2d6..82e74d9444c4fa7f02ee0e472c8c68f7bc44cc6a 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -789,15 +789,15 @@ drm_atomic_get_new_connector_state(const struct drm_atomic_state *state,
 /**
  * __drm_atomic_get_current_plane_state - get current plane state
  * @state: global atomic state object
  * @plane: plane to grab
  *
- * This function returns the plane state for the given plane, either from
- * @state, or if the plane isn't part of the atomic state update, from @plane.
- * This is useful in atomic check callbacks, when drivers need to peek at, but
- * not change, state of other planes, since it avoids threading an error code
- * back up the call chain.
+ * This function returns the plane state for the given plane, either the
+ * new plane state from @state, or if the plane isn't part of the atomic
+ * state update, from @plane. This is useful in atomic check callbacks,
+ * when drivers need to peek at, but not change, state of other planes,
+ * since it avoids threading an error code back up the call chain.
  *
  * WARNING:
  *
  * Note that this function is in general unsafe since it doesn't check for the
  * required locking for access state structures. Drivers must ensure that it is
@@ -814,13 +814,19 @@ drm_atomic_get_new_connector_state(const struct drm_atomic_state *state,
  */
 static inline const struct drm_plane_state *
 __drm_atomic_get_current_plane_state(const struct drm_atomic_state *state,
 				     struct drm_plane *plane)
 {
-	if (state->planes[drm_plane_index(plane)].state)
-		return state->planes[drm_plane_index(plane)].state;
+	struct drm_plane_state *plane_state;
 
+	plane_state = drm_atomic_get_new_plane_state(state, plane);
+	if (plane_state)
+		return plane_state;
+
+	/*
+	 * If the plane isn't part of the state, fallback to the currently active one.
+	 */
 	return plane->state;
 }
 
 int __must_check
 drm_atomic_add_encoder_bridges(struct drm_atomic_state *state,

-- 
2.50.1


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

* [PATCH v2 05/37] drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (3 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 04/37] drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() " Maxime Ripard
                   ` (33 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_plane_state() function calls the deprecated
drm_atomic_get_existing_plane_state() helper to get find if a plane
state had already been allocated and was part of the given
drm_atomic_state.

At the point in time where drm_atomic_get_plane_state() can be called
(ie, during atomic_check), the existing state is the new state and
drm_atomic_get_existing_plane_state() can thus be replaced by
drm_atomic_get_new_plane_state().

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 6d10a3e40b00c58030e4dc9fdf47bd252cac0189..15584928f06a9175308c3ef8f1ecbe1b33b17f47 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -532,11 +532,11 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
 	/* the legacy pointers should never be set */
 	WARN_ON(plane->fb);
 	WARN_ON(plane->old_fb);
 	WARN_ON(plane->crtc);
 
-	plane_state = drm_atomic_get_existing_plane_state(state, plane);
+	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)

-- 
2.50.1


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

* [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (4 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 05/37] drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 14:19   ` Ville Syrjälä
  2025-09-02  9:35 ` [PATCH v2 07/37] drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane() Maxime Ripard
                   ` (32 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Louis Chauvet, Haneen Mohammed,
	Melissa Wen

The vkms_crtc_atomic_check() function calls the deprecated
drm_atomic_get_existing_plane_state() helper for its internal mode
checking logic.

During atomic_check, the existing state is the new state and
drm_atomic_get_existing_plane_state() can thus be replaced by
drm_atomic_get_new_plane_state().

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Louis Chauvet <louis.chauvet@bootlin.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Melissa Wen <melissa.srw@gmail.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index e60573e0f3e9510252e1f198b00e28bcc7987620..48237f32ac3b8f78b1495e8fbcc630be863ec7e4 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -183,11 +183,11 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 	ret = drm_atomic_add_affected_planes(crtc_state->state, crtc);
 	if (ret < 0)
 		return ret;
 
 	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
-		plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane);
+		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 		WARN_ON(!plane_state);
 
 		if (!plane_state->visible)
 			continue;
 
@@ -199,11 +199,11 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
 		return -ENOMEM;
 	vkms_state->num_active_planes = i;
 
 	i = 0;
 	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
-		plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane);
+		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
 
 		if (!plane_state->visible)
 			continue;
 
 		vkms_state->active_planes[i++] =

-- 
2.50.1


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

* [PATCH v2 07/37] drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (5 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 08/37] drm/atomic: Remove unused drm_atomic_get_existing_plane_state() Maxime Ripard
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Jyri Sarha, Tomi Valkeinen

In the tilcdc_crtc_atomic_check(), the tilcdc driver hand-crafts its own
implementation of drm_atomic_helper_check_crtc_primary_plane(). And it
does so by accessing the state pointer in drm_atomic_state->planes which
is deprecated.

Let's use the right helper here.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Jyri Sarha <jyri.sarha@iki.fi>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index b5f60b2b2d0e72ae8ec0f3f4e5e85bc5004e6e5b..5718d9d83a49f38081aabbc9860847bdc83cf773 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -674,18 +674,11 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
 									  crtc);
 	/* If we are not active we don't care */
 	if (!crtc_state->active)
 		return 0;
 
-	if (state->planes[0].ptr != crtc->primary ||
-	    state->planes[0].state == NULL ||
-	    state->planes[0].state->crtc != crtc) {
-		dev_dbg(crtc->dev->dev, "CRTC primary plane must be present");
-		return -EINVAL;
-	}
-
-	return 0;
+	return drm_atomic_helper_check_crtc_primary_plane(crtc_state);
 }
 
 static int tilcdc_crtc_enable_vblank(struct drm_crtc *crtc)
 {
 	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);

-- 
2.50.1


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

* [PATCH v2 08/37] drm/atomic: Remove unused drm_atomic_get_existing_plane_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (6 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 07/37] drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane() Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 09/37] drm/atomic: Document __drm_planes_state state pointer Maxime Ripard
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_existing_plane_state() function is deprecated and
isn't used anymore, so let's remove it.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
 include/drm/drm_atomic.h | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 82e74d9444c4fa7f02ee0e472c8c68f7bc44cc6a..2f2c92fc4c20ee4e6abd6911bd574969d9cabbbb 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -696,28 +696,10 @@ drm_atomic_get_new_crtc_state(const struct drm_atomic_state *state,
 			      struct drm_crtc *crtc)
 {
 	return state->crtcs[drm_crtc_index(crtc)].new_state;
 }
 
-/**
- * drm_atomic_get_existing_plane_state - get plane state, if it exists
- * @state: global atomic state object
- * @plane: plane to grab
- *
- * This function returns the plane state for the given plane, or NULL
- * if the plane is not part of the global atomic state.
- *
- * This function is deprecated, @drm_atomic_get_old_plane_state or
- * @drm_atomic_get_new_plane_state should be used instead.
- */
-static inline struct drm_plane_state *
-drm_atomic_get_existing_plane_state(const struct drm_atomic_state *state,
-				    struct drm_plane *plane)
-{
-	return state->planes[drm_plane_index(plane)].state;
-}
-
 /**
  * drm_atomic_get_old_plane_state - get plane state, if it exists
  * @state: global atomic state object
  * @plane: plane to grab
  *

-- 
2.50.1


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

* [PATCH v2 09/37] drm/atomic: Document __drm_planes_state state pointer
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (7 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 08/37] drm/atomic: Remove unused drm_atomic_get_existing_plane_state() Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 10/37] drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state Maxime Ripard
                   ` (29 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
 include/drm/drm_atomic.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 2f2c92fc4c20ee4e6abd6911bd574969d9cabbbb..89c9a059b36763205fc2fc764283423cbea62679 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -157,11 +157,25 @@ struct drm_crtc_commit {
 	bool abort_completion;
 };
 
 struct __drm_planes_state {
 	struct drm_plane *ptr;
-	struct drm_plane_state *state, *old_state, *new_state;
+
+	/**
+	 * @state:
+	 *
+	 * Used to track the @drm_plane_state we will need to free
+	 * when tearing down the associated &drm_atomic_state.
+	 *
+	 * Before a commit, and the call to
+	 * drm_atomic_helper_swap_state() in particular, it points to
+	 * the same state than @new_state. After a commit, it points to
+	 * the same state than @old_state.
+	 */
+	struct drm_plane_state *state;
+
+	struct drm_plane_state *old_state, *new_state;
 };
 
 struct __drm_crtcs_state {
 	struct drm_crtc *ptr;
 	struct drm_crtc_state *state, *old_state, *new_state;

-- 
2.50.1


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

* [PATCH v2 10/37] drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (8 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 09/37] drm/atomic: Document __drm_planes_state state pointer Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state() Maxime Ripard
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_crtc_state() function calls the deprecated
drm_atomic_get_existing_crtc_state() helper to get find if a crtc state
had already been allocated and was part of the given drm_atomic_state.

At the point in time where drm_atomic_get_crtc_state() can be
called (ie, during atomic_check), the existing state is the new state
and drm_atomic_get_existing_crtc_state() can thus be replaced by
drm_atomic_get_new_crtc_state().

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 15584928f06a9175308c3ef8f1ecbe1b33b17f47..435a93c83149e60e4a1bf4310ee5e865242cac7b 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -347,11 +347,11 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state,
 	int ret, index = drm_crtc_index(crtc);
 	struct drm_crtc_state *crtc_state;
 
 	WARN_ON(!state->acquire_ctx);
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
+	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)

-- 
2.50.1


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

* [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (9 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 10/37] drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-03 19:03   ` Paul Cercueil
  2025-09-02  9:35 ` [PATCH v2 12/37] drm/arm/malidp: " Maxime Ripard
                   ` (27 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Paul Cercueil, linux-mips

The ingenic IPU atomic_set_property implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called during the state building process, before
atomic_check, and thus before the states are swapped. The existing state
thus points to the new state, and we can use
drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@vger.kernel.org
---
 drivers/gpu/drm/ingenic/ingenic-ipu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c
index 26ebf424d63ec21ccee80221745c3e8bcc6b3d7f..2574a4b4d40a2c27cb212114117829d9f6ab3ddb 100644
--- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
+++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
@@ -703,11 +703,11 @@ ingenic_ipu_plane_atomic_set_property(struct drm_plane *plane,
 
 	mode_changed = val != ipu->sharpness;
 	ipu->sharpness = val;
 
 	if (state->crtc) {
-		crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc);
+		crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc);
 		if (WARN_ON(!crtc_state))
 			return -EINVAL;
 
 		crtc_state->mode_changed |= mode_changed;
 	}

-- 
2.50.1


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

* [PATCH v2 12/37] drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (10 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state() Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 15:47   ` Liviu Dudau
  2025-09-02  9:35 ` [PATCH v2 13/37] drm/armada: " Maxime Ripard
                   ` (26 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Liviu Dudau

The malidp atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Liviu Dudau <liviu.dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 87f2e5ee87907403fac5386042bd6f313397ba03..f1a5014bcfa1058072e13f1ad8e84c85f52fb156 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -261,11 +261,11 @@ static const struct drm_plane_funcs malidp_de_plane_funcs = {
 
 static int malidp_se_check_scaling(struct malidp_plane *mp,
 				   struct drm_plane_state *state)
 {
 	struct drm_crtc_state *crtc_state =
-		drm_atomic_get_existing_crtc_state(state->state, state->crtc);
+		drm_atomic_get_new_crtc_state(state->state, state->crtc);
 	struct malidp_crtc_state *mc;
 	u32 src_w, src_h;
 	int ret;
 
 	if (!crtc_state)

-- 
2.50.1


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

* [PATCH v2 13/37] drm/armada: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (11 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 12/37] drm/arm/malidp: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 14:20   ` Ville Syrjälä
  2025-09-02  9:35 ` [PATCH v2 14/37] drm/atmel-hlcdc: " Maxime Ripard
                   ` (25 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Russell King

The armada atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Russell King <linux@armlinux.org.uk>
---
 drivers/gpu/drm/armada/armada_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c
index cc47c032dbc151a463cbd0b0d048c74c2828f253..786bcce0dc20eadab14c5bee97593ae3e05732b1 100644
--- a/drivers/gpu/drm/armada/armada_plane.c
+++ b/drivers/gpu/drm/armada/armada_plane.c
@@ -93,12 +93,11 @@ int armada_drm_plane_atomic_check(struct drm_plane *plane,
 		new_plane_state->visible = false;
 		return 0;
 	}
 
 	if (state)
-		crtc_state = drm_atomic_get_existing_crtc_state(state,
-								crtc);
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	else
 		crtc_state = crtc->state;
 
 	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
 						  0,

-- 
2.50.1


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

* [PATCH v2 14/37] drm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (12 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 13/37] drm/armada: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 15/37] drm/exynos: " Maxime Ripard
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Manikandan Muralidharan,
	Dharma Balasubiramani, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, linux-arm-kernel

The atmel-hlcdc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Manikandan Muralidharan <manikandan.m@microchip.com>
To: Dharma Balasubiramani <dharma.b@microchip.com>
To: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 4a7ba0918eca19eca3fd8febd1db1b2d3a8a6e14..59be5f64c058e2be398f207ad436f922135a5ad0 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -712,11 +712,11 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
 	int i;
 
 	if (!hstate->base.crtc || WARN_ON(!fb))
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, s->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, s->crtc);
 	mode = &crtc_state->adjusted_mode;
 
 	ret = drm_atomic_helper_check_plane_state(s, crtc_state,
 						  (1 << 16) / 2048,
 						  INT_MAX, true, true);

-- 
2.50.1


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

* [PATCH v2 15/37] drm/exynos: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (13 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 14/37] drm/atmel-hlcdc: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 16/37] drm/imx-dc: " Maxime Ripard
                   ` (23 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Inki Dae, Seung-Woo Kim, Kyungmin Park,
	Krzysztof Kozlowski, Alim Akhtar, linux-arm-kernel,
	linux-samsung-soc

The exynos atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Inki Dae <inki.dae@samsung.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>
To: Kyungmin Park <kyungmin.park@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
---
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 7c3aa77186d3431d7020db4dec70332c0cfccb5d..6400070a4c9bcc00ecd0f21cbce1b5aafe1bff48 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -56,11 +56,11 @@ static int exynos_plane_get_size(int start, unsigned length, unsigned last)
 static void exynos_plane_mode_set(struct exynos_drm_plane_state *exynos_state)
 {
 	struct drm_plane_state *state = &exynos_state->base;
 	struct drm_crtc *crtc = state->crtc;
 	struct drm_crtc_state *crtc_state =
-			drm_atomic_get_existing_crtc_state(state->state, crtc);
+		drm_atomic_get_new_crtc_state(state->state, crtc);
 	struct drm_display_mode *mode = &crtc_state->adjusted_mode;
 	int crtc_x, crtc_y;
 	unsigned int crtc_w, crtc_h;
 	unsigned int src_x, src_y;
 	unsigned int src_w, src_h;

-- 
2.50.1


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

* [PATCH v2 16/37] drm/imx-dc: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (14 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 15/37] drm/exynos: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 17/37] drm/imx-dcss: " Maxime Ripard
                   ` (22 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Liu Ying, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel

The imx-dc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Liu Ying <victor.liu@nxp.com>
To: Shawn Guo <shawnguo@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/dc/dc-plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/dc/dc-plane.c b/drivers/gpu/drm/imx/dc/dc-plane.c
index d8b946fb90de638da2bf4667307f11b06f4e77f5..e40d5d66c5c1f0d579a7a1019c0f2e00489ce15e 100644
--- a/drivers/gpu/drm/imx/dc/dc-plane.c
+++ b/drivers/gpu/drm/imx/dc/dc-plane.c
@@ -104,11 +104,11 @@ dc_plane_atomic_check(struct drm_plane *plane, struct drm_atomic_state *state)
 		dc_plane_dbg(plane, "no CRTC in plane state\n");
 		return -EINVAL;
 	}
 
 	crtc_state =
-		drm_atomic_get_existing_crtc_state(state, plane_state->crtc);
+		drm_atomic_get_new_crtc_state(state, plane_state->crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
 						  DRM_PLANE_NO_SCALING,

-- 
2.50.1


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

* [PATCH v2 17/37] drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (15 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 16/37] drm/imx-dc: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 11:45   ` Laurentiu Palcu
  2025-09-02  9:35 ` [PATCH v2 18/37] drm/imx-ipuv3: " Maxime Ripard
                   ` (21 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Laurentiu Palcu, Shawn Guo,
	Sascha Hauer, Lucas Stach, Pengutronix Kernel Team, Fabio Estevam,
	imx, linux-arm-kernel

The imx-dcss atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
To: Shawn Guo <shawnguo@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/dcss/dcss-plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
index ab6d32bad756d080e1c56d7574403febceff94f4..3a063a53c8dfa6bc5bbbf9afc7ff6519199c2f19 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
@@ -157,12 +157,12 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
 		return 0;
 
 	dma_obj = drm_fb_dma_get_gem_obj(fb, 0);
 	WARN_ON(!dma_obj);
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							new_plane_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state,
+						   new_plane_state->crtc);
 
 	hdisplay = crtc_state->adjusted_mode.hdisplay;
 	vdisplay = crtc_state->adjusted_mode.vdisplay;
 
 	if (!dcss_plane_is_source_size_allowed(new_plane_state->src_w >> 16,

-- 
2.50.1


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

* [PATCH v2 18/37] drm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (16 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 17/37] drm/imx-dcss: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 19/37] drm/ingenic: " Maxime Ripard
                   ` (20 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Philipp Zabel, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel

The imx-ipuv3 atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Shawn Guo <shawnguo@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
index 704c549750f950c3f0ce5d6c6f637d9d7b53fb69..df19560e41b4f5b0dce97ae03947abeaf99e0883 100644
--- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
@@ -384,12 +384,11 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
 
 	if (WARN_ON(!new_state->crtc))
 		return -EINVAL;
 
 	crtc_state =
-		drm_atomic_get_existing_crtc_state(state,
-						   new_state->crtc);
+		drm_atomic_get_new_crtc_state(state, new_state->crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	ret = drm_atomic_helper_check_plane_state(new_state, crtc_state,
 						  DRM_PLANE_NO_SCALING,

-- 
2.50.1


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

* [PATCH v2 19/37] drm/ingenic: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (17 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 18/37] drm/imx-ipuv3: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-03 19:04   ` Paul Cercueil
  2025-09-02  9:35 ` [PATCH v2 20/37] drm/kmb: " Maxime Ripard
                   ` (19 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Paul Cercueil, linux-mips

The ingenic atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@vger.kernel.org
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +--
 drivers/gpu/drm/ingenic/ingenic-ipu.c     | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 9db1ceaed5188a4ef0897280dc72108eb3815b5f..05faed933e5619c796f2a4fa1906e0eaa029ac68 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -469,12 +469,11 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane,
 		return 0;
 
 	if (priv->soc_info->plane_f0_not_working && plane == &priv->f0)
 		return -EINVAL;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	priv_state = ingenic_drm_get_priv_state(priv, state);
 	if (IS_ERR(priv_state))
diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c b/drivers/gpu/drm/ingenic/ingenic-ipu.c
index 2574a4b4d40a2c27cb212114117829d9f6ab3ddb..32638a713241abbd4eaed09f0aaec2b790650cc9 100644
--- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
+++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
@@ -578,11 +578,11 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
 	struct ingenic_ipu_private_state *ipu_state;
 
 	if (!crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	ipu_state = ingenic_ipu_get_priv_state(ipu, state);
 	if (IS_ERR(ipu_state))

-- 
2.50.1


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

* [PATCH v2 20/37] drm/kmb: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (18 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 19/37] drm/ingenic: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 21/37] drm/logicvc: " Maxime Ripard
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Anitha Chrisanthus, Edmund Dea

The kmb atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
To: Edmund Dea <edmund.j.dea@intel.com>
---
 drivers/gpu/drm/kmb/kmb_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/kmb/kmb_plane.c b/drivers/gpu/drm/kmb/kmb_plane.c
index 9e0562aa2bcb5ab4e2cbd71940ef4c147a7aa5ad..9562fe6711ffe2c5ad377e9973fcfdb76bf04daa 100644
--- a/drivers/gpu/drm/kmb/kmb_plane.c
+++ b/drivers/gpu/drm/kmb/kmb_plane.c
@@ -127,12 +127,11 @@ static int kmb_plane_atomic_check(struct drm_plane *plane,
 		drm_dbg(&kmb->drm, "Cannot change plane height or width after initial configuration");
 		return -EINVAL;
 	}
 	can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY);
 	crtc_state =
-		drm_atomic_get_existing_crtc_state(state,
-						   new_plane_state->crtc);
+		drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
 	return drm_atomic_helper_check_plane_state(new_plane_state,
 						   crtc_state,
 						   DRM_PLANE_NO_SCALING,
 						   DRM_PLANE_NO_SCALING,
 						   can_position, true);

-- 
2.50.1


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

* [PATCH v2 21/37] drm/logicvc: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (19 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 20/37] drm/kmb: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 22/37] drm/loongson: " Maxime Ripard
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Paul Kocialkowski

The logicvc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Paul Kocialkowski <paulk@sys-base.io>
---
 drivers/gpu/drm/logicvc/logicvc_layer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/logicvc/logicvc_layer.c b/drivers/gpu/drm/logicvc/logicvc_layer.c
index 464000aea765378894002fdb02dab16d197c27b1..eab4d773f92b66a9edb9770aa7a95349d665ec18 100644
--- a/drivers/gpu/drm/logicvc/logicvc_layer.c
+++ b/drivers/gpu/drm/logicvc/logicvc_layer.c
@@ -94,12 +94,12 @@ static int logicvc_plane_atomic_check(struct drm_plane *drm_plane,
 	int ret;
 
 	if (!new_state->crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(new_state->state,
-							new_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
+						   new_state->crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	if (new_state->crtc_x < 0 || new_state->crtc_y < 0) {
 		drm_err(drm_dev,

-- 
2.50.1


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

* [PATCH v2 22/37] drm/loongson: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (20 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 21/37] drm/logicvc: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 23/37] drm/mediatek: " Maxime Ripard
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Sui Jingfeng

The loongson atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/loongson/lsdc_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
index aa9a97f9c4dc28eea3098507ce52e6aa6caa46eb..2967a5cca06936d5d2480fac258b01e11f8d28e1 100644
--- a/drivers/gpu/drm/loongson/lsdc_plane.c
+++ b/drivers/gpu/drm/loongson/lsdc_plane.c
@@ -194,11 +194,11 @@ static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
 		drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
 			new_state->crtc_w, new_state->crtc_h);
 		return -EINVAL;
 	}
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, new_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc);
 	if (!crtc_state->active)
 		return -EINVAL;
 
 	if (plane->state->crtc != new_state->crtc ||
 	    plane->state->src_w != new_state->src_w ||

-- 
2.50.1


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

* [PATCH v2 23/37] drm/mediatek: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (21 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 22/37] drm/loongson: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 24/37] drm/msm/mdp5: " Maxime Ripard
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Chun-Kuang Hu, Philipp Zabel,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	linux-kernel, linux-arm-kernel

The mediatek atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/mediatek/mtk_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
index cbc4f37da8ba81ff9c8b3b58f66363837ffc21ec..d4486a63a6e01f02b6777522440dee8e39d51bf1 100644
--- a/drivers/gpu/drm/mediatek/mtk_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_plane.c
@@ -120,11 +120,12 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 	ret = mtk_crtc_plane_check(new_plane_state->crtc, plane,
 				   to_mtk_plane_state(new_plane_state));
 	if (ret)
 		return ret;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, new_plane_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state,
+						   new_plane_state->crtc);
 
 	return drm_atomic_helper_check_plane_state(plane->state, crtc_state,
 						   DRM_PLANE_NO_SCALING,
 						   DRM_PLANE_NO_SCALING,
 						   true, true);

-- 
2.50.1


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

* [PATCH v2 24/37] drm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (22 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 23/37] drm/mediatek: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 25/37] drm/omap: " Maxime Ripard
                   ` (14 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Dmitry Baryshkov, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno

The msm atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Rob Clark <robin.clark@oss.qualcomm.com>
To: Dmitry Baryshkov <lumag@kernel.org>
Cc: Abhinav Kumar <abhinav.kumar@linux.dev>
Cc: Jessica Zhang <jessica.zhang@oss.qualcomm.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
---
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index 7c790406d533fbabb330c438419efb18204cc4b7..4ca183fb61a95af60ef5a2c011ae6b2a0df963f0 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -334,12 +334,11 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
 
 	crtc = new_plane_state->crtc ? new_plane_state->crtc : old_plane_state->crtc;
 	if (!crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	return mdp5_plane_atomic_check_with_state(crtc_state, new_plane_state);
 }
@@ -371,12 +370,12 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
 	struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(new_plane_state);
 	struct drm_crtc_state *crtc_state;
 	int min_scale, max_scale;
 	int ret;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							new_plane_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state,
+						   new_plane_state->crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	if (!crtc_state->active)
 		return -EINVAL;

-- 
2.50.1


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

* [PATCH v2 25/37] drm/omap: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (23 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 24/37] drm/msm/mdp5: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 26/37] drm/rockchip: " Maxime Ripard
                   ` (13 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Tomi Valkeinen

The omap atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/omapdrm/omap_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 24a2ded08b454c4f2225e84f7b0ed09ed733d6b7..d74ef6694c10995c7393217a4d81275b36e00e2b 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -227,11 +227,11 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
 
 	crtc = new_plane_state->crtc ? new_plane_state->crtc : plane->state->crtc;
 	if (!crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	/* we should have a crtc state if the plane is attached to a crtc */
 	if (WARN_ON(!crtc_state))
 		return 0;
 
 	/*

-- 
2.50.1


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

* [PATCH v2 26/37] drm/rockchip: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (24 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 25/37] drm/omap: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 27/37] drm/sun4i: " Maxime Ripard
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Sandy Huang, Heiko Stübner,
	Andy Yan, linux-arm-kernel, linux-rockchip

The rockchip atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Sandy Huang <hjc@rock-chips.com>
To: "Heiko Stübner" <heiko@sntech.de>
To: Andy Yan <andy.yan@rock-chips.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c  | 6 +++---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ba6b0528d1e5a493cdef85dd1ea258e70c31ccd5..5369b77ea434c794ed7d509802fa29c39d2bfa7a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -824,12 +824,11 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
 					DRM_PLANE_NO_SCALING;
 
 	if (!crtc || WARN_ON(!fb))
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
 						  min_scale, max_scale,
@@ -1090,11 +1089,12 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane,
 		return -EINVAL;
 
 	if (!plane->state->fb)
 		return -EINVAL;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, new_plane_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state,
+						   new_plane_state->crtc);
 
 	/* Special case for asynchronous cursor updates. */
 	if (!crtc_state)
 		crtc_state = plane->crtc->state;
 
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index b50927a824b4020a7ffd57974070ed202cd8b838..4556cf7a33641529c673b8d7842115dc739dede2 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1011,11 +1011,11 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,
 
 	vp = to_vop2_video_port(crtc);
 	vop2 = vp->vop2;
 	vop2_data = vop2->data;
 
-	cstate = drm_atomic_get_existing_crtc_state(pstate->state, crtc);
+	cstate = drm_atomic_get_new_crtc_state(pstate->state, crtc);
 	if (WARN_ON(!cstate))
 		return -EINVAL;
 
 	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
 						  min_scale, max_scale,

-- 
2.50.1


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

* [PATCH v2 27/37] drm/sun4i: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (25 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 26/37] drm/rockchip: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 28/37] drm/tegra: " Maxime Ripard
                   ` (11 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, linux-arm-kernel, linux-sunxi

The sun4i atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Maxime Ripard <mripard@kernel.org>
To: Chen-Yu Tsai <wens@csie.org>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-sunxi@lists.linux.dev
---
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 3 +--
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
index f97be0040aab29cb4e138fcceb20e90c72db0252..94ac6ad6f30688a048e594811d2ae72aaa44376d 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
@@ -204,12 +204,11 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane,
 	int min_scale, max_scale;
 
 	if (!crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	min_scale = DRM_PLANE_NO_SCALING;
 	max_scale = DRM_PLANE_NO_SCALING;
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index a09ee4097537fca8b653f34a833b36b69e343ea5..1f77e1d2984548e746805f8323f537f3b4d93198 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -325,12 +325,11 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,
 	int min_scale, max_scale;
 
 	if (!crtc)
 		return 0;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	min_scale = DRM_PLANE_NO_SCALING;
 	max_scale = DRM_PLANE_NO_SCALING;

-- 
2.50.1


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

* [PATCH v2 28/37] drm/tegra: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (26 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 27/37] drm/sun4i: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 29/37] drm/tilcdc: " Maxime Ripard
                   ` (10 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Thierry Reding, Mikko Perttunen,
	Jonathan Hunter, linux-tegra

The tegra atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Thierry Reding <thierry.reding@gmail.com>
To: Mikko Perttunen <mperttunen@nvidia.com>
To: Jonathan Hunter <jonathanh@nvidia.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
---
 drivers/gpu/drm/tegra/dc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 59d5c1ba145a82f62c1835da574867084da98106..0f80da3544c9b3a239c43740c05f007711bc728b 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1031,11 +1031,11 @@ static int tegra_cursor_atomic_async_check(struct drm_plane *plane, struct drm_a
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
 	struct drm_crtc_state *crtc_state;
 	int min_scale, max_scale;
 	int err;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state, new_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc);
 	if (WARN_ON(!crtc_state))
 		return -EINVAL;
 
 	if (!crtc_state->active)
 		return -EINVAL;

-- 
2.50.1


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

* [PATCH v2 29/37] drm/tilcdc: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (27 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 28/37] drm/tegra: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 30/37] drm/vboxvideo: " Maxime Ripard
                   ` (9 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Jyri Sarha, Tomi Valkeinen

The tilcdc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Jyri Sarha <jyri.sarha@iki.fi>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
index cf77a8ce7398040814ec20eeffc6da960e36dfc0..aa72ca679598b6617366e89ffb3838ed8b323f2f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
@@ -40,12 +40,11 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
 		dev_err(plane->dev->dev, "%s: crtc position must be zero.",
 			__func__);
 		return -EINVAL;
 	}
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state,
-							new_state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc);
 	/* we should have a crtc state if the plane is attached to a crtc */
 	if (WARN_ON(!crtc_state))
 		return 0;
 
 	if (crtc_state->mode.hdisplay != new_state->crtc_w ||

-- 
2.50.1


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

* [PATCH v2 30/37] drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (28 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 29/37] drm/tilcdc: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:39   ` Hans de Goede
  2025-09-02  9:35 ` [PATCH v2 31/37] drm/vc4: " Maxime Ripard
                   ` (8 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Hans de Goede

The vboxvideo atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Hans de Goede <hansg@kernel.org>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c
index 9ff3bade979577df0bc2e6e9653b3fb8fd486062..aa0dded595b6e00a9aa2027b36ca11711ccc0439 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
@@ -260,12 +260,12 @@ static int vbox_primary_atomic_check(struct drm_plane *plane,
 	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
 									   plane);
 	struct drm_crtc_state *crtc_state = NULL;
 
 	if (new_state->crtc) {
-		crtc_state = drm_atomic_get_existing_crtc_state(state,
-								new_state->crtc);
+		crtc_state = drm_atomic_get_new_crtc_state(state,
+							   new_state->crtc);
 		if (WARN_ON(!crtc_state))
 			return -EINVAL;
 	}
 
 	return drm_atomic_helper_check_plane_state(new_state, crtc_state,
@@ -342,12 +342,12 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane,
 	u32 width = new_state->crtc_w;
 	u32 height = new_state->crtc_h;
 	int ret;
 
 	if (new_state->crtc) {
-		crtc_state = drm_atomic_get_existing_crtc_state(state,
-								new_state->crtc);
+		crtc_state = drm_atomic_get_new_crtc_state(state,
+							   new_state->crtc);
 		if (WARN_ON(!crtc_state))
 			return -EINVAL;
 	}
 
 	ret = drm_atomic_helper_check_plane_state(new_state, crtc_state,

-- 
2.50.1


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

* [PATCH v2 31/37] drm/vc4: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (29 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 30/37] drm/vboxvideo: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 32/37] drm/atomic: " Maxime Ripard
                   ` (7 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance

The vc4 atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
To: Maxime Ripard <mripard@kernel.org>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: "Maíra Canal" <mcanal@igalia.com>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 056d344c5411db0eae975b0fa52c0de7418306f1..b4a53f68865bc18f6cb1fa92b1057890d3fe0382 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -495,12 +495,11 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
 	struct drm_crtc_state *crtc_state;
 	u32 h_subsample = fb->format->hsub;
 	u32 v_subsample = fb->format->vsub;
 	int ret;
 
-	crtc_state = drm_atomic_get_existing_crtc_state(state->state,
-							state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc);
 	if (!crtc_state) {
 		DRM_DEBUG_KMS("Invalid crtc state\n");
 		return -EINVAL;
 	}
 
@@ -873,12 +872,11 @@ static void vc4_plane_calc_load(struct drm_plane_state *state)
 	struct vc4_plane_state *vc4_state;
 	struct drm_crtc_state *crtc_state;
 	unsigned int vscale_factor;
 
 	vc4_state = to_vc4_plane_state(state);
-	crtc_state = drm_atomic_get_existing_crtc_state(state->state,
-							state->crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc);
 	vrefresh = drm_mode_vrefresh(&crtc_state->adjusted_mode);
 
 	/* The HVS is able to process 2 pixels/cycle when scaling the source,
 	 * 4 pixels/cycle otherwise.
 	 * Alpha blending step seems to be pipelined and it's always operating

-- 
2.50.1


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

* [PATCH v2 32/37] drm/atomic: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (30 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 31/37] drm/vc4: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 13:21   ` Dmitry Baryshkov
  2025-09-02  9:35 ` [PATCH v2 33/37] drm/framebuffer: " Maxime Ripard
                   ` (6 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_connector_check() function uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_atomic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 435a93c83149e60e4a1bf4310ee5e865242cac7b..d6a53b678e7b52c0852b2e590d8bc041616cb80d 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -478,12 +478,12 @@ static int drm_atomic_connector_check(struct drm_connector *connector,
 			       connector->base.id, connector->name);
 		return -EINVAL;
 	}
 
 	if (state->crtc)
-		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
-								state->crtc);
+		crtc_state = drm_atomic_get_new_crtc_state(state->state,
+							   state->crtc);
 
 	if (writeback_job->fb && !crtc_state->active) {
 		drm_dbg_atomic(connector->dev,
 			       "[CONNECTOR:%d:%s] has framebuffer, but [CRTC:%d] is off\n",
 			       connector->base.id, connector->name,

-- 
2.50.1


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

* [PATCH v2 33/37] drm/framebuffer: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (31 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 32/37] drm/atomic: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 13:22   ` Dmitry Baryshkov
  2025-09-02  9:35 ` [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state() Maxime Ripard
                   ` (5 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The atomic_remove_fb() function uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

Despite its name, this function builds and commit a new
drm_atomic_state, and the call to drm_atomic_get_existing_crtc_state()
is part of the state building, thus happening before the states are
swapped.

As such, the existing state points to the new state, and we can use
drm_atomic_get_new_crtc_state() instead.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_framebuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index adbb73f00d68b8fb7c1d99a4209d5b4e91ec5f8d..18e753ade0011b87d0728bdb27d26ea37d75c213 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -1046,11 +1046,11 @@ static int atomic_remove_fb(struct drm_framebuffer *fb)
 			drm_dbg_kms(dev,
 				    "Disabling [CRTC:%d:%s] because [FB:%d] is removed\n",
 				    plane_state->crtc->base.id,
 				    plane_state->crtc->name, fb->base.id);
 
-			crtc_state = drm_atomic_get_existing_crtc_state(state, plane_state->crtc);
+			crtc_state = drm_atomic_get_new_crtc_state(state, plane_state->crtc);
 
 			ret = drm_atomic_add_affected_connectors(state, plane_state->crtc);
 			if (ret)
 				goto unlock;
 

-- 
2.50.1


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

* [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state()
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (32 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 33/37] drm/framebuffer: " Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 13:22   ` Dmitry Baryshkov
  2025-09-02  9:35 ` [PATCH v2 35/37] drm/atomic: Document __drm_crtcs_state state pointer Maxime Ripard
                   ` (4 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_existing_crtc_state() function is deprecated and
isn't used anymore, so let's remove it.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 89c9a059b36763205fc2fc764283423cbea62679..cba63857e920515b48b75fc3c2d5239fc1ae59c1 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -663,28 +663,10 @@ drm_atomic_get_old_crtc_for_encoder(struct drm_atomic_state *state,
 					 struct drm_encoder *encoder);
 struct drm_crtc *
 drm_atomic_get_new_crtc_for_encoder(struct drm_atomic_state *state,
 					 struct drm_encoder *encoder);
 
-/**
- * drm_atomic_get_existing_crtc_state - get CRTC state, if it exists
- * @state: global atomic state object
- * @crtc: CRTC to grab
- *
- * This function returns the CRTC state for the given CRTC, or NULL
- * if the CRTC is not part of the global atomic state.
- *
- * This function is deprecated, @drm_atomic_get_old_crtc_state or
- * @drm_atomic_get_new_crtc_state should be used instead.
- */
-static inline struct drm_crtc_state *
-drm_atomic_get_existing_crtc_state(const struct drm_atomic_state *state,
-				   struct drm_crtc *crtc)
-{
-	return state->crtcs[drm_crtc_index(crtc)].state;
-}
-
 /**
  * drm_atomic_get_old_crtc_state - get old CRTC state, if it exists
  * @state: global atomic state object
  * @crtc: CRTC to grab
  *

-- 
2.50.1


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

* [PATCH v2 35/37] drm/atomic: Document __drm_crtcs_state state pointer
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (33 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state() Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02  9:35 ` [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state Maxime Ripard
                   ` (3 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index cba63857e920515b48b75fc3c2d5239fc1ae59c1..e8edf33ab260c03c81e16917a6a5a7d9648d46c9 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -176,11 +176,25 @@ struct __drm_planes_state {
 	struct drm_plane_state *old_state, *new_state;
 };
 
 struct __drm_crtcs_state {
 	struct drm_crtc *ptr;
-	struct drm_crtc_state *state, *old_state, *new_state;
+
+	/**
+	 * @state:
+	 *
+	 * Used to track the @drm_crtc_state we will need to free
+	 * when tearing down the associated &drm_atomic_state.
+	 *
+	 * Before a commit, and the call to
+	 * drm_atomic_helper_swap_state() in particular, it points to
+	 * the same state than @new_state. After a commit, it points to
+	 * the same state than @old_state.
+	 */
+	struct drm_crtc_state *state;
+
+	struct drm_crtc_state *old_state, *new_state;
 
 	/**
 	 * @commit:
 	 *
 	 * A reference to the CRTC commit object that is kept for use by

-- 
2.50.1


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

* [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (34 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 35/37] drm/atomic: Document __drm_crtcs_state state pointer Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 13:25   ` Dmitry Baryshkov
  2025-09-02  9:35 ` [PATCH v2 37/37] drm/atomic: Document __drm_private_objs_state state pointer Maxime Ripard
                   ` (2 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

The drm_atomic_get_private_obj_state() function tries to find if a
private_obj had already been allocated and was part of the given
drm_atomic_state. If one is found, it returns the existing state
pointer.

At the point in time where drm_atomic_get_private_obj_state() can be
called (ie, during atomic_check), the existing state is the new state
and we can thus replace the hand-crafted logic by a call to
drm_atomic_get_new_private_obj_state().

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/gpu/drm/drm_atomic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index d6a53b678e7b52c0852b2e590d8bc041616cb80d..754981ead01ffa27434be55079e9f967eb576be5 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -829,18 +829,18 @@ EXPORT_SYMBOL(drm_atomic_private_obj_fini);
  */
 struct drm_private_state *
 drm_atomic_get_private_obj_state(struct drm_atomic_state *state,
 				 struct drm_private_obj *obj)
 {
-	int index, num_objs, i, ret;
+	int index, num_objs, ret;
 	size_t size;
 	struct __drm_private_objs_state *arr;
 	struct drm_private_state *obj_state;
 
-	for (i = 0; i < state->num_private_objs; i++)
-		if (obj == state->private_objs[i].ptr)
-			return state->private_objs[i].state;
+	obj_state = drm_atomic_get_new_private_obj_state(state, obj);
+	if (obj_state)
+		return obj_state;
 
 	ret = drm_modeset_lock(&obj->lock, state->acquire_ctx);
 	if (ret)
 		return ERR_PTR(ret);
 

-- 
2.50.1


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

* [PATCH v2 37/37] drm/atomic: Document __drm_private_objs_state state pointer
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (35 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state Maxime Ripard
@ 2025-09-02  9:35 ` Maxime Ripard
  2025-09-02 14:29 ` [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Ville Syrjälä
  2025-09-03 19:09 ` Ville Syrjälä
  38 siblings, 0 replies; 55+ messages in thread
From: Maxime Ripard @ 2025-09-02  9:35 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_atomic.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index e8edf33ab260c03c81e16917a6a5a7d9648d46c9..a7e75bb0bdc6a38eb83c07b844dd97af48006f0f 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -383,11 +383,25 @@ struct drm_private_state {
 	struct drm_private_obj *obj;
 };
 
 struct __drm_private_objs_state {
 	struct drm_private_obj *ptr;
-	struct drm_private_state *state, *old_state, *new_state;
+
+	/**
+	 * @state:
+	 *
+	 * Used to track the @drm_private_state we will need to free
+	 * when tearing down the associated &drm_atomic_state.
+	 *
+	 * Before a commit, and the call to
+	 * drm_atomic_helper_swap_state() in particular, it points to
+	 * the same state than @new_state. After a commit, it points to
+	 * the same state than @old_state.
+	 */
+	struct drm_private_state *state;
+
+	struct drm_private_state *old_state, *new_state;
 };
 
 /**
  * struct drm_atomic_state - Atomic commit structure
  *

-- 
2.50.1


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

* Re: [PATCH v2 30/37] drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 30/37] drm/vboxvideo: " Maxime Ripard
@ 2025-09-02  9:39   ` Hans de Goede
  0 siblings, 0 replies; 55+ messages in thread
From: Hans de Goede @ 2025-09-02  9:39 UTC (permalink / raw)
  To: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: dri-devel

Hi,

On 2-Sep-25 11:35 AM, Maxime Ripard wrote:
> The vboxvideo atomic_check implementation uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before the
> states are swapped. The existing state thus points to the new state, and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> 
> ---
> To: Hans de Goede <hansg@kernel.org>
> Cc: dri-devel@lists.freedesktop.org

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hansg@kernel.org>

Regards,

Hans




> ---
>  drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c
> index 9ff3bade979577df0bc2e6e9653b3fb8fd486062..aa0dded595b6e00a9aa2027b36ca11711ccc0439 100644
> --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
> +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
> @@ -260,12 +260,12 @@ static int vbox_primary_atomic_check(struct drm_plane *plane,
>  	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
>  									   plane);
>  	struct drm_crtc_state *crtc_state = NULL;
>  
>  	if (new_state->crtc) {
> -		crtc_state = drm_atomic_get_existing_crtc_state(state,
> -								new_state->crtc);
> +		crtc_state = drm_atomic_get_new_crtc_state(state,
> +							   new_state->crtc);
>  		if (WARN_ON(!crtc_state))
>  			return -EINVAL;
>  	}
>  
>  	return drm_atomic_helper_check_plane_state(new_state, crtc_state,
> @@ -342,12 +342,12 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane,
>  	u32 width = new_state->crtc_w;
>  	u32 height = new_state->crtc_h;
>  	int ret;
>  
>  	if (new_state->crtc) {
> -		crtc_state = drm_atomic_get_existing_crtc_state(state,
> -								new_state->crtc);
> +		crtc_state = drm_atomic_get_new_crtc_state(state,
> +							   new_state->crtc);
>  		if (WARN_ON(!crtc_state))
>  			return -EINVAL;
>  	}
>  
>  	ret = drm_atomic_helper_check_plane_state(new_state, crtc_state,
> 


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

* Re: [PATCH v2 17/37] drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 17/37] drm/imx-dcss: " Maxime Ripard
@ 2025-09-02 11:45   ` Laurentiu Palcu
  0 siblings, 0 replies; 55+ messages in thread
From: Laurentiu Palcu @ 2025-09-02 11:45 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, Shawn Guo, Sascha Hauer, Lucas Stach,
	Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel

Hi Maxime,

On Tue, Sep 02, 2025 at 11:35:16AM +0200, Maxime Ripard wrote:
> The imx-dcss atomic_check implementation uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before the
> states are swapped. The existing state thus points to the new state, and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>

Thanks,
Laurentiu
> 
> ---
> To: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> To: Shawn Guo <shawnguo@kernel.org>
> To: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/gpu/drm/imx/dcss/dcss-plane.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
> index ab6d32bad756d080e1c56d7574403febceff94f4..3a063a53c8dfa6bc5bbbf9afc7ff6519199c2f19 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
> @@ -157,12 +157,12 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
>  		return 0;
>  
>  	dma_obj = drm_fb_dma_get_gem_obj(fb, 0);
>  	WARN_ON(!dma_obj);
>  
> -	crtc_state = drm_atomic_get_existing_crtc_state(state,
> -							new_plane_state->crtc);
> +	crtc_state = drm_atomic_get_new_crtc_state(state,
> +						   new_plane_state->crtc);
>  
>  	hdisplay = crtc_state->adjusted_mode.hdisplay;
>  	vdisplay = crtc_state->adjusted_mode.vdisplay;
>  
>  	if (!dcss_plane_is_source_size_allowed(new_plane_state->src_w >> 16,
> 
> -- 
> 2.50.1
> 

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

* Re: [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
  2025-09-02  9:35 ` [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state Maxime Ripard
@ 2025-09-02 13:08   ` Dmitry Baryshkov
  0 siblings, 0 replies; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 13:08 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:00AM +0200, Maxime Ripard wrote:
> The drm_atomic_get_connector_state() function calls a hand-rolled
> implementation of the deprecated
> drm_atomic_get_existing_connector_state() helper to get find if a
> connector state had already been allocated and was part of the given
> drm_atomic_state.
> 
> At the point in time where drm_atomic_get_connector_state() can be
> called (ie, during atomic_check), the existing state is the new state
> and drm_atomic_get_existing_connector_state() can thus be replaced by
> drm_atomic_get_new_connector_state().
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/drm_atomic.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 32/37] drm/atomic: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 32/37] drm/atomic: " Maxime Ripard
@ 2025-09-02 13:21   ` Dmitry Baryshkov
  0 siblings, 0 replies; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 13:21 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:31AM +0200, Maxime Ripard wrote:
> The drm_atomic_connector_check() function uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before the
> states are swapped. The existing state thus points to the new state, and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/drm_atomic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 33/37] drm/framebuffer: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 33/37] drm/framebuffer: " Maxime Ripard
@ 2025-09-02 13:22   ` Dmitry Baryshkov
  0 siblings, 0 replies; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 13:22 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:32AM +0200, Maxime Ripard wrote:
> The atomic_remove_fb() function uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> Despite its name, this function builds and commit a new
> drm_atomic_state, and the call to drm_atomic_get_existing_crtc_state()
> is part of the state building, thus happening before the states are
> swapped.
> 
> As such, the existing state points to the new state, and we can use
> drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/drm_framebuffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state() Maxime Ripard
@ 2025-09-02 13:22   ` Dmitry Baryshkov
  0 siblings, 0 replies; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 13:22 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:33AM +0200, Maxime Ripard wrote:
> The drm_atomic_get_existing_crtc_state() function is deprecated and
> isn't used anymore, so let's remove it.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  include/drm/drm_atomic.h | 18 ------------------
>  1 file changed, 18 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
  2025-09-02  9:35 ` [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state Maxime Ripard
@ 2025-09-02 13:25   ` Dmitry Baryshkov
  2025-09-02 14:14     ` Ville Syrjälä
  0 siblings, 1 reply; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 13:25 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:35AM +0200, Maxime Ripard wrote:
> The drm_atomic_get_private_obj_state() function tries to find if a
> private_obj had already been allocated and was part of the given
> drm_atomic_state. If one is found, it returns the existing state
> pointer.
> 
> At the point in time where drm_atomic_get_private_obj_state() can be
> called (ie, during atomic_check), the existing state is the new state
> and we can thus replace the hand-crafted logic by a call to
> drm_atomic_get_new_private_obj_state().


This function is being used in e.g. this call stack:
ingenic_drm_crtc_atomic_enable -> ingenic_drm_get_priv_state ->
drm_atomic_get_private_obj_state(). Please correct me if I'm wrong,
doesn't it happen already after the state switch?

> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/drm_atomic.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
  2025-09-02 13:25   ` Dmitry Baryshkov
@ 2025-09-02 14:14     ` Ville Syrjälä
  2025-09-02 14:17       ` Dmitry Baryshkov
  0 siblings, 1 reply; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-02 14:14 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel

On Tue, Sep 02, 2025 at 04:25:12PM +0300, Dmitry Baryshkov wrote:
> On Tue, Sep 02, 2025 at 11:35:35AM +0200, Maxime Ripard wrote:
> > The drm_atomic_get_private_obj_state() function tries to find if a
> > private_obj had already been allocated and was part of the given
> > drm_atomic_state. If one is found, it returns the existing state
> > pointer.
> > 
> > At the point in time where drm_atomic_get_private_obj_state() can be
> > called (ie, during atomic_check), the existing state is the new state
> > and we can thus replace the hand-crafted logic by a call to
> > drm_atomic_get_new_private_obj_state().
> 
> 
> This function is being used in e.g. this call stack:
> ingenic_drm_crtc_atomic_enable -> ingenic_drm_get_priv_state ->
> drm_atomic_get_private_obj_state(). Please correct me if I'm wrong,
> doesn't it happen already after the state switch?

Looks like it should just use the get_new_state() there.

Hmm, I wonder if we should make the get_state() functions warn
(and maybe return NULL) if they get called after the state has
been swapped?

> 
> > 
> > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > ---
> >  drivers/gpu/drm/drm_atomic.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> 
> -- 
> With best wishes
> Dmitry

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
  2025-09-02 14:14     ` Ville Syrjälä
@ 2025-09-02 14:17       ` Dmitry Baryshkov
  2025-09-02 14:27         ` Ville Syrjälä
  0 siblings, 1 reply; 55+ messages in thread
From: Dmitry Baryshkov @ 2025-09-02 14:17 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel

On Tue, Sep 02, 2025 at 05:14:51PM +0300, Ville Syrjälä wrote:
> On Tue, Sep 02, 2025 at 04:25:12PM +0300, Dmitry Baryshkov wrote:
> > On Tue, Sep 02, 2025 at 11:35:35AM +0200, Maxime Ripard wrote:
> > > The drm_atomic_get_private_obj_state() function tries to find if a
> > > private_obj had already been allocated and was part of the given
> > > drm_atomic_state. If one is found, it returns the existing state
> > > pointer.
> > > 
> > > At the point in time where drm_atomic_get_private_obj_state() can be
> > > called (ie, during atomic_check), the existing state is the new state
> > > and we can thus replace the hand-crafted logic by a call to
> > > drm_atomic_get_new_private_obj_state().
> > 
> > 
> > This function is being used in e.g. this call stack:
> > ingenic_drm_crtc_atomic_enable -> ingenic_drm_get_priv_state ->
> > drm_atomic_get_private_obj_state(). Please correct me if I'm wrong,
> > doesn't it happen already after the state switch?
> 
> Looks like it should just use the get_new_state() there.
> 
> Hmm, I wonder if we should make the get_state() functions warn
> (and maybe return NULL) if they get called after the state has
> been swapped?

Might be.

Note: I just quickly git grepped the function and stumbled upon the
first questionable use. There might be uther users which call it after
swapping the state.

> 
> > 
> > > 
> > > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > > ---
> > >  drivers/gpu/drm/drm_atomic.c | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > 
> > 
> > -- 
> > With best wishes
> > Dmitry
> 
> -- 
> Ville Syrjälä
> Intel

-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
  2025-09-02  9:35 ` [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() " Maxime Ripard
@ 2025-09-02 14:19   ` Ville Syrjälä
  0 siblings, 0 replies; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-02 14:19 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, Louis Chauvet, Haneen Mohammed, Melissa Wen

On Tue, Sep 02, 2025 at 11:35:05AM +0200, Maxime Ripard wrote:
> The vkms_crtc_atomic_check() function calls the deprecated
> drm_atomic_get_existing_plane_state() helper for its internal mode
> checking logic.
> 
> During atomic_check, the existing state is the new state and
> drm_atomic_get_existing_plane_state() can thus be replaced by
> drm_atomic_get_new_plane_state().
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> 
> ---
> To: Louis Chauvet <louis.chauvet@bootlin.com>
> Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Melissa Wen <melissa.srw@gmail.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index e60573e0f3e9510252e1f198b00e28bcc7987620..48237f32ac3b8f78b1495e8fbcc630be863ec7e4 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -183,11 +183,11 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
>  	ret = drm_atomic_add_affected_planes(crtc_state->state, crtc);
>  	if (ret < 0)
>  		return ret;
>  
>  	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
> -		plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane);
> +		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);

Looks like a bunch of these drivers could also use another cleanup
to plumb the drm_atomic_state straight through instead of digging
it up again via the foo_state->state footgun.

>  		WARN_ON(!plane_state);
>  
>  		if (!plane_state->visible)
>  			continue;
>  
> @@ -199,11 +199,11 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
>  		return -ENOMEM;
>  	vkms_state->num_active_planes = i;
>  
>  	i = 0;
>  	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
> -		plane_state = drm_atomic_get_existing_plane_state(crtc_state->state, plane);
> +		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
>  
>  		if (!plane_state->visible)
>  			continue;
>  
>  		vkms_state->active_planes[i++] =
> 
> -- 
> 2.50.1

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 13/37] drm/armada: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 13/37] drm/armada: " Maxime Ripard
@ 2025-09-02 14:20   ` Ville Syrjälä
  0 siblings, 0 replies; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-02 14:20 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, Russell King

On Tue, Sep 02, 2025 at 11:35:12AM +0200, Maxime Ripard wrote:
> The armada atomic_check implementation uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before the
> states are swapped. The existing state thus points to the new state, and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> 
> ---
> To: Russell King <linux@armlinux.org.uk>
> ---
>  drivers/gpu/drm/armada/armada_plane.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c
> index cc47c032dbc151a463cbd0b0d048c74c2828f253..786bcce0dc20eadab14c5bee97593ae3e05732b1 100644
> --- a/drivers/gpu/drm/armada/armada_plane.c
> +++ b/drivers/gpu/drm/armada/armada_plane.c
> @@ -93,12 +93,11 @@ int armada_drm_plane_atomic_check(struct drm_plane *plane,
>  		new_plane_state->visible = false;
>  		return 0;
>  	}
>  
>  	if (state)

This check looks like nonsense. There should be no way this gets called
without a drm_atomic_state. Could use another patch to clean up this
mess as well.

> -		crtc_state = drm_atomic_get_existing_crtc_state(state,
> -								crtc);
> +		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>  	else
>  		crtc_state = crtc->state;
>  
>  	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
>  						  0,
> 
> -- 
> 2.50.1

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
  2025-09-02 14:17       ` Dmitry Baryshkov
@ 2025-09-02 14:27         ` Ville Syrjälä
  0 siblings, 0 replies; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-02 14:27 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel

On Tue, Sep 02, 2025 at 05:17:24PM +0300, Dmitry Baryshkov wrote:
> On Tue, Sep 02, 2025 at 05:14:51PM +0300, Ville Syrjälä wrote:
> > On Tue, Sep 02, 2025 at 04:25:12PM +0300, Dmitry Baryshkov wrote:
> > > On Tue, Sep 02, 2025 at 11:35:35AM +0200, Maxime Ripard wrote:
> > > > The drm_atomic_get_private_obj_state() function tries to find if a
> > > > private_obj had already been allocated and was part of the given
> > > > drm_atomic_state. If one is found, it returns the existing state
> > > > pointer.
> > > > 
> > > > At the point in time where drm_atomic_get_private_obj_state() can be
> > > > called (ie, during atomic_check), the existing state is the new state
> > > > and we can thus replace the hand-crafted logic by a call to
> > > > drm_atomic_get_new_private_obj_state().
> > > 
> > > 
> > > This function is being used in e.g. this call stack:
> > > ingenic_drm_crtc_atomic_enable -> ingenic_drm_get_priv_state ->
> > > drm_atomic_get_private_obj_state(). Please correct me if I'm wrong,
> > > doesn't it happen already after the state switch?
> > 
> > Looks like it should just use the get_new_state() there.
> > 
> > Hmm, I wonder if we should make the get_state() functions warn
> > (and maybe return NULL) if they get called after the state has
> > been swapped?
> 
> Might be.
> 
> Note: I just quickly git grepped the function and stumbled upon the
> first questionable use. There might be uther users which call it after
> swapping the state.

I tried to have a quick look at all the callers and didn't spot
other obviously wrong uses, but I can't guarantee that I didn't
miss some by accident.

> 
> > 
> > > 
> > > > 
> > > > Signed-off-by: Maxime Ripard <mripard@kernel.org>
> > > > ---
> > > >  drivers/gpu/drm/drm_atomic.c | 8 ++++----
> > > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > > 
> > > 
> > > -- 
> > > With best wishes
> > > Dmitry
> > 
> > -- 
> > Ville Syrjälä
> > Intel
> 
> -- 
> With best wishes
> Dmitry

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really)
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (36 preceding siblings ...)
  2025-09-02  9:35 ` [PATCH v2 37/37] drm/atomic: Document __drm_private_objs_state state pointer Maxime Ripard
@ 2025-09-02 14:29 ` Ville Syrjälä
  2025-09-03 19:09 ` Ville Syrjälä
  38 siblings, 0 replies; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-02 14:29 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, Dmitry Baryshkov, Louis Chauvet, Haneen Mohammed,
	Melissa Wen, Jyri Sarha, Tomi Valkeinen, Paul Cercueil,
	linux-mips, Liviu Dudau, Russell King, Manikandan Muralidharan,
	Dharma Balasubiramani, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, linux-arm-kernel, Inki Dae, Seung-Woo Kim,
	Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Liu Ying, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Anitha Chrisanthus, Edmund Dea,
	Paul Kocialkowski, Sui Jingfeng, Chun-Kuang Hu, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-mediatek, linux-kernel,
	Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica,
	"Zhang <"

On Tue, Sep 02, 2025 at 11:34:59AM +0200, Maxime Ripard wrote:
> Hi,
> 
> Here's a series to get rid of the drm_atomic_helper_get_existing_*_state
> accessors.
> 
> The initial intent was to remove the __drm_*_state->state pointer to
> only rely on old and new states, but we still need it now to know which
> of the two we need to free: if a state has not been committed (either
> dropped or checked only), then we need to free the new one, if it has
> been committed we need to free the old state. 
> 
> Thus, the state pointer is kept (and documented) only to point to the
> state we should free eventually.
> 
> All users have been converted to the relevant old or new state
> accessors.  
> 
> This was tested on tidss.
> 
> Let me know what you think,
> Maxime
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Other than the pre-existing ingenic private state issue that
Dmitry spotted I didn't see anything obviously wrong.

So apart from that the series is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
> Changes in v2:
> - Dropped the first and second patches
> - Reworked the recipient list to be nicer with SMTPs
> - Link to v1: https://lore.kernel.org/r/20250825-drm-no-more-existing-state-v1-0-f08ccd9f85c9@kernel.org
> 
> ---
> Maxime Ripard (37):
>       drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
>       drm/atomic: Remove unused drm_atomic_get_existing_connector_state()
>       drm/atomic: Document __drm_connectors_state state pointer
>       drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor
>       drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state
>       drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
>       drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()
>       drm/atomic: Remove unused drm_atomic_get_existing_plane_state()
>       drm/atomic: Document __drm_planes_state state pointer
>       drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state
>       drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
>       drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
>       drm/armada: Switch to drm_atomic_get_new_crtc_state()
>       drm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()
>       drm/exynos: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-dc: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()
>       drm/ingenic: Switch to drm_atomic_get_new_crtc_state()
>       drm/kmb: Switch to drm_atomic_get_new_crtc_state()
>       drm/logicvc: Switch to drm_atomic_get_new_crtc_state()
>       drm/loongson: Switch to drm_atomic_get_new_crtc_state()
>       drm/mediatek: Switch to drm_atomic_get_new_crtc_state()
>       drm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()
>       drm/omap: Switch to drm_atomic_get_new_crtc_state()
>       drm/rockchip: Switch to drm_atomic_get_new_crtc_state()
>       drm/sun4i: Switch to drm_atomic_get_new_crtc_state()
>       drm/tegra: Switch to drm_atomic_get_new_crtc_state()
>       drm/tilcdc: Switch to drm_atomic_get_new_crtc_state()
>       drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
>       drm/vc4: Switch to drm_atomic_get_new_crtc_state()
>       drm/atomic: Switch to drm_atomic_get_new_crtc_state()
>       drm/framebuffer: Switch to drm_atomic_get_new_crtc_state()
>       drm/atomic: Remove unused drm_atomic_get_existing_crtc_state()
>       drm/atomic: Document __drm_crtcs_state state pointer
>       drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
>       drm/atomic: Document __drm_private_objs_state state pointer
> 
>  drivers/gpu/drm/arm/malidp_planes.c             |   2 +-
>  drivers/gpu/drm/armada/armada_plane.c           |   3 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |   2 +-
>  drivers/gpu/drm/drm_atomic.c                    |  21 ++--
>  drivers/gpu/drm/drm_framebuffer.c               |   2 +-
>  drivers/gpu/drm/exynos/exynos_drm_plane.c       |   2 +-
>  drivers/gpu/drm/imx/dc/dc-plane.c               |   2 +-
>  drivers/gpu/drm/imx/dcss/dcss-plane.c           |   4 +-
>  drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c         |   3 +-
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c       |   3 +-
>  drivers/gpu/drm/ingenic/ingenic-ipu.c           |   4 +-
>  drivers/gpu/drm/kmb/kmb_plane.c                 |   3 +-
>  drivers/gpu/drm/logicvc/logicvc_layer.c         |   4 +-
>  drivers/gpu/drm/loongson/lsdc_plane.c           |   2 +-
>  drivers/gpu/drm/mediatek/mtk_plane.c            |   3 +-
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c      |   7 +-
>  drivers/gpu/drm/omapdrm/omap_plane.c            |   2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   6 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c    |   2 +-
>  drivers/gpu/drm/sun4i/sun8i_ui_layer.c          |   3 +-
>  drivers/gpu/drm/sun4i/sun8i_vi_layer.c          |   3 +-
>  drivers/gpu/drm/tegra/dc.c                      |   2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |   9 +-
>  drivers/gpu/drm/tilcdc/tilcdc_plane.c           |   3 +-
>  drivers/gpu/drm/vboxvideo/vbox_mode.c           |   8 +-
>  drivers/gpu/drm/vc4/vc4_plane.c                 |   6 +-
>  drivers/gpu/drm/vkms/vkms_crtc.c                |   4 +-
>  include/drm/drm_atomic.h                        | 144 ++++++++++++------------
>  28 files changed, 124 insertions(+), 135 deletions(-)
> ---
> base-commit: 7fa4d8dc380fbd81a9d702a855c50690c9c6442c
> change-id: 20250825-drm-no-more-existing-state-9b3252c1a33b
> 
> Best regards,
> -- 
> Maxime Ripard <mripard@kernel.org>

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 12/37] drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 12/37] drm/arm/malidp: " Maxime Ripard
@ 2025-09-02 15:47   ` Liviu Dudau
  0 siblings, 0 replies; 55+ messages in thread
From: Liviu Dudau @ 2025-09-02 15:47 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel

On Tue, Sep 02, 2025 at 11:35:11AM +0200, Maxime Ripard wrote:
> The malidp atomic_check implementation uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before the
> states are swapped. The existing state thus points to the new state, and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> 
> ---
> To: Liviu Dudau <liviu.dudau@arm.com>
> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 87f2e5ee87907403fac5386042bd6f313397ba03..f1a5014bcfa1058072e13f1ad8e84c85f52fb156 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -261,11 +261,11 @@ static const struct drm_plane_funcs malidp_de_plane_funcs = {
>  
>  static int malidp_se_check_scaling(struct malidp_plane *mp,
>  				   struct drm_plane_state *state)
>  {
>  	struct drm_crtc_state *crtc_state =
> -		drm_atomic_get_existing_crtc_state(state->state, state->crtc);
> +		drm_atomic_get_new_crtc_state(state->state, state->crtc);
>  	struct malidp_crtc_state *mc;
>  	u32 src_w, src_h;
>  	int ret;
>  
>  	if (!crtc_state)
> 
> -- 
> 2.50.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state() Maxime Ripard
@ 2025-09-03 19:03   ` Paul Cercueil
  0 siblings, 0 replies; 55+ messages in thread
From: Paul Cercueil @ 2025-09-03 19:03 UTC (permalink / raw)
  To: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: dri-devel, linux-mips

Le mardi 02 septembre 2025 à 11:35 +0200, Maxime Ripard a écrit :
> The ingenic IPU atomic_set_property implementation uses the
> deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called during the state building process, before
> atomic_check, and thus before the states are swapped. The existing
> state
> thus points to the new state, and we can use
> drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Tested it and my screen still works.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>

and/or:

Tested-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> 
> ---
> To: Paul Cercueil <paul@crapouillou.net>
> Cc: linux-mips@vger.kernel.org
> ---
>  drivers/gpu/drm/ingenic/ingenic-ipu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c
> b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> index
> 26ebf424d63ec21ccee80221745c3e8bcc6b3d7f..2574a4b4d40a2c27cb212114117
> 829d9f6ab3ddb 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> @@ -703,11 +703,11 @@ ingenic_ipu_plane_atomic_set_property(struct
> drm_plane *plane,
>  
>  	mode_changed = val != ipu->sharpness;
>  	ipu->sharpness = val;
>  
>  	if (state->crtc) {
> -		crtc_state =
> drm_atomic_get_existing_crtc_state(state->state, state->crtc);
> +		crtc_state = drm_atomic_get_new_crtc_state(state-
> >state, state->crtc);
>  		if (WARN_ON(!crtc_state))
>  			return -EINVAL;
>  
>  		crtc_state->mode_changed |= mode_changed;
>  	}

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

* Re: [PATCH v2 19/37] drm/ingenic: Switch to drm_atomic_get_new_crtc_state()
  2025-09-02  9:35 ` [PATCH v2 19/37] drm/ingenic: " Maxime Ripard
@ 2025-09-03 19:04   ` Paul Cercueil
  0 siblings, 0 replies; 55+ messages in thread
From: Paul Cercueil @ 2025-09-03 19:04 UTC (permalink / raw)
  To: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter
  Cc: dri-devel, linux-mips

Hi Maxime,

Le mardi 02 septembre 2025 à 11:35 +0200, Maxime Ripard a écrit :
> The ingenic atomic_check implementation uses the deprecated
> drm_atomic_get_existing_crtc_state() helper.
> 
> This hook is called as part of the global atomic_check, thus before
> the
> states are swapped. The existing state thus points to the new state,
> and
> we can use drm_atomic_get_new_crtc_state() instead.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

Reviewed-by: Paul Cercueil <paul@crapouillou.net>

and/or:

Tested-by: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> 
> ---
> To: Paul Cercueil <paul@crapouillou.net>
> Cc: linux-mips@vger.kernel.org
> ---
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +--
>  drivers/gpu/drm/ingenic/ingenic-ipu.c     | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index
> 9db1ceaed5188a4ef0897280dc72108eb3815b5f..05faed933e5619c796f2a4fa190
> 6e0eaa029ac68 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> @@ -469,12 +469,11 @@ static int
> ingenic_drm_plane_atomic_check(struct drm_plane *plane,
>  		return 0;
>  
>  	if (priv->soc_info->plane_f0_not_working && plane == &priv-
> >f0)
>  		return -EINVAL;
>  
> -	crtc_state = drm_atomic_get_existing_crtc_state(state,
> -							crtc);
> +	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>  	if (WARN_ON(!crtc_state))
>  		return -EINVAL;
>  
>  	priv_state = ingenic_drm_get_priv_state(priv, state);
>  	if (IS_ERR(priv_state))
> diff --git a/drivers/gpu/drm/ingenic/ingenic-ipu.c
> b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> index
> 2574a4b4d40a2c27cb212114117829d9f6ab3ddb..32638a713241abbd4eaed09f0aa
> ec2b790650cc9 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-ipu.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-ipu.c
> @@ -578,11 +578,11 @@ static int
> ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
>  	struct ingenic_ipu_private_state *ipu_state;
>  
>  	if (!crtc)
>  		return 0;
>  
> -	crtc_state = drm_atomic_get_existing_crtc_state(state,
> crtc);
> +	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>  	if (WARN_ON(!crtc_state))
>  		return -EINVAL;
>  
>  	ipu_state = ingenic_ipu_get_priv_state(ipu, state);
>  	if (IS_ERR(ipu_state))

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

* Re: [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really)
  2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
                   ` (37 preceding siblings ...)
  2025-09-02 14:29 ` [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Ville Syrjälä
@ 2025-09-03 19:09 ` Ville Syrjälä
  38 siblings, 0 replies; 55+ messages in thread
From: Ville Syrjälä @ 2025-09-03 19:09 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, Dmitry Baryshkov, Louis Chauvet, Haneen Mohammed,
	Melissa Wen, Jyri Sarha, Tomi Valkeinen, Paul Cercueil,
	linux-mips, Liviu Dudau, Russell King, Manikandan Muralidharan,
	Dharma Balasubiramani, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, linux-arm-kernel, Inki Dae, Seung-Woo Kim,
	Kyungmin Park, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Liu Ying, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, Laurentiu Palcu,
	Lucas Stach, Philipp Zabel, Anitha Chrisanthus, Edmund Dea,
	Paul Kocialkowski, Sui Jingfeng, Chun-Kuang Hu, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-mediatek, linux-kernel,
	Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, linux-arm-msm, freedreno, Sandy Huang,
	Heiko Stübner, Andy Yan, linux-rockchip, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, linux-sunxi, Thierry Reding,
	Mikko Perttunen, Jonathan Hunter, linux-tegra, Hans de Goede,
	Dave Stevenson, Maíra Canal, Raspberry Pi Kernel Maintenance

On Tue, Sep 02, 2025 at 11:34:59AM +0200, Maxime Ripard wrote:
> Hi,
> 
> Here's a series to get rid of the drm_atomic_helper_get_existing_*_state
> accessors.
> 
> The initial intent was to remove the __drm_*_state->state pointer to
> only rely on old and new states, but we still need it now to know which
> of the two we need to free: if a state has not been committed (either
> dropped or checked only), then we need to free the new one, if it has
> been committed we need to free the old state. 
> 
> Thus, the state pointer is kept (and documented) only to point to the
> state we should free eventually.
> 
> All users have been converted to the relevant old or new state
> accessors.  
> 
> This was tested on tidss.
> 
> Let me know what you think,
> Maxime
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

<replying again to see if my smtp issues are now solved...>

Other than the pre-existing ingenic private state issue that
Dmitry spotted I didn't see anything obviously wrong.

So apart from that the series is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
> Changes in v2:
> - Dropped the first and second patches
> - Reworked the recipient list to be nicer with SMTPs
> - Link to v1: https://lore.kernel.org/r/20250825-drm-no-more-existing-state-v1-0-f08ccd9f85c9@kernel.org
> 
> ---
> Maxime Ripard (37):
>       drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
>       drm/atomic: Remove unused drm_atomic_get_existing_connector_state()
>       drm/atomic: Document __drm_connectors_state state pointer
>       drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor
>       drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state
>       drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
>       drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()
>       drm/atomic: Remove unused drm_atomic_get_existing_plane_state()
>       drm/atomic: Document __drm_planes_state state pointer
>       drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state
>       drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
>       drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
>       drm/armada: Switch to drm_atomic_get_new_crtc_state()
>       drm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()
>       drm/exynos: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-dc: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
>       drm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()
>       drm/ingenic: Switch to drm_atomic_get_new_crtc_state()
>       drm/kmb: Switch to drm_atomic_get_new_crtc_state()
>       drm/logicvc: Switch to drm_atomic_get_new_crtc_state()
>       drm/loongson: Switch to drm_atomic_get_new_crtc_state()
>       drm/mediatek: Switch to drm_atomic_get_new_crtc_state()
>       drm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()
>       drm/omap: Switch to drm_atomic_get_new_crtc_state()
>       drm/rockchip: Switch to drm_atomic_get_new_crtc_state()
>       drm/sun4i: Switch to drm_atomic_get_new_crtc_state()
>       drm/tegra: Switch to drm_atomic_get_new_crtc_state()
>       drm/tilcdc: Switch to drm_atomic_get_new_crtc_state()
>       drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
>       drm/vc4: Switch to drm_atomic_get_new_crtc_state()
>       drm/atomic: Switch to drm_atomic_get_new_crtc_state()
>       drm/framebuffer: Switch to drm_atomic_get_new_crtc_state()
>       drm/atomic: Remove unused drm_atomic_get_existing_crtc_state()
>       drm/atomic: Document __drm_crtcs_state state pointer
>       drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state
>       drm/atomic: Document __drm_private_objs_state state pointer
> 
>  drivers/gpu/drm/arm/malidp_planes.c             |   2 +-
>  drivers/gpu/drm/armada/armada_plane.c           |   3 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c |   2 +-
>  drivers/gpu/drm/drm_atomic.c                    |  21 ++--
>  drivers/gpu/drm/drm_framebuffer.c               |   2 +-
>  drivers/gpu/drm/exynos/exynos_drm_plane.c       |   2 +-
>  drivers/gpu/drm/imx/dc/dc-plane.c               |   2 +-
>  drivers/gpu/drm/imx/dcss/dcss-plane.c           |   4 +-
>  drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c         |   3 +-
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c       |   3 +-
>  drivers/gpu/drm/ingenic/ingenic-ipu.c           |   4 +-
>  drivers/gpu/drm/kmb/kmb_plane.c                 |   3 +-
>  drivers/gpu/drm/logicvc/logicvc_layer.c         |   4 +-
>  drivers/gpu/drm/loongson/lsdc_plane.c           |   2 +-
>  drivers/gpu/drm/mediatek/mtk_plane.c            |   3 +-
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c      |   7 +-
>  drivers/gpu/drm/omapdrm/omap_plane.c            |   2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |   6 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_vop2.c    |   2 +-
>  drivers/gpu/drm/sun4i/sun8i_ui_layer.c          |   3 +-
>  drivers/gpu/drm/sun4i/sun8i_vi_layer.c          |   3 +-
>  drivers/gpu/drm/tegra/dc.c                      |   2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |   9 +-
>  drivers/gpu/drm/tilcdc/tilcdc_plane.c           |   3 +-
>  drivers/gpu/drm/vboxvideo/vbox_mode.c           |   8 +-
>  drivers/gpu/drm/vc4/vc4_plane.c                 |   6 +-
>  drivers/gpu/drm/vkms/vkms_crtc.c                |   4 +-
>  include/drm/drm_atomic.h                        | 144 ++++++++++++------------
>  28 files changed, 124 insertions(+), 135 deletions(-)
> ---
> base-commit: 7fa4d8dc380fbd81a9d702a855c50690c9c6442c
> change-id: 20250825-drm-no-more-existing-state-9b3252c1a33b
> 
> Best regards,
> -- 
> Maxime Ripard <mripard@kernel.org>

-- 
Ville Syrjälä
Intel

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

end of thread, other threads:[~2025-09-03 19:11 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02  9:34 [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 01/37] drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state Maxime Ripard
2025-09-02 13:08   ` Dmitry Baryshkov
2025-09-02  9:35 ` [PATCH v2 02/37] drm/atomic: Remove unused drm_atomic_get_existing_connector_state() Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 03/37] drm/atomic: Document __drm_connectors_state state pointer Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 04/37] drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 05/37] drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 06/37] drm/vkms: Convert vkms_crtc_atomic_check() " Maxime Ripard
2025-09-02 14:19   ` Ville Syrjälä
2025-09-02  9:35 ` [PATCH v2 07/37] drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane() Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 08/37] drm/atomic: Remove unused drm_atomic_get_existing_plane_state() Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 09/37] drm/atomic: Document __drm_planes_state state pointer Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 10/37] drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 11/37] drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state() Maxime Ripard
2025-09-03 19:03   ` Paul Cercueil
2025-09-02  9:35 ` [PATCH v2 12/37] drm/arm/malidp: " Maxime Ripard
2025-09-02 15:47   ` Liviu Dudau
2025-09-02  9:35 ` [PATCH v2 13/37] drm/armada: " Maxime Ripard
2025-09-02 14:20   ` Ville Syrjälä
2025-09-02  9:35 ` [PATCH v2 14/37] drm/atmel-hlcdc: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 15/37] drm/exynos: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 16/37] drm/imx-dc: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 17/37] drm/imx-dcss: " Maxime Ripard
2025-09-02 11:45   ` Laurentiu Palcu
2025-09-02  9:35 ` [PATCH v2 18/37] drm/imx-ipuv3: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 19/37] drm/ingenic: " Maxime Ripard
2025-09-03 19:04   ` Paul Cercueil
2025-09-02  9:35 ` [PATCH v2 20/37] drm/kmb: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 21/37] drm/logicvc: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 22/37] drm/loongson: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 23/37] drm/mediatek: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 24/37] drm/msm/mdp5: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 25/37] drm/omap: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 26/37] drm/rockchip: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 27/37] drm/sun4i: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 28/37] drm/tegra: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 29/37] drm/tilcdc: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 30/37] drm/vboxvideo: " Maxime Ripard
2025-09-02  9:39   ` Hans de Goede
2025-09-02  9:35 ` [PATCH v2 31/37] drm/vc4: " Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 32/37] drm/atomic: " Maxime Ripard
2025-09-02 13:21   ` Dmitry Baryshkov
2025-09-02  9:35 ` [PATCH v2 33/37] drm/framebuffer: " Maxime Ripard
2025-09-02 13:22   ` Dmitry Baryshkov
2025-09-02  9:35 ` [PATCH v2 34/37] drm/atomic: Remove unused drm_atomic_get_existing_crtc_state() Maxime Ripard
2025-09-02 13:22   ` Dmitry Baryshkov
2025-09-02  9:35 ` [PATCH v2 35/37] drm/atomic: Document __drm_crtcs_state state pointer Maxime Ripard
2025-09-02  9:35 ` [PATCH v2 36/37] drm/atomic: Convert drm_atomic_get_private_obj_state() to use new plane state Maxime Ripard
2025-09-02 13:25   ` Dmitry Baryshkov
2025-09-02 14:14     ` Ville Syrjälä
2025-09-02 14:17       ` Dmitry Baryshkov
2025-09-02 14:27         ` Ville Syrjälä
2025-09-02  9:35 ` [PATCH v2 37/37] drm/atomic: Document __drm_private_objs_state state pointer Maxime Ripard
2025-09-02 14:29 ` [PATCH v2 00/37] drm/atomic: Get rid of existing states (not really) Ville Syrjälä
2025-09-03 19:09 ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).