mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	 Simona Vetter <simona@ffwll.ch>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	 Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	 Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	 Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Douglas Anderson <dianders@chromium.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Maxime Ripard <mripard@kernel.org>
Subject: [PATCH v2 16/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_planes()
Date: Tue, 04 Feb 2025 15:57:44 +0100	[thread overview]
Message-ID: <20250204-bridge-connector-v2-16-35dd6c834e08@kernel.org> (raw)
In-Reply-To: <20250204-bridge-connector-v2-0-35dd6c834e08@kernel.org>

drm_atomic_helper_commit_planes() updates all planes affected by a new
commit. It takes the drm_atomic_state being committed as a parameter.

However, that parameter name is called (and documented) as old_state,
which is pretty confusing. Let's rename that variable as state.

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

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 55c91f2821d550c8af52b71d8f452e0fdee997e4..9f3cf5df0dd810e3725bf44a02a9574f676f17de 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2719,19 +2719,19 @@ static bool plane_crtc_active(const struct drm_plane_state *state)
 }
 
 /**
  * drm_atomic_helper_commit_planes - commit plane state
  * @dev: DRM device
- * @old_state: atomic state object with old state structures
+ * @state: atomic state object being committed
  * @flags: flags for committing plane state
  *
  * This function commits the new plane state using the plane and atomic helper
  * functions for planes and CRTCs. It assumes that the atomic state has already
  * been pushed into the relevant object state pointers, since this step can no
  * longer fail.
  *
- * It still requires the global state object @old_state to know which planes and
+ * It still requires the global state object @state to know which planes and
  * crtcs need to be updated though.
  *
  * Note that this function does all plane updates across all CRTCs in one step.
  * If the hardware can't support this approach look at
  * drm_atomic_helper_commit_planes_on_crtc() instead.
@@ -2758,36 +2758,36 @@ static bool plane_crtc_active(const struct drm_plane_state *state)
  * The drm_atomic_helper_commit() default implementation doesn't set the
  * ACTIVE_ONLY flag to most closely match the behaviour of the legacy helpers.
  * This should not be copied blindly by drivers.
  */
 void drm_atomic_helper_commit_planes(struct drm_device *dev,
-				     struct drm_atomic_state *old_state,
+				     struct drm_atomic_state *state,
 				     uint32_t flags)
 {
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *old_crtc_state, *new_crtc_state;
 	struct drm_plane *plane;
 	struct drm_plane_state *old_plane_state, *new_plane_state;
 	int i;
 	bool active_only = flags & DRM_PLANE_COMMIT_ACTIVE_ONLY;
 	bool no_disable = flags & DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET;
 
-	for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
+	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		const struct drm_crtc_helper_funcs *funcs;
 
 		funcs = crtc->helper_private;
 
 		if (!funcs || !funcs->atomic_begin)
 			continue;
 
 		if (active_only && !new_crtc_state->active)
 			continue;
 
-		funcs->atomic_begin(crtc, old_state);
+		funcs->atomic_begin(crtc, state);
 	}
 
-	for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) {
+	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
 		const struct drm_plane_helper_funcs *funcs;
 		bool disabling;
 
 		funcs = plane->helper_private;
 
@@ -2821,40 +2821,40 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
 
 			if (drm_atomic_crtc_needs_modeset(crtc_state) &&
 			    no_disable)
 				continue;
 
-			funcs->atomic_disable(plane, old_state);
+			funcs->atomic_disable(plane, state);
 		} else if (new_plane_state->crtc || disabling) {
-			funcs->atomic_update(plane, old_state);
+			funcs->atomic_update(plane, state);
 
 			if (!disabling && funcs->atomic_enable) {
 				if (drm_atomic_plane_enabling(old_plane_state, new_plane_state))
-					funcs->atomic_enable(plane, old_state);
+					funcs->atomic_enable(plane, state);
 			}
 		}
 	}
 
-	for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
+	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		const struct drm_crtc_helper_funcs *funcs;
 
 		funcs = crtc->helper_private;
 
 		if (!funcs || !funcs->atomic_flush)
 			continue;
 
 		if (active_only && !new_crtc_state->active)
 			continue;
 
-		funcs->atomic_flush(crtc, old_state);
+		funcs->atomic_flush(crtc, state);
 	}
 
 	/*
 	 * Signal end of framebuffer access here before hw_done. After hw_done,
 	 * a later commit might have already released the plane state.
 	 */
-	for_each_old_plane_in_state(old_state, plane, old_plane_state, i) {
+	for_each_old_plane_in_state(state, plane, old_plane_state, i) {
 		const struct drm_plane_helper_funcs *funcs = plane->helper_private;
 
 		if (funcs->end_fb_access)
 			funcs->end_fb_access(plane, old_plane_state);
 	}

-- 
2.48.0


  parent reply	other threads:[~2025-02-04 14:59 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 14:57 [PATCH v2 00/35] drm/bridge: Various quality of life improvements Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 01/35] drm/atomic: Document history of drm_atomic_state Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 02/35] drm/bridge: Pass full state to atomic_pre_enable Maxime Ripard
