]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm: Use the state pointer directly in planes atomic_check
authorMaxime Ripard <maxime@cerno.tech>
Fri, 19 Feb 2021 12:00:25 +0000 (13:00 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 24 Feb 2021 19:27:03 +0000 (20:27 +0100)
Now that atomic_check takes the global atomic state as a parameter, we
don't need to go through the pointer in the plane state.

This was done using the following coccinelle script:

@ plane_atomic_func @
identifier helpers;
identifier func;
@@

static struct drm_plane_helper_funcs helpers = {
...,
.atomic_check = func,
...,
};

@@
identifier plane_atomic_func.func;
identifier plane, state;
identifier plane_state;
@@

  func(struct drm_plane *plane, struct drm_atomic_state *state) {
  ...
- struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
  <... when != plane_state
- plane_state->state
+ state
  ...>
 }

@@
identifier plane_atomic_func.func;
identifier plane, state;
identifier plane_state;
@@

  func(struct drm_plane *plane, struct drm_atomic_state *state) {
  ...
  struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
  <...
- plane_state->state
+ state
  ...>
 }

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210219120032.260676-5-maxime@cerno.tech
35 files changed:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/arm/display/komeda/komeda_plane.c
drivers/gpu/drm/arm/hdlcd_crtc.c
drivers/gpu/drm/armada/armada_plane.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
drivers/gpu/drm/drm_simple_kms_helper.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
drivers/gpu/drm/imx/dcss/dcss-plane.c
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
drivers/gpu/drm/ingenic/ingenic-ipu.c
drivers/gpu/drm/kmb/kmb_plane.c
drivers/gpu/drm/mediatek/mtk_drm_plane.c
drivers/gpu/drm/meson/meson_overlay.c
drivers/gpu/drm/meson/meson_plane.c
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
drivers/gpu/drm/mxsfb/mxsfb_kms.c
drivers/gpu/drm/omapdrm/omap_plane.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/sti/sti_cursor.c
drivers/gpu/drm/sti/sti_gdp.c
drivers/gpu/drm/sti/sti_hqvdp.c
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
drivers/gpu/drm/tidss/tidss_plane.c
drivers/gpu/drm/tilcdc/tilcdc_plane.c
drivers/gpu/drm/vboxvideo/vbox_mode.c
drivers/gpu/drm/virtio/virtgpu_plane.c
drivers/gpu/drm/vkms/vkms_plane.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/gpu/drm/xlnx/zynqmp_disp.c
drivers/gpu/drm/zte/zx_plane.c

index 1cdff048b0c025272a54d0a3e65125bbfc84eae4..22124f76d0b5c3b663dcbfac95608772b5802421 100644 (file)
@@ -6451,7 +6451,7 @@ static int dm_plane_atomic_check(struct drm_plane *plane,
                return 0;
 
        new_crtc_state =
-               drm_atomic_get_new_crtc_state(new_plane_state->state,
+               drm_atomic_get_new_crtc_state(state,
                                              new_plane_state->crtc);
        if (!new_crtc_state)
                return -EINVAL;
index 96a6fe95a4e75b8af03a11bed77b26a03649933e..13582c174bbbac11478ad390e77d54f413d45dad 100644 (file)
@@ -84,7 +84,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc || !new_plane_state->fb)
                return 0;
 
-       crtc_st = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_st = drm_atomic_get_crtc_state(state,
                                            new_plane_state->crtc);
        if (IS_ERR(crtc_st) || !crtc_st->enable) {
                DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n");
index 9da9d0581ce9aa988fd08ad2788f814c7b890230..028ec39c84843eff1b25177700a3f15d5ce86aa5 100644 (file)
@@ -244,7 +244,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
                return -EINVAL;
        }
 
-       for_each_new_crtc_in_state(new_plane_state->state, crtc, crtc_state,
+       for_each_new_crtc_in_state(state, crtc, crtc_state,
                                   i) {
                /* we cannot disable the plane while the CRTC is active */
                if (!new_plane_state->fb && crtc_state->active)
index b1266c58810285b64858ee260eef05e5c9719052..51f33c689df304bdbb0f4bb84b95da0e6a68fbd0 100644 (file)
@@ -121,8 +121,8 @@ int armada_drm_plane_atomic_check(struct drm_plane *plane,
                return 0;
        }
 
-       if (new_plane_state->state)
-               crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       if (state)
+               crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                                crtc);
        else
                crtc_state = crtc->state;
index cb8650142f138a3106d8bc97d17bfb886f74216c..d3c4a1f6aede7ea01414d1df5d2e2c950a818c20 100644 (file)
@@ -547,7 +547,7 @@ static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_new_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_new_crtc_state(state,
                                                   new_plane_state->crtc);
 
        ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
@@ -769,7 +769,7 @@ static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_new_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_new_crtc_state(state,
                                                   new_plane_state->crtc);
 
        ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
index 445105e75a97d39513ed6bc8c53361aba38814e7..a32d45bcc386ae998f473633e40be1637e381285 100644 (file)
@@ -609,7 +609,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
        if (!hstate->base.crtc || WARN_ON(!fb))
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(s->state, s->crtc);
+       crtc_state = drm_atomic_get_existing_crtc_state(state, s->crtc);
        mode = &crtc_state->adjusted_mode;
 
        ret = drm_atomic_helper_check_plane_state(s, crtc_state,
index a43e34e04d6b074981b749525a114b96f750d681..7f3d90e776a370a530bd708cf233d3fc128b97e9 100644 (file)
@@ -186,7 +186,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,
        int ret;
 
        pipe = container_of(plane, struct drm_simple_display_pipe, plane);
-       crtc_state = drm_atomic_get_new_crtc_state(plane_state->state,
+       crtc_state = drm_atomic_get_new_crtc_state(state,
                                                   &pipe->crtc);
 
        ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
index ddcf121af54219e5303d2259c87a7cdf4cca8739..3f7027e40c796108388012055ad3e2e996219c27 100644 (file)
@@ -66,7 +66,7 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane,
        if (!crtc || !fb)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
 
index fab083380ef71c64d37b0617169ef4feec3c06e8..320631cb7034232b60e87e56d1f627126688a91c 100644 (file)
@@ -781,7 +781,7 @@ static int ade_plane_atomic_check(struct drm_plane *plane,
        if (fmt == ADE_FORMAT_UNSUPPORT)
                return -EINVAL;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
 
index 3222fb03b88774c8e7cb98d9223c404208df12f3..b8f24804b379184cb059c6e2da81f7c213d908cc 100644 (file)
@@ -157,7 +157,7 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
        cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
        WARN_ON(!cma_obj);
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        new_plane_state->crtc);
 
        hdisplay = crtc_state->adjusted_mode.hdisplay;
index 57cd85973593b3fd06cf1ddf412dcd6c635e4e30..b69ebf41f57076baa63b259a3b845bfef1adeffb 100644 (file)
@@ -358,7 +358,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
                return -EINVAL;
 
        crtc_state =
-               drm_atomic_get_existing_crtc_state(new_state->state,
+               drm_atomic_get_existing_crtc_state(state,
                                                   new_state->crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index 77b0ec7183c70c17e5e068a5909f1602a9a8d6d5..68f7f874a633d8531c3f4985f5e51ecb631b3576 100644 (file)
@@ -372,7 +372,7 @@ static int ingenic_drm_plane_atomic_check(struct drm_plane *plane,
        if (!crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index d6ec7627afb11d283a40869476f5f34e58e8cd26..effba5d087385fa51bc2c8564a9365006aac0298 100644 (file)
@@ -526,7 +526,7 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
        if (!crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
 
index 909045b67b28de7959a501aac7a70e2d960590fc..9a8cf2991fb43760e3b5129ebd13122086aabf64 100644 (file)
@@ -100,7 +100,7 @@ static int kmb_plane_atomic_check(struct drm_plane *plane,
                return -EINVAL;
        can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY);
        crtc_state =
-               drm_atomic_get_existing_crtc_state(new_plane_state->state,
+               drm_atomic_get_existing_crtc_state(state,
                                                   new_plane_state->crtc);
        return drm_atomic_helper_check_plane_state(new_plane_state,
                                                   crtc_state,
index e3abdc64bd5fc4bba23f1856d36aaec7413a73c0..1cfd85a991edcffb2cc6d2bc25f03ae85a9491d2 100644 (file)
@@ -160,7 +160,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
        if (ret)
                return ret;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
index 8700177082ad1d318509b47dd29ae233c271db7a..fc0415abefdc156b1bd73179303df28a6a94f265 100644 (file)
@@ -174,7 +174,7 @@ static int meson_overlay_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
index 32c5f51848bb5ec2ab3fb2fc3474e1fc4e53f937..1d219860e5c658bb71067e609768dfe406e1c01c 100644 (file)
@@ -80,7 +80,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
index c3b55cc84084c80b95d75cbc5cd287f9f4bbabb4..edbba85feb33d633185ca8aaf484808871d84bcb 100644 (file)
@@ -964,7 +964,7 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
        uint32_t min_src_size, max_linewidth;
 
        if (new_plane_state->crtc)
-               crtc_state = drm_atomic_get_new_crtc_state(new_plane_state->state,
+               crtc_state = drm_atomic_get_new_crtc_state(state,
                                                           new_plane_state->crtc);
 
        min_scale = FRAC_16_16(1, pdpu->pipe_sblk->maxupscale);
index 45f7780da901fa2caed3908e74af01441d3ed138..4aac6217a5adb455bd7843e06eed01b3e98846d7 100644 (file)
@@ -415,7 +415,7 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
        if (!crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index ca4bc0ecea2f1742f5f59d70af064ec77d25c062..f378252757bafb1540f4c951c1d5200aeeff2a54 100644 (file)
@@ -409,7 +409,7 @@ static int mxsfb_plane_atomic_check(struct drm_plane *plane,
        struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev);
        struct drm_crtc_state *crtc_state;
 
-       crtc_state = drm_atomic_get_new_crtc_state(plane_state->state,
+       crtc_state = drm_atomic_get_new_crtc_state(state,
                                                   &mxsfb->crtc);
 
        return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
index 6bd384c79324b810117ee073f9e55884849e22bd..0df1d35504addba049e509c62443acfa58f1abf1 100644 (file)
@@ -112,7 +112,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
        if (WARN_ON(!new_plane_state->crtc))
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        new_plane_state->crtc);
        /* we should have a crtc state if the plane is attached to a crtc */
        if (WARN_ON(!crtc_state))
index e789053d6fad821fedb239c719e724474b86e21d..74d5d200ead3397d8cb2577bbb4c3040584bdddc 100644 (file)
@@ -797,7 +797,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
        if (!crtc || WARN_ON(!fb))
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index ceb30d545ab9bd96bfb2daebd3691272efda623e..e34ab8317f6d92a0fe17b626490e8b538c33b214 100644 (file)
@@ -198,7 +198,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
        if (!crtc || !fb)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
        mode = &crtc_state->mode;
        dst_x = new_plane_state->crtc_x;
        dst_y = new_plane_state->crtc_y;
index 63823827417cceb689da84a60ee949dc303da09e..f64eef90dc586930a710ad7ac545f53cb16ca61f 100644 (file)
@@ -635,7 +635,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
                return 0;
 
        mixer = to_sti_mixer(crtc);
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
        mode = &crtc_state->mode;
        dst_x = new_plane_state->crtc_x;
        dst_y = new_plane_state->crtc_y;
index b3b10ee96bb2b29a3bf5f85c23c094c9242676a6..c1a2450beed4b46efe950e4a9cec3e64d6455c56 100644 (file)
@@ -1034,7 +1034,7 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
        if (!crtc || !fb)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state, crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, crtc);
        mode = &crtc_state->mode;
        dst_x = new_plane_state->crtc_x;
        dst_y = new_plane_state->crtc_y;
index d503ad7ebb404adeb7d3ade999f24eb0334157f6..a67ef1d7087b05268cb81f927d87d21b633b10b7 100644 (file)
@@ -269,7 +269,7 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane,
        if (!crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index 6d341eb37802baaa5a62bcead7bc092f28579643..0a62d90c4d3152d6da14767724a592ed701471e1 100644 (file)
@@ -373,7 +373,7 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,
        if (!crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
index 333eed82a5c0267f28b945be538416986c4afc63..28c1c640db5cc375703092ab9f26182d1088f65c 100644 (file)
@@ -44,7 +44,7 @@ static int tidss_plane_atomic_check(struct drm_plane *plane,
                return 0;
        }
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
index f43670aff5adf999be929920fbd1624aada4860f..ebdd42dcaf82a9763ace8344167d0de96bd3b55b 100644 (file)
@@ -41,7 +41,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
                return -EINVAL;
        }
 
-       crtc_state = drm_atomic_get_existing_crtc_state(new_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        new_state->crtc);
        /* we should have a crtc state if the plane is attached to a crtc */
        if (WARN_ON(!crtc_state))
index 7140086d8308b7895f9e38c76a056a76fe20c601..c8e1a37e839c34ee9bd053377b8eb3d4a0a02ec2 100644 (file)
@@ -260,8 +260,8 @@ static int vbox_primary_atomic_check(struct drm_plane *plane,
        struct drm_crtc_state *crtc_state = NULL;
 
        if (new_state->crtc) {
-               crtc_state = drm_atomic_get_existing_crtc_state(
-                                           new_state->state, new_state->crtc);
+               crtc_state = drm_atomic_get_existing_crtc_state(state,
+                                                               new_state->crtc);
                if (WARN_ON(!crtc_state))
                        return -EINVAL;
        }
@@ -338,8 +338,8 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane,
        int ret;
 
        if (new_state->crtc) {
-               crtc_state = drm_atomic_get_existing_crtc_state(
-                                           new_state->state, new_state->crtc);
+               crtc_state = drm_atomic_get_existing_crtc_state(state,
+                                                               new_state->crtc);
                if (WARN_ON(!crtc_state))
                        return -EINVAL;
        }
index 0f4fdd8c28f9754c9b188f56858b57938ef4fe10..9419aa611af98b0af695fbdb999fdfa311c1b5cd 100644 (file)
@@ -94,7 +94,7 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc))
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                 return PTR_ERR(crtc_state);
index 6e0ada03a8a24db650ab44390d9918debb156887..b79ca2c3fb063460ac56c1343284408b2debce54 100644 (file)
@@ -126,7 +126,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc))
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
+       crtc_state = drm_atomic_get_crtc_state(state,
                                               new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
index 5be1e4bd8a5f9aef4272c5c3645c07e1f191bf73..d6487376838fad2ef9fab4457f2e05b9bd568912 100644 (file)
@@ -446,7 +446,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,
        int ret;
 
        if (new_state->crtc)
-               crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
+               crtc_state = drm_atomic_get_new_crtc_state(state,
                                                           new_state->crtc);
 
        ret = drm_atomic_helper_check_plane_state(new_state, crtc_state,
index b0a3ba52871873568612327e1341636df12b6e5f..27c0b849598bc2542a3e78b4fbf1224462ca0273 100644 (file)
@@ -1152,8 +1152,7 @@ zynqmp_disp_plane_atomic_check(struct drm_plane *plane,
        if (!new_plane_state->crtc)
                return 0;
 
-       crtc_state = drm_atomic_get_crtc_state(new_plane_state->state,
-                                              new_plane_state->crtc);
+       crtc_state = drm_atomic_get_crtc_state(state, new_plane_state->crtc);
        if (IS_ERR(crtc_state))
                return PTR_ERR(crtc_state);
 
index 20ac292129919253c1ab1fa0d39433ca387ece2b..1d5d35bda2498a75c2420c37ef4be5caf0d90cd4 100644 (file)
@@ -59,7 +59,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,
        if (!crtc || WARN_ON(!fb))
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;
@@ -288,7 +288,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,
        if (!crtc || WARN_ON(!fb))
                return 0;
 
-       crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state,
+       crtc_state = drm_atomic_get_existing_crtc_state(state,
                                                        crtc);
        if (WARN_ON(!crtc_state))
                return -EINVAL;