]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/atomic-helper: Change parameter name of drm_atomic_helper_commit_modeset_enables()
authorMaxime Ripard <mripard@kernel.org>
Thu, 13 Feb 2025 14:43:36 +0000 (15:43 +0100)
committerMaxime Ripard <mripard@kernel.org>
Wed, 19 Feb 2025 15:59:19 +0000 (16:59 +0100)
drm_atomic_helper_commit_modeset_enables() enables all outputs 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.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250213-bridge-connector-v3-17-e71598f49c8f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/drm_atomic_helper.c

index 08ce7a0a829af3e5e793a8256c1d920e78bb7601..e41045cc7e39c822c0332a73a1742b603ac383dc 100644 (file)
@@ -1486,7 +1486,7 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
 /**
  * drm_atomic_helper_commit_modeset_enables - modeset commit to enable outputs
  * @dev: DRM device
- * @old_state: atomic state object with old state structures
+ * @state: atomic state object being committed
  *
  * This function enables all the outputs with the new configuration which had to
  * be turned off for the update.
@@ -1498,7 +1498,7 @@ static void drm_atomic_helper_commit_writebacks(struct drm_device *dev,
  * PM since planes updates then only happen when the CRTC is actually enabled.
  */
 void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
-                                             struct drm_atomic_state *old_state)
+                                             struct drm_atomic_state *state)
 {
        struct drm_crtc *crtc;
        struct drm_crtc_state *old_crtc_state;
@@ -1507,7 +1507,7 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
        struct drm_connector_state *new_conn_state;
        int i;
 
-       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;
 
                /* Need to filter out CRTCs where only planes change. */
@@ -1523,13 +1523,13 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
                        drm_dbg_atomic(dev, "enabling [CRTC:%d:%s]\n",
                                       crtc->base.id, crtc->name);
                        if (funcs->atomic_enable)
-                               funcs->atomic_enable(crtc, old_state);
+                               funcs->atomic_enable(crtc, state);
                        else if (funcs->commit)
                                funcs->commit(crtc);
                }
        }
 
-       for_each_new_connector_in_state(old_state, connector, new_conn_state, i) {
+       for_each_new_connector_in_state(state, connector, new_conn_state, i) {
                const struct drm_encoder_helper_funcs *funcs;
                struct drm_encoder *encoder;
                struct drm_bridge *bridge;
@@ -1552,21 +1552,21 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
                 * it away), so we won't call enable hooks twice.
                 */
                bridge = drm_bridge_chain_get_first_bridge(encoder);
-               drm_atomic_bridge_chain_pre_enable(bridge, old_state);
+               drm_atomic_bridge_chain_pre_enable(bridge, state);
 
                if (funcs) {
                        if (funcs->atomic_enable)
-                               funcs->atomic_enable(encoder, old_state);
+                               funcs->atomic_enable(encoder, state);
                        else if (funcs->enable)
                                funcs->enable(encoder);
                        else if (funcs->commit)
                                funcs->commit(encoder);
                }
 
-               drm_atomic_bridge_chain_enable(bridge, old_state);
+               drm_atomic_bridge_chain_enable(bridge, state);
        }
 
-       drm_atomic_helper_commit_writebacks(dev, old_state);
+       drm_atomic_helper_commit_writebacks(dev, state);
 }
 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_enables);