2025-02-05  2:53   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 03/35] drm/bridge: Pass full state to atomic_enable Maxime Ripard
2025-02-05  2:54   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 04/35] drm/bridge: Pass full state to atomic_disable Maxime Ripard
2025-02-05  3:19   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 05/35] drm/bridge: Pass full state to atomic_post_disable Maxime Ripard
2025-02-08  5:19   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 06/35] drm/atomic-helper: Fix commit_tail state variable name Maxime Ripard
2025-02-09  1:20   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 07/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_wait_for_dependencies() Maxime Ripard
2025-02-09  2:01   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 08/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_tail() Maxime Ripard
2025-02-09  2:03   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 09/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_tail_rpm() Maxime Ripard
2025-02-09  2:03   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 10/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_modeset_disables() Maxime Ripard
2025-02-09  2:11   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 11/35] drm/atomic-helper: Change parameter name of disable_outputs() Maxime Ripard
2025-02-09  2:12   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 12/35] drm/bridge: Change parameter name of drm_atomic_bridge_chain_disable() Maxime Ripard
2025-02-09  2:45   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 13/35] drm/bridge: Change parameter name of drm_atomic_bridge_chain_post_disable() Maxime Ripard
2025-02-08  1:08   ` Doug Anderson
2025-02-04 14:57 ` [PATCH v2 14/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_update_legacy_modeset_state() Maxime Ripard
2025-02-09  5:08   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 15/35] drm/atomic-helper: Change parameter name of crtc_set_mode() Maxime Ripard
2025-02-09  5:08   ` Dmitry Baryshkov
2025-02-04 14:57 ` Maxime Ripard [this message]
2025-02-04 14:57 ` [PATCH v2 17/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_modeset_enables() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 18/35] drm/bridge: Change parameter name of drm_atomic_bridge_chain_pre_enable() Maxime Ripard
2025-02-08  1:08   ` Doug Anderson
2025-02-04 14:57 ` [PATCH v2 19/35] drm/bridge: Change parameter name of drm_atomic_bridge_chain_enable() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 20/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_writebacks() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 21/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_fake_vblank() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 22/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_hw_done() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 23/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_wait_for_vblanks() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 24/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_cleanup_planes() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 25/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_cleanup_done() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 26/35] drm/atomic-helper: Change parameter name of drm_atomic_helper_wait_for_flip_done() Maxime Ripard
2025-02-04 14:57 ` [PATCH v2 27/35] drm/bridge: Add encoder parameter to drm_bridge_funcs.attach Maxime Ripard
2025-02-09  6:18   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 28/35] drm/bridge: Provide a helper to retrieve current bridge state Maxime Ripard
2025-02-09  6:12   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 29/35] drm/bridge: Assume that a bridge is atomic if it has atomic_reset Maxime Ripard
2025-02-09  6:18   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 30/35] drm/bridge: Provide pointers to the connector and crtc in bridge state Maxime Ripard
2025-02-09  7:00   ` Dmitry Baryshkov
2025-02-04 14:57 ` [PATCH v2 31/35] drm/bridge: Make encoder pointer deprecated Maxime Ripard
2025-02-09  7:01   ` Dmitry Baryshkov
2025-02-04 14:58 ` [PATCH v2 32/35] drm/bridge: cdns-csi: Switch to atomic helpers Maxime Ripard
2025-02-09  7:06   ` Dmitry Baryshkov
2025-02-04 14:58 ` [PATCH v2 33/35] drm/bridge: tc358775: Switch to atomic commit Maxime Ripard
2025-02-09  7:07   ` Dmitry Baryshkov
2025-02-04 14:58 ` [PATCH v2 34/35] drm/bridge: tc358768: Convert to atomic helpers Maxime Ripard
2025-02-09  7:13   ` Dmitry Baryshkov
2025-02-11 14:33     ` Maxime Ripard
2025-02-12  0:38       ` Dmitry Baryshkov
2025-02-12  8:24         ` Maxime Ripard
2025-02-12 10:51           ` Dmitry Baryshkov
2025-02-04 14:58 ` [PATCH v2 35/35] drm/bridge: ti-sn65dsi86: Use bridge_state crtc pointer Maxime Ripard
2025-02-08  1:44   ` Doug Anderson
2025-02-11 13:14     ` Maxime Ripard
2025-02-11 17:52       ` Doug Anderson
2025-02-11 22:16   ` Doug Anderson
2025-02-12 15:14     ` Doug Anderson
2025-02-09  3:27 ` [PATCH v2 00/35] drm/bridge: Various quality of life improvements Dmitry Baryshkov
2025-02-11 13:17   ` Maxime Ripard
2025-02-12  0:51     ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250204-bridge-connector-v2-16-35dd6c834e08@kernel.org \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®