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 <mrip...@kernel.org>
---
 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

Reply via email to