]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm: Use state helper instead of the plane state pointer
authorMaxime Ripard <maxime@cerno.tech>
Fri, 19 Feb 2021 12:00:30 +0000 (13:00 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 25 Feb 2021 07:05:28 +0000 (08:05 +0100)
Many drivers reference the plane->state pointer in order to get the
current plane state in their atomic_update or atomic_disable hooks,
which would be the new plane state in the global atomic state since
_swap_state happened when those hooks are run.

Use the drm_atomic_get_new_plane_state helper to get that state to make it
more obvious.

This was made using the coccinelle script below:

@ plane_atomic_func @
identifier helpers;
identifier func;
@@

(
 static const struct drm_plane_helper_funcs helpers = {
  ...,
  .atomic_disable = func,
...,
 };
|
 static const struct drm_plane_helper_funcs helpers = {
  ...,
  .atomic_update = func,
...,
 };
)

@ adds_new_state @
identifier plane_atomic_func.func;
identifier plane, state;
identifier new_state;
@@

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

@ include depends on adds_new_state @
@@

 #include <drm/drm_atomic.h>

@ no_include depends on !include && adds_new_state @
@@

+ #include <drm/drm_atomic.h>
  #include <drm/...>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20210219120032.260676-1-maxime@cerno.tech
46 files changed:
drivers/gpu/drm/arc/arcpgu_crtc.c
drivers/gpu/drm/arm/hdlcd_crtc.c
drivers/gpu/drm/arm/malidp_planes.c
drivers/gpu/drm/armada/armada_overlay.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/exynos/exynos_drm_plane.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.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/mdp4/mdp4_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/qxl/qxl_display.c
drivers/gpu/drm/rcar-du/rcar_du_plane.c
drivers/gpu/drm/rcar-du/rcar_du_vsp.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/stm/ltdc.c
drivers/gpu/drm/sun4i/sun4i_layer.c
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/hub.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/vkms/vkms_plane.c
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
drivers/gpu/drm/xlnx/zynqmp_disp.c
drivers/gpu/drm/zte/zx_plane.c

index b185452d554293ea04c40dfeafac53372140c49e..7016f9cfe30d76b29895b3152edfa5984ec7b863 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
  */
 
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_cma_helper.h>
@@ -147,7 +148,8 @@ static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = {
 static void arc_pgu_plane_atomic_update(struct drm_plane *plane,
                                        struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_plane_state = plane->state;
+       struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
+                                                                                plane);
        struct arcpgu_drm_private *arcpgu;
        struct drm_gem_cma_object *gem;
 
index 2500bf189420f88825bfa6c1e445bcd42c237687..7adb065169e974966c756feaac4fe70c0d4a1eb4 100644 (file)
@@ -262,7 +262,8 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
 static void hdlcd_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_plane_state = plane->state;
+       struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
+                                                                                plane);
        struct drm_framebuffer *fb = new_plane_state->fb;
        struct hdlcd_drm_private *hdlcd;
        u32 dest_h;
index 1cb207bb8dcdc26e6844868c38aa88cd2affed2a..ddbba67f0283a815674523c80475ee430f98f08f 100644 (file)
@@ -797,7 +797,8 @@ static void malidp_de_plane_update(struct drm_plane *plane,
                                                                           plane);
        struct malidp_plane *mp;
        struct malidp_plane_state *ms = to_malidp_plane_state(plane->state);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        u16 pixel_alpha = new_state->pixel_blend_mode;
        u8 plane_alpha = new_state->alpha >> 8;
        u32 src_w, src_h, dest_w, dest_h, val;
index 393e4ea841f98ec82a70bf0c4354adbac83a91a6..d3e3e5fdc39046442b0791bf8a045045887960b7 100644 (file)
@@ -70,7 +70,8 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct armada_crtc *dcrtc;
        struct armada_regs *regs;
        unsigned int idx;
index 31d312d7ceefd60781ad7d36d78d58bfda43806a..40209e49f34a84cc391639a50d3f1df2d1a5dcdd 100644 (file)
@@ -165,7 +165,8 @@ static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct armada_crtc *dcrtc;
        struct armada_regs *regs;
        u32 cfg, cfg_mask, val;
index 61815eeb5157346e5493811b644de0fb5436a8d6..36d9575aa27ba8b0f68591a0718b00753bb37b28 100644 (file)
@@ -575,7 +575,8 @@ ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
                                                                           plane);
        struct drm_device *dev = plane->dev;
        struct ast_private *ast = to_ast_private(dev);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_gem_vram_object *gbo;
        s64 gpu_addr;
        struct drm_framebuffer *fb = new_state->fb;
