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

Reply via email to