]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/atomic-helper: Change parameter name of drm_atomic_helper_wait_for_vblanks()
authorMaxime Ripard <mripard@kernel.org>
Thu, 13 Feb 2025 14:43:42 +0000 (15:43 +0100)
committerMaxime Ripard <mripard@kernel.org>
Wed, 19 Feb 2025 15:59:22 +0000 (16:59 +0100)
drm_atomic_helper_wait_for_vblanks() waits for vblank events on all the
CRTCs affected by a 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-23-e71598f49c8f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/drm_atomic_helper.c

index 15937860e406281003de53ce3c3ec2a3a30531eb..8f290535c861d2d346ba50f79d4ac32231558ef0 100644 (file)
@@ -1668,7 +1668,7 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_fences);
 /**
  * drm_atomic_helper_wait_for_vblanks - wait for vblank on CRTCs
  * @dev: DRM device
- * @old_state: atomic state object with old state structures
+ * @state: atomic state object being committed
  *
  * Helper to, after atomic commit, wait for vblanks on all affected
  * CRTCs (ie. before cleaning up old framebuffers using
@@ -1682,7 +1682,7 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_fences);
  */
 void
 drm_atomic_helper_wait_for_vblanks(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, *new_crtc_state;
@@ -1693,10 +1693,10 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
          * Legacy cursor ioctls are completely unsynced, and userspace
          * relies on that (by doing tons of cursor updates).
          */
-       if (old_state->legacy_cursor_update)
+       if (state->legacy_cursor_update)
                return;
 
-       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) {
                if (!new_crtc_state->active)
                        continue;
 
@@ -1705,17 +1705,17 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
                        continue;
 
                crtc_mask |= drm_crtc_mask(crtc);
-               old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc);
+               state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc);
        }
 
-       for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) {
+       for_each_old_crtc_in_state(state, crtc, old_crtc_state, i) {
                if (!(crtc_mask & drm_crtc_mask(crtc)))
                        continue;
 
                ret = wait_event_timeout(dev->vblank[i].queue,
-                               old_state->crtcs[i].last_vblank_count !=
-                                       drm_crtc_vblank_count(crtc),
-                               msecs_to_jiffies(100));
+                                        state->crtcs[i].last_vblank_count !=
+                                               drm_crtc_vblank_count(crtc),
+                                        msecs_to_jiffies(100));
 
                WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
                     crtc->base.id, crtc->name);