@@ -797,7 +798,8 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
        struct ast_cursor_plane *ast_cursor_plane = to_ast_cursor_plane(plane);
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(new_state);
        struct drm_framebuffer *fb = new_state->fb;
        struct ast_private *ast = to_ast_private(plane->dev);
index 2c6d71faa268d2c6b691d079c4d34518621d37d5..a077d93c78d7b5e39a1b73b40a93452be5c8a94e 100644 (file)
@@ -733,7 +733,8 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
 static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p,
                                            struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_s = p->state;
+       struct drm_plane_state *new_s = drm_atomic_get_new_plane_state(state,
+                                                                      p);
        struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
        struct atmel_hlcdc_plane_state *hstate =
                        drm_plane_state_to_atmel_hlcdc_plane_state(new_s);
index 043394ac238fc4ff9ae26d368a6507fd4a2a7041..df76bdee7dcab9fe3a86825d922cd6f269e34780 100644 (file)
@@ -254,7 +254,8 @@ static int exynos_plane_atomic_check(struct drm_plane *plane,
 static void exynos_plane_atomic_update(struct drm_plane *plane,
                                       struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(new_state->crtc);
        struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
 
index d9efa6d1b2d46513ef38b742662224a65f0bfa33..8fe953d6e0a94e87a1ba61aa431140a0f3821324 100644 (file)
@@ -80,7 +80,8 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
 
 {
        struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private;
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_framebuffer *fb = plane->state->fb;
        struct drm_gem_cma_object *gem;
        unsigned int alpha = DCU_LAYER_AB_NONE, bpp;
index 4f643fbc68fb7f026b6a5d1b0c75b98f8ae0e543..fa8da0ef707ea922e252f3ce248926f44e918e29 100644 (file)
@@ -101,7 +101,8 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane,
 static void hibmc_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        u32 reg;
        s64 gpu_addr = 0;
        u32 line_l;
index 834fd101c3ba04a0a16c81e9368a8c6d99fa0e0d..6dcf9ec05eec43d1f65fe2e58dced3e13cf398d2 100644 (file)
@@ -806,7 +806,8 @@ static int ade_plane_atomic_check(struct drm_plane *plane,
 static void ade_plane_atomic_update(struct drm_plane *plane,
                                    struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct kirin_plane *kplane = to_kirin_plane(plane);
 
        ade_update_channel(kplane, new_state->fb, new_state->crtc_x,
index 76947a973d8567b001ad6ff1f33b08bc06ef5e75..044d3bdf313cdafaa769cb24a0e62ae4d4571deb 100644 (file)
@@ -268,7 +268,8 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct dcss_plane *dcss_plane = to_dcss_plane(plane);
        struct dcss_dev *dcss = plane->dev->dev_private;
        struct drm_framebuffer *fb = new_state->fb;
index 9d8472afb5d80fa6d22a0660a85454d4519df486..fa5009705365e2f690696af651e7eab5aef695d2 100644 (file)
@@ -544,7 +544,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
        struct ipu_plane *ipu_plane = to_ipu_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct ipu_plane_state *ipu_state = to_ipu_plane_state(new_state);
        struct drm_crtc_state *crtc_state = new_state->crtc->state;
        struct drm_framebuffer *fb = new_state->fb;
index f98185977c906ab120c330f2365c18dee58fd099..54ee2cb61f3c944006c73ea70c29d52fc68c99ef 100644 (file)
@@ -545,7 +545,8 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
                                            struct drm_atomic_state *state)
 {
        struct ingenic_drm *priv = drm_device_get_priv(plane->dev);
-       struct drm_plane_state *newstate = plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         plane);
        struct drm_crtc_state *crtc_state;
        struct ingenic_dma_hwdesc *hwdesc;
        unsigned int width, height, cpp, offset;
index dda3d42625bb24baf3f3fe08629682fc7c9d24f5..5ae6adab8306cb7b82c1d13eb6f3fc19bac0777d 100644 (file)
@@ -285,7 +285,8 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane,
                                            struct drm_atomic_state *state)
 {
        struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane);
-       struct drm_plane_state *newstate = plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         plane);
        const struct drm_format_info *finfo;
        u32 ctrl, stride = 0, coef_index = 0, format = 0;
        bool needs_modeset, upscaling_w, upscaling_h;
index f837962474b1203ea6ef7281615b8809a74e03c7..d5b6195856d1244ac8a9e2b535c5c4feb40c783d 100644 (file)
@@ -282,7 +282,8 @@ static void kmb_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state,
                                                                                 plane);
-       struct drm_plane_state *new_plane_state = plane->state;
+       struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
+                                                                                plane);
        struct drm_framebuffer *fb;
        struct kmb_drm_private *kmb;
        unsigned int width;
index ba02052276cf9b0645795a203210e01db234dacd..b5582dcf564cebca0db196196737f234d6a21b29 100644 (file)
@@ -175,7 +175,8 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
 static void mtk_plane_atomic_disable(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state);
        mtk_plane_state->pending.enable = false;
        wmb(); /* Make sure the above parameter is set before update */
@@ -185,7 +186,8 @@ static void mtk_plane_atomic_disable(struct drm_plane *plane,
 static void mtk_plane_atomic_update(struct drm_plane *plane,
                                    struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state);
        struct drm_crtc *crtc = new_state->crtc;
        struct drm_framebuffer *fb = new_state->fb;
index de2e95ad2de5d6642584e00f68fd58518f8076fc..ed063152aecd923c7e3b220f9e5df4b54c8c3527 100644 (file)
@@ -471,7 +471,8 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
                                        struct drm_atomic_state *state)
 {
        struct meson_overlay *meson_overlay = to_meson_overlay(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_framebuffer *fb = new_state->fb;
        struct meson_drm *priv = meson_overlay->priv;
        struct drm_gem_cma_object *gem;
index 1156342ec870bab13914612d03b81fcdc5ac364f..a18510dae4c835b7eb42b853994c7818dc9fd900 100644 (file)
@@ -133,7 +133,8 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
        struct meson_plane *meson_plane = to_meson_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_rect dest = drm_plane_state_dest(new_state);
        struct meson_drm *priv = meson_plane->priv;
        struct drm_framebuffer *fb = new_state->fb;
index 91ec47a634c94de9cb686ec91791f6f6da45424f..f92559cc22fb492f2d74a3b961b8727d85eb72d3 100644 (file)
@@ -1244,7 +1244,8 @@ static void dpu_plane_atomic_update(struct drm_plane *plane,
                                struct drm_atomic_state *state)
 {
        struct dpu_plane *pdpu = to_dpu_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
 
        pdpu->is_error = false;
 
index 5d78bce980a72233f6f121211ada08413d1af659..9aecca919f24b883d41aaa7398276583d51e6568 100644 (file)
@@ -4,6 +4,7 @@
  * Author: Rob Clark <robdclark@gmail.com>
  */
 
+#include <drm/drm_atomic.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_fourcc.h>
 
@@ -114,7 +115,8 @@ static int mdp4_plane_atomic_check(struct drm_plane *plane,
 static void mdp4_plane_atomic_update(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        int ret;
 
        ret = mdp4_plane_mode_set(plane,
index 4dc82a0c12e922345d65d97dc5557bd7eec0fa58..8c9f2f492178f3db55bb60d02fcdaf40d5101210 100644 (file)
@@ -428,7 +428,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
 static void mdp5_plane_atomic_update(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
 
        DBG("%s: update", plane->name);
 
index c0d5b3c24b87ef48a17fa93755922a1b7029f810..300e7bab0f431baaed93afbac73748bbed461740 100644 (file)
@@ -435,7 +435,8 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
        struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state,
                                                                            plane);
        struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev);
-       struct drm_plane_state *new_pstate = plane->state;
+       struct drm_plane_state *new_pstate = drm_atomic_get_new_plane_state(state,
+                                                                           plane);
        dma_addr_t paddr;
        u32 ctrl;
 
index d7c735dba3e1c5bac9e6e561c60b08bfe105877b..801da917507d5011cbf8e4e525b57cc869a1a296 100644 (file)
@@ -44,7 +44,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 {
        struct omap_drm_private *priv = plane->dev->dev_private;
        struct omap_plane *omap_plane = to_omap_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct omap_overlay_info info;
        int ret;
 
@@ -89,7 +90,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 static void omap_plane_atomic_disable(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct omap_drm_private *priv = plane->dev->dev_private;
        struct omap_plane *omap_plane = to_omap_plane(plane);
 
index 72ef82a048ad0a9df967b0f8a53e236ede02f058..e09b5041b684de0af8b207e60753e7b36b33be5b 100644 (file)
@@ -634,7 +634,8 @@ static void qxl_free_cursor(struct qxl_bo *cursor_bo)
 static void qxl_primary_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct qxl_device *qdev = to_qxl(plane->dev);
        struct qxl_bo *bo = gem_to_qxl_bo(new_state->fb->obj[0]);
        struct qxl_bo *primary;
@@ -687,7 +688,8 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct qxl_device *qdev = to_qxl(plane->dev);
        struct drm_framebuffer *fb = new_state->fb;
 
index 246ab9e9ccdae345c850f4abeeb5283783bec75d..862197be1e012bfcb3f4296c6c02d66ab9423668 100644 (file)
@@ -621,7 +621,7 @@ static void rcar_du_plane_atomic_update(struct drm_plane *plane,
                                        struct drm_atomic_state *state)
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
        struct rcar_du_plane *rplane = to_rcar_plane(plane);
        struct rcar_du_plane_state *old_rstate;
        struct rcar_du_plane_state *new_rstate;
index a555c5887befe860be52323ad5b1f4da9bbfd4a6..23e41c83c875a71267b3f00c9291dd1c97a9933c 100644 (file)
@@ -280,7 +280,7 @@ static void rcar_du_vsp_plane_atomic_update(struct drm_plane *plane,
                                        struct drm_atomic_state *state)
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
        struct rcar_du_vsp_plane *rplane = to_rcar_vsp_plane(plane);
        struct rcar_du_crtc *crtc = to_rcar_crtc(old_state->crtc);
 
index 94cfb8d9e7ef409b3428a33272769a3eb6ad963e..81c70d7a0471e1937c92e4483dd3bf0bb4890c1d 100644 (file)
@@ -881,7 +881,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_crtc *crtc = new_state->crtc;
        struct vop_win *vop_win = to_vop_win(plane);
        const struct vop_win_data *win = vop_win->data;
index 217f456067c2cfb7c2b336590930a187c00bc88d..1d6051b4f6fedd0c6e51e741d433b10d3f1af3f2 100644 (file)
@@ -258,7 +258,8 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
 static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
                                     struct drm_atomic_state *state)
 {
-       struct drm_plane_state *newstate = drm_plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
        struct sti_cursor *cursor = to_sti_cursor(plane);
        struct drm_crtc *crtc = newstate->crtc;
index eee17c6914a606aae334af06738ca27910bc19fd..d1a35d97bc4564a1b15e21f4e7c77be5e99a1c69 100644 (file)
@@ -703,7 +703,8 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
 {
        struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
                                                                          drm_plane);
-       struct drm_plane_state *newstate = drm_plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
        struct sti_gdp *gdp = to_sti_gdp(plane);
        struct drm_crtc *crtc = newstate->crtc;
index f317c9aad9c5e46a927e99d14dafedc35316e4a1..edbb99f53de1902f91144fcd16df22add201351e 100644 (file)
@@ -1113,7 +1113,8 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,
 {
        struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
                                                                          drm_plane);
-       struct drm_plane_state *newstate = drm_plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
        struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane);
        struct drm_crtc *crtc = newstate->crtc;
index 338fa7d7fb2de64d8e4802fabd37bd39a5a1ab64..b5117fccf355e9e78629683f5346e15ce3cacba4 100644 (file)
@@ -778,7 +778,8 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
        struct ltdc_device *ldev = plane_to_ltdc(plane);
-       struct drm_plane_state *newstate = plane->state;
+       struct drm_plane_state *newstate = drm_atomic_get_new_plane_state(state,
+                                                                         plane);
        struct drm_framebuffer *fb = newstate->fb;
        u32 lofs = plane->index * LAY_OFS;
        u32 x0 = newstate->crtc_x;
index 76e67f0139aa6c37235872ef27eb7253ff854bd5..11771bdd6e7ce59c45b29d3f25b350d7ff76bbe5 100644 (file)
@@ -86,7 +86,8 @@ static void sun4i_backend_layer_atomic_disable(struct drm_plane *plane,
 static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
                                              struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct sun4i_layer_state *layer_state = state_to_sun4i_layer_state(new_state);
        struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
        struct sun4i_backend *backend = layer->backend;
index cd0ee2233b6918efe8a2f6f2fada95ba4fd862dd..0db164a774a1f1e80ea41c88371632f68070e773 100644 (file)
@@ -306,7 +306,8 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
        unsigned int old_zpos = old_state->normalized_zpos;
index f80150de3d4ee5d76537afa8d1e95c9db982e171..46420780db598a409f2280c0c528b9529e96055f 100644 (file)
@@ -410,7 +410,8 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
        unsigned int old_zpos = old_state->normalized_zpos;
index c393db21c21ae1165ec64cb2c182b074ed3919a3..455d449191abc0ae974de9b6386b9d462ffca36d 100644 (file)
@@ -710,7 +710,8 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane,
 static void tegra_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
        struct drm_framebuffer *fb = new_state->fb;
        struct tegra_plane *p = to_tegra_plane(plane);
@@ -870,7 +871,8 @@ static int tegra_cursor_atomic_check(struct drm_plane *plane,
 static void tegra_cursor_atomic_update(struct drm_plane *plane,
                                       struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
        struct tegra_dc *dc = to_tegra_dc(new_state->crtc);
        u32 value = CURSOR_CLIP_DISPLAY;
index b264c9729d94ac9b1ab08e12569dce8dd7d2b6e6..8118007cb6d79c676afe97a1f9d0891dada31b79 100644 (file)
@@ -429,7 +429,8 @@ static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
 static void tegra_shared_plane_atomic_update(struct drm_plane *plane,
                                             struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
        struct tegra_dc *dc = to_tegra_dc(new_state->crtc);
        unsigned int zpos = new_state->normalized_zpos;
index 86980dbf2218af6ac0e3a54224bc26005e5d87ee..1acd15aa41935705081b215931ae7c53d94f0044 100644 (file)
@@ -110,7 +110,8 @@ static void tidss_plane_atomic_update(struct drm_plane *plane,
        struct drm_device *ddev = plane->dev;
        struct tidss_device *tidss = to_tidss(ddev);
        struct tidss_plane *tplane = to_tidss_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        u32 hw_videoport;
        int ret;
 
index c7c27f5774329b7b32cf2687f36c637b21f3b09f..74a5c88322297d28ae334db2c8da1e43fe2a5e76 100644 (file)
@@ -78,7 +78,8 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
 static void tilcdc_plane_atomic_update(struct drm_plane *plane,
                                       struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
 
        if (!new_state->crtc)
                return;
index 07fd7826b6a254f438e0f1fde5952c3d89c3f68b..964381d55fc194c326c2f0cd9c15ec4d5cb4f919 100644 (file)
@@ -275,7 +275,8 @@ static int vbox_primary_atomic_check(struct drm_plane *plane,
 static void vbox_primary_atomic_update(struct drm_plane *plane,
                                       struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_crtc *crtc = new_state->crtc;
        struct drm_framebuffer *fb = new_state->fb;
        struct vbox_private *vbox = to_vbox_dev(fb->dev);
@@ -387,7 +388,8 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct vbox_private *vbox =
                container_of(plane->dev, struct vbox_private, ddev);
        struct vbox_crtc *vbox_crtc = to_vbox_crtc(new_state->crtc);
index c61954bc36d9da01cfcf38d6f966a7f558d90c73..6d310d31b75d4ccb542ed6bed17645fa7284365b 100644 (file)
@@ -95,7 +95,8 @@ static const struct drm_plane_funcs vkms_plane_funcs = {
 static void vkms_plane_atomic_update(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct vkms_plane_state *vkms_plane_state;
        struct drm_framebuffer *fb = new_state->fb;
        struct vkms_composer *composer;
index dd8696fe794360c617f36652177a328c62d45219..87e0b303d900690bb3b2a46146db733c298134a8 100644 (file)
@@ -288,7 +288,8 @@ vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane,
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
                                                                           plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct vmw_private *dev_priv;
        struct vmw_legacy_display_unit *ldu;
        struct vmw_framebuffer *vfb;
index 1164494b4bb9889697665e5483ba2e1f3196e61e..9bc9a0714664e4ad01e037fc35bf0ef7327b5e45 100644 (file)
@@ -733,7 +733,7 @@ vmw_sou_primary_plane_atomic_update(struct drm_plane *plane,
                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
        struct drm_crtc *crtc = new_state->crtc;
        struct drm_pending_vblank_event *event = NULL;
        struct vmw_fence_obj *fence = NULL;
index dd586d34c80e1867277ac51c404f09a921deb2fb..7b11f02857864c4edeb3777998447e51ae466f2b 100644 (file)
@@ -1583,7 +1583,7 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane,
                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
        struct vmw_plane_state *vps = vmw_plane_state_to_vps(new_state);
        struct drm_crtc *crtc = new_state->crtc;
        struct vmw_screen_target_display_unit *stdu;
index 8daee2ab175632f888e8959ecb1146143a3edb8c..d8dd99be7b927804fdc1971c519e91a2318f5404 100644 (file)
@@ -1182,7 +1182,7 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
                                struct drm_atomic_state *state)
 {
        struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
        struct zynqmp_disp_layer *layer = plane_to_layer(plane);
        bool format_changed = false;
 
index fc2ac2672f1ce80760a6ffff197e7e612c1071ba..93bcca428e3539de632dc45fb45427d643813b6a 100644 (file)
@@ -184,7 +184,8 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
        struct zx_plane *zplane = to_zx_plane(plane);
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct drm_framebuffer *fb = new_state->fb;
        struct drm_rect *src = &new_state->src;
        struct drm_rect *dst = &new_state->dst;
@@ -355,7 +356,8 @@ static void zx_gl_rsz_setup(struct zx_plane *zplane, u32 src_w, u32 src_h,
 static void zx_gl_plane_atomic_update(struct drm_plane *plane,
                                      struct drm_atomic_state *state)
 {
-       struct drm_plane_state *new_state = plane->state;
+       struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
+                                                                          plane);
        struct zx_plane *zplane = to_zx_plane(plane);
        struct drm_framebuffer *fb = new_state->fb;
        struct drm_gem_cma_object *cma_obj;