drm/atomic: Pass the full state to planes atomic disable and update
authorMaxime Ripard <maxime@cerno.tech>
Fri, 19 Feb 2021 12:00:29 +0000 (13:00 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 25 Feb 2021 07:05:28 +0000 (08:05 +0100)
The current atomic helpers have either their object state being passed as
an argument or the full atomic state.

The former is the pattern that was done at first, before switching to the
latter for new hooks or when it was needed.

Let's convert the remaining helpers to provide a consistent interface,
this time with the planes atomic_update and atomic_disable.

The conversion was done using the coccinelle script below, built tested on
all the drivers.

@@
identifier plane, plane_state;
symbol state;
@@

 struct drm_plane_helper_funcs {
  ...
void (*atomic_update)(struct drm_plane *plane,
-       struct drm_plane_state *plane_state);
+       struct drm_atomic_state *state);
  ...
 }

@@
identifier plane, plane_state;
symbol state;
@@

 struct drm_plane_helper_funcs {
...
void (*atomic_disable)(struct drm_plane *plane,
-        struct drm_plane_state *plane_state);
+        struct drm_atomic_state *state);
...
 }

@ plane_atomic_func @
identifier helpers;
identifier func;
@@

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

@@
struct drm_plane_helper_funcs *FUNCS;
identifier f;
identifier crtc_state;
identifier plane, plane_state, state;
expression e;
@@

 f(struct drm_crtc_state *crtc_state)
 {
  ...
  struct drm_atomic_state *state = e;
  <+...
(
- FUNCS->atomic_disable(plane, plane_state)
+ FUNCS->atomic_disable(plane, state)
|
- FUNCS->atomic_update(plane, plane_state)
+ FUNCS->atomic_update(plane, state)
)
  ...+>
 }

@@
identifier plane_atomic_func.func;
identifier plane;
symbol state;
@@

 func(struct drm_plane *plane,
-    struct drm_plane_state *state)
+    struct drm_plane_state *old_plane_state)
 {
<...
- state
+ old_plane_state
...>
 }

@ ignores_old_state @
identifier plane_atomic_func.func;
identifier plane, old_state;
@@

 func(struct drm_plane *plane, struct drm_plane_state *old_state)
 {
... when != old_state
 }

@ adds_old_state depends on plane_atomic_func && !ignores_old_state @
identifier plane_atomic_func.func;
identifier plane, plane_state;
@@

 func(struct drm_plane *plane, struct drm_plane_state *plane_state)
 {
+ struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
  ...
 }

@ depends on plane_atomic_func @
identifier plane_atomic_func.func;
identifier plane, plane_state;
@@

 func(struct drm_plane *plane,
-     struct drm_plane_state *plane_state
+     struct drm_atomic_state *state
     )
 { ... }

@ include depends on adds_old_state @
@@

 #include <drm/drm_atomic.h>

@ no_include depends on !include && adds_old_state @
@@

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

@@
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_old_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-9-maxime@cerno.tech
58 files changed:
drivers/gpu/drm/arc/arcpgu_crtc.c
drivers/gpu/drm/arm/display/komeda/komeda_plane.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/drm_atomic_helper.c
drivers/gpu/drm/drm_simple_kms_helper.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_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_crtc.h
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_crtc.c
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h
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/vc4/vc4_plane.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/vmwgfx/vmwgfx_kms.h
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
include/drm/drm_modeset_helper_vtables.h

index 2cea17a96d5cd7e39d3a1541e18954b8b0fe2eaf..b185452d554293ea04c40dfeafac53372140c49e 100644 (file)
@@ -145,7 +145,7 @@ 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_plane_state *state)
+                                       struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_plane_state = plane->state;
        struct arcpgu_drm_private *arcpgu;
index 13582c174bbbac11478ad390e77d54f413d45dad..d63d83800a8a3876679d6d6641a349b60f68945e 100644 (file)
@@ -116,7 +116,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,
  */
 static void
 komeda_plane_atomic_update(struct drm_plane *plane,
-                          struct drm_plane_state *old_state)
+                          struct drm_atomic_state *state)
 {
 }
 
index 3f050a52e07aa63861baf1b3b5555de6edffa4e8..2500bf189420f88825bfa6c1e445bcd42c237687 100644 (file)
@@ -260,7 +260,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void hdlcd_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_plane_state = plane->state;
        struct drm_framebuffer *fb = new_plane_state->fb;
index 646b27a42452d6d28b310048375c89ef18211d2f..1cb207bb8dcdc26e6844868c38aa88cd2affed2a 100644 (file)
@@ -791,8 +791,10 @@ static void malidp_de_set_plane_afbc(struct drm_plane *plane)
 }
 
 static void malidp_de_plane_update(struct drm_plane *plane,
-                                  struct drm_plane_state *old_state)
+                                  struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct malidp_plane *mp;
        struct malidp_plane_state *ms = to_malidp_plane_state(plane->state);
        struct drm_plane_state *new_state = plane->state;
@@ -909,7 +911,7 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 }
 
 static void malidp_de_plane_disable(struct drm_plane *plane,
-                                   struct drm_plane_state *state)
+                                   struct drm_atomic_state *state)
 {
        struct malidp_plane *mp = to_malidp_plane(plane);
 
index f5e75c96b47683dc6ef8b699b6d604ef5df4edd6..393e4ea841f98ec82a70bf0c4354adbac83a91a6 100644 (file)
@@ -66,8 +66,10 @@ static inline u32 armada_csc(struct drm_plane_state *state)
 
 /* === Plane support === */
 static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane,
-       struct drm_plane_state *old_state)
+       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 armada_crtc *dcrtc;
        struct armada_regs *regs;
@@ -214,8 +216,10 @@ static void armada_drm_overlay_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void armada_drm_overlay_plane_atomic_disable(struct drm_plane *plane,
-       struct drm_plane_state *old_state)
+       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct armada_crtc *dcrtc;
        struct armada_regs *regs;
        unsigned int idx = 0;
index 3be7b3cfd2517f096e7be6c14b33ed40aefbdaf3..31d312d7ceefd60781ad7d36d78d58bfda43806a 100644 (file)
@@ -161,8 +161,10 @@ int armada_drm_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane,
-       struct drm_plane_state *old_state)
+       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 armada_crtc *dcrtc;
        struct armada_regs *regs;
@@ -248,8 +250,10 @@ static void armada_drm_primary_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void armada_drm_primary_plane_atomic_disable(struct drm_plane *plane,
-       struct drm_plane_state *old_state)
+       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct armada_crtc *dcrtc;
        struct armada_regs *regs;
        unsigned int idx = 0;
index 94950e0e338ab73e2a51bae91fba7fb1fe92bbe7..61815eeb5157346e5493811b644de0fb5436a8d6 100644 (file)
@@ -569,8 +569,10 @@ static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane,
 
 static void
 ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct drm_device *dev = plane->dev;
        struct ast_private *ast = to_ast_private(dev);
        struct drm_plane_state *new_state = plane->state;
@@ -601,7 +603,7 @@ ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
 
 static void
 ast_primary_plane_helper_atomic_disable(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       struct drm_atomic_state *state)
 {
        struct ast_private *ast = to_ast_private(plane->dev);
 
@@ -790,9 +792,11 @@ static int ast_cursor_plane_helper_atomic_check(struct drm_plane *plane,
 
 static void
 ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        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_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(new_state);
        struct drm_framebuffer *fb = new_state->fb;
@@ -860,7 +864,7 @@ ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
 
 static void
 ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct ast_private *ast = to_ast_private(plane->dev);
 
index cff52098e08793fba965d2ad35ee3ab23bf369af..2c6d71faa268d2c6b691d079c4d34518621d37d5 100644 (file)
@@ -712,7 +712,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
 }
 
 static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
-                                            struct drm_plane_state *old_state)
+                                            struct drm_atomic_state *state)
 {
        struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
 
@@ -731,7 +731,7 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
 }
 
 static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p,
-                                           struct drm_plane_state *old_s)
+                                           struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_s = p->state;
        struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
@@ -743,7 +743,7 @@ static void atmel_hlcdc_plane_atomic_update(struct drm_plane *p,
                return;
 
        if (!hstate->base.visible) {
-               atmel_hlcdc_plane_atomic_disable(p, old_s);
+               atmel_hlcdc_plane_atomic_disable(p, state);
                return;
        }
 
index c06bd5f43e61463a661ecf57c95dd63245ef5803..1a0ddcf104ac563112d347053c9137ca35fd119e 100644 (file)
@@ -2528,9 +2528,9 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
                            no_disable)
                                continue;
 
-                       funcs->atomic_disable(plane, old_plane_state);
+                       funcs->atomic_disable(plane, old_state);
                } else if (new_plane_state->crtc || disabling) {
-                       funcs->atomic_update(plane, old_plane_state);
+                       funcs->atomic_update(plane, old_state);
                }
        }
 
@@ -2602,10 +2602,10 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
 
                if (drm_atomic_plane_disabling(old_plane_state, new_plane_state) &&
                    plane_funcs->atomic_disable)
-                       plane_funcs->atomic_disable(plane, old_plane_state);
+                       plane_funcs->atomic_disable(plane, old_state);
                else if (new_plane_state->crtc ||
                         drm_atomic_plane_disabling(old_plane_state, new_plane_state))
-                       plane_funcs->atomic_update(plane, old_plane_state);
+                       plane_funcs->atomic_update(plane, old_state);
        }
 
        if (crtc_funcs && crtc_funcs->atomic_flush)
index 7f3d90e776a370a530bd708cf233d3fc128b97e9..0b095a313c440a50839e8168bb96c60676ee7e8f 100644 (file)
@@ -206,8 +206,10 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void drm_simple_kms_plane_atomic_update(struct drm_plane *plane,
-                                       struct drm_plane_state *old_pstate)
+                                       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state,
+                                                                           plane);
        struct drm_simple_display_pipe *pipe;
 
        pipe = container_of(plane, struct drm_simple_display_pipe, plane);
index 673f8a1d901083849e71f5eb3abffcf3fb22d68f..043394ac238fc4ff9ae26d368a6507fd4a2a7041 100644 (file)
@@ -252,7 +252,7 @@ static int exynos_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void exynos_plane_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(new_state->crtc);
@@ -266,8 +266,9 @@ static void exynos_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void exynos_plane_atomic_disable(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
        struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(old_state->crtc);
 
index 4272e121a1854e6ab5bde3ce081139a33713a8ec..d9efa6d1b2d46513ef38b742662224a65f0bfa33 100644 (file)
@@ -60,7 +60,7 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void fsl_dcu_drm_plane_atomic_disable(struct drm_plane *plane,
-                                            struct drm_plane_state *old_state)
+                                            struct drm_atomic_state *state)
 {
        struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private;
        unsigned int value;
@@ -76,7 +76,7 @@ static void fsl_dcu_drm_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
-                                           struct drm_plane_state *old_state)
+                                           struct drm_atomic_state *state)
 
 {
        struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private;
index a4b54e841c769bfa68d32893870ca85da4c15532..4f643fbc68fb7f026b6a5d1b0c75b98f8ae0e543 100644 (file)
@@ -99,7 +99,7 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void hibmc_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        u32 reg;
index 19416d9be46b264a53abc05082dfbd51b42f0dd9..834fd101c3ba04a0a16c81e9368a8c6d99fa0e0d 100644 (file)
@@ -804,7 +804,7 @@ static int ade_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void ade_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct kirin_plane *kplane = to_kirin_plane(plane);
@@ -817,7 +817,7 @@ static void ade_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void ade_plane_atomic_disable(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct kirin_plane *kplane = to_kirin_plane(plane);
 
index c4a81b50ab57569dbf990b1b8e8cfe1e3b523a17..76947a973d8567b001ad6ff1f33b08bc06ef5e75 100644 (file)
@@ -264,8 +264,10 @@ static bool dcss_plane_needs_setup(struct drm_plane_state *state,
 }
 
 static void dcss_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    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 dcss_plane *dcss_plane = to_dcss_plane(plane);
        struct dcss_dev *dcss = plane->dev->dev_private;
@@ -346,7 +348,7 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void dcss_plane_atomic_disable(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct dcss_plane *dcss_plane = to_dcss_plane(plane);
        struct dcss_dev *dcss = plane->dev->dev_private;
index 2b9b7b33a287482abd9541590eb334416193dd7d..9d8472afb5d80fa6d22a0660a85454d4519df486 100644 (file)
@@ -494,7 +494,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void ipu_plane_atomic_disable(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct ipu_plane *ipu_plane = to_ipu_plane(plane);
 
@@ -539,8 +539,10 @@ static void ipu_calculate_bursts(u32 width, u32 cpp, u32 stride,
 }
 
 static void ipu_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   struct drm_atomic_state *state)
 {
+       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 ipu_plane_state *ipu_state = to_ipu_plane_state(new_state);
index d9954ac4e00fa4f589ff4e4b44dba1ad741e503a..f98185977c906ab120c330f2365c18dee58fd099 100644 (file)
@@ -444,7 +444,7 @@ void ingenic_drm_plane_disable(struct device *dev, struct drm_plane *plane)
 }
 
 static void ingenic_drm_plane_atomic_disable(struct drm_plane *plane,
-                                            struct drm_plane_state *old_state)
+                                            struct drm_atomic_state *state)
 {
        struct ingenic_drm *priv = drm_device_get_priv(plane->dev);
 
@@ -542,7 +542,7 @@ static void ingenic_drm_update_palette(struct ingenic_drm *priv,
 }
 
 static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
-                                           struct drm_plane_state *oldstate)
+                                           struct drm_atomic_state *state)
 {
        struct ingenic_drm *priv = drm_device_get_priv(plane->dev);
        struct drm_plane_state *newstate = plane->state;
index a5a544cf6bb02c8828ccd1653213a9698e30a8bd..dda3d42625bb24baf3f3fe08629682fc7c9d24f5 100644 (file)
@@ -282,7 +282,7 @@ static inline bool osd_changed(struct drm_plane_state *state,
 }
 
 static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane,
-                                           struct drm_plane_state *oldstate)
+                                           struct drm_atomic_state *state)
 {
        struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane);
        struct drm_plane_state *newstate = plane->state;
@@ -595,7 +595,7 @@ static int ingenic_ipu_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void ingenic_ipu_plane_atomic_disable(struct drm_plane *plane,
-                                            struct drm_plane_state *old_state)
+                                            struct drm_atomic_state *state)
 {
        struct ingenic_ipu *ipu = plane_to_ingenic_ipu(plane);
 
index 05e1a7a2c075303c65e7a2af6d49a336611b778e..f837962474b1203ea6ef7281615b8809a74e03c7 100644 (file)
@@ -110,7 +110,7 @@ static int kmb_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void kmb_plane_atomic_disable(struct drm_plane *plane,
-                                    struct drm_plane_state *state)
+                                    struct drm_atomic_state *state)
 {
        struct kmb_plane *kmb_plane = to_kmb_plane(plane);
        int plane_id = kmb_plane->id;
@@ -278,8 +278,10 @@ static void config_csc(struct kmb_drm_private *kmb, int plane_id)
 }
 
 static void kmb_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *state)
+                                   struct drm_atomic_state *state)
 {
+       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_framebuffer *fb;
        struct kmb_drm_private *kmb;
@@ -294,7 +296,7 @@ static void kmb_plane_atomic_update(struct drm_plane *plane,
        int num_planes;
        static dma_addr_t addr[MAX_SUB_PLANES];
 
-       if (!plane || !new_plane_state || !state)
+       if (!plane || !new_plane_state || !old_plane_state)
                return;
 
        fb = new_plane_state->fb;
index 584dc26affc13a718bbfffab3163d58f183cf0e7..70ded25fb92c685165e48cfe19d88211b47e0bec 100644 (file)
@@ -506,7 +506,7 @@ int mtk_drm_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
 }
 
 void mtk_drm_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,
-                              struct drm_plane_state *new_state)
+                              struct drm_atomic_state *state)
 {
        struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
        const struct drm_plane_helper_funcs *plane_helper_funcs =
@@ -515,7 +515,7 @@ void mtk_drm_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,
        if (!mtk_crtc->enabled)
                return;
 
-       plane_helper_funcs->atomic_update(plane, new_state);
+       plane_helper_funcs->atomic_update(plane, state);
        mtk_drm_crtc_hw_config(mtk_crtc);
 }
 
index a2b4677a451cf42d7cffd8904eabef0b1e404534..de0479cd1e7203b67e9daef5997b016174d964ed 100644 (file)
@@ -22,6 +22,6 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
 int mtk_drm_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
                             struct mtk_plane_state *state);
 void mtk_drm_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,
-                              struct drm_plane_state *plane_state);
+                              struct drm_atomic_state *plane_state);
 
 #endif /* MTK_DRM_CRTC_H */
index 9a478f0630ac1cb769e4800a099284cdbcb35147..ba02052276cf9b0645795a203210e01db234dacd 100644 (file)
@@ -128,7 +128,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane,
        swap(plane->state->fb, new_state->fb);
        new_plane_state->pending.async_dirty = true;
 
-       mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);
+       mtk_drm_crtc_async_update(new_state->crtc, plane, state);
 }
 
 static const struct drm_plane_funcs mtk_plane_funcs = {
@@ -173,7 +173,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void mtk_plane_atomic_disable(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state);
@@ -183,7 +183,7 @@ static void mtk_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static void mtk_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(new_state);
@@ -198,7 +198,7 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
                return;
 
        if (!new_state->visible) {
-               mtk_plane_atomic_disable(plane, old_state);
+               mtk_plane_atomic_disable(plane, state);
                return;
        }
 
index d8822b2a94eb4a7400720cd898ec89da694826b9..de2e95ad2de5d6642584e00f68fd58518f8076fc 100644 (file)
@@ -468,7 +468,7 @@ static void meson_overlay_setup_scaler_params(struct meson_drm *priv,
 }
 
 static void meson_overlay_atomic_update(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       struct drm_atomic_state *state)
 {
        struct meson_overlay *meson_overlay = to_meson_overlay(plane);
        struct drm_plane_state *new_state = plane->state;
@@ -721,7 +721,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
 }
 
 static void meson_overlay_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct meson_overlay *meson_overlay = to_meson_overlay(plane);
        struct meson_drm *priv = meson_overlay->priv;
index af99a9b228d2e541722b7cadf27cd9cd1324c505..1156342ec870bab13914612d03b81fcdc5ac364f 100644 (file)
@@ -130,7 +130,7 @@ static u32 meson_g12a_afbcd_line_stride(struct meson_drm *priv)
 }
 
 static void meson_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct meson_plane *meson_plane = to_meson_plane(plane);
        struct drm_plane_state *new_state = plane->state;
@@ -395,7 +395,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void meson_plane_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct meson_plane *meson_plane = to_meson_plane(plane);
        struct meson_drm *priv = meson_plane->priv;
index ea9d73983d137c551bbc6d86449a9cd649735e2f..9607a7644d4b761d4254f26ebd909912e1dd03d3 100644 (file)
@@ -574,7 +574,7 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,
         * of those planes explicitly here prior to plane flush.
         */
        drm_atomic_crtc_for_each_plane(plane, crtc)
-               dpu_plane_restore(plane);
+               dpu_plane_restore(plane, state);
 
        /* update performance setting before crtc kickoff */
        dpu_core_perf_crtc_update(crtc, 1, false);
index 3c20b4c3ca9acf1cc53fa064aa8447e2be83e7d5..91ec47a634c94de9cb686ec91791f6f6da45424f 100644 (file)
@@ -1241,7 +1241,7 @@ static void _dpu_plane_atomic_disable(struct drm_plane *plane)
 }
 
 static void dpu_plane_atomic_update(struct drm_plane *plane,
-                               struct drm_plane_state *old_state)
+                               struct drm_atomic_state *state)
 {
        struct dpu_plane *pdpu = to_dpu_plane(plane);
        struct drm_plane_state *new_state = plane->state;
@@ -1257,7 +1257,7 @@ static void dpu_plane_atomic_update(struct drm_plane *plane,
        }
 }
 
-void dpu_plane_restore(struct drm_plane *plane)
+void dpu_plane_restore(struct drm_plane *plane, struct drm_atomic_state *state)
 {
        struct dpu_plane *pdpu;
 
@@ -1270,8 +1270,7 @@ void dpu_plane_restore(struct drm_plane *plane)
 
        DPU_DEBUG_PLANE(pdpu, "\n");
 
-       /* last plane state is same as current state */
-       dpu_plane_atomic_update(plane, plane->state);
+       dpu_plane_atomic_update(plane, state);
 }
 
 static void dpu_plane_destroy(struct drm_plane *plane)
index 13a983fa8213452aee6179bb437d8837f904b7fa..03b6365a750c299ef694faa71125dccc65d99651 100644 (file)
@@ -88,7 +88,7 @@ void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl,
  * dpu_plane_restore - restore hw state if previously power collapsed
  * @plane: Pointer to drm plane structure
  */
-void dpu_plane_restore(struct drm_plane *plane);
+void dpu_plane_restore(struct drm_plane *plane, struct drm_atomic_state *state);
 
 /**
  * dpu_plane_flush - final plane operations before commit flush
index b4c74c1047baaf85093c9e0c4edd1a52d073f0c8..5d78bce980a72233f6f121211ada08413d1af659 100644 (file)
@@ -112,7 +112,7 @@ static int mdp4_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void mdp4_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        int ret;
index da1cc66f9f497aefa95991ad51e9036797019523..4dc82a0c12e922345d65d97dc5557bd7eec0fa58 100644 (file)
@@ -426,7 +426,7 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void mdp5_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
 
index 9f54f11f04c6513a284a53bf90f38556508b1eb6..c0d5b3c24b87ef48a17fa93755922a1b7029f810 100644 (file)
@@ -419,7 +419,7 @@ static int mxsfb_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void mxsfb_plane_primary_atomic_update(struct drm_plane *plane,
-                                             struct drm_plane_state *old_pstate)
+                                             struct drm_atomic_state *state)
 {
        struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(plane->dev);
        dma_addr_t paddr;
@@ -430,8 +430,10 @@ static void mxsfb_plane_primary_atomic_update(struct drm_plane *plane,
 }
 
 static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
-                                             struct drm_plane_state *old_pstate)
+                                             struct drm_atomic_state *state)
 {
+       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;
        dma_addr_t paddr;
index d52124adedf767cccad1fdd446b3634a1e43a6e7..d7c735dba3e1c5bac9e6e561c60b08bfe105877b 100644 (file)
@@ -40,7 +40,7 @@ static void omap_plane_cleanup_fb(struct drm_plane *plane,
 }
 
 static void omap_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct omap_drm_private *priv = plane->dev->dev_private;
        struct omap_plane *omap_plane = to_omap_plane(plane);
@@ -87,7 +87,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void omap_plane_atomic_disable(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct omap_drm_private *priv = plane->dev->dev_private;
index d573bd9a6eacaf2026a209863b139e3b717812dc..72ef82a048ad0a9df967b0f8a53e236ede02f058 100644 (file)
@@ -632,7 +632,7 @@ static void qxl_free_cursor(struct qxl_bo *cursor_bo)
 }
 
 static void qxl_primary_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct qxl_device *qdev = to_qxl(plane->dev);
@@ -664,8 +664,10 @@ static void qxl_primary_atomic_update(struct drm_plane *plane,
 }
 
 static void qxl_primary_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct qxl_device *qdev = to_qxl(plane->dev);
 
        if (old_state->fb) {
@@ -681,8 +683,10 @@ static void qxl_primary_atomic_disable(struct drm_plane *plane,
 }
 
 static void qxl_cursor_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    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 qxl_device *qdev = to_qxl(plane->dev);
        struct drm_framebuffer *fb = new_state->fb;
@@ -695,8 +699,10 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane,
 }
 
 static void qxl_cursor_atomic_disable(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct qxl_device *qdev = to_qxl(plane->dev);
        struct qxl_crtc *qcrtc;
        struct qxl_release *release;
index 639db6e3fbfbe3a07319afac3c3bb8c60dd86dd3..246ab9e9ccdae345c850f4abeeb5283783bec75d 100644 (file)
@@ -618,8 +618,9 @@ static int rcar_du_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void rcar_du_plane_atomic_update(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       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 rcar_du_plane *rplane = to_rcar_plane(plane);
        struct rcar_du_plane_state *old_rstate;
index 2ed2bf2a1049c33c7a712d3bc48dbcb9aa700d76..a555c5887befe860be52323ad5b1f4da9bbfd4a6 100644 (file)
@@ -277,8 +277,9 @@ static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void rcar_du_vsp_plane_atomic_update(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       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 rcar_du_vsp_plane *rplane = to_rcar_vsp_plane(plane);
        struct rcar_du_crtc *crtc = to_rcar_crtc(old_state->crtc);
index 5d86a1bacf69711a9ad8bef78b4cf8deade6a39c..94cfb8d9e7ef409b3428a33272769a3eb6ad963e 100644 (file)
@@ -859,8 +859,10 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void vop_plane_atomic_disable(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct vop_win *vop_win = to_vop_win(plane);
        struct vop *vop = to_vop(old_state->crtc);
 
@@ -875,8 +877,10 @@ static void vop_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static void vop_plane_atomic_update(struct drm_plane *plane,
-               struct drm_plane_state *old_state)
+               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_crtc *crtc = new_state->crtc;
        struct vop_win *vop_win = to_vop_win(plane);
@@ -910,7 +914,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
                return;
 
        if (!new_state->visible) {
-               vop_plane_atomic_disable(plane, old_state);
+               vop_plane_atomic_disable(plane, state);
                return;
        }
 
@@ -1078,7 +1082,7 @@ static void vop_plane_atomic_async_update(struct drm_plane *plane,
        swap(plane->state->fb, new_state->fb);
 
        if (vop->is_enabled) {
-               vop_plane_atomic_update(plane, plane->state);
+               vop_plane_atomic_update(plane, state);
                spin_lock(&vop->reg_lock);
                vop_cfg_done(vop);
                spin_unlock(&vop->reg_lock);
index 4cf3bf1b30072fbb9871180b7044508d84160e31..217f456067c2cfb7c2b336590930a187c00bc88d 100644 (file)
@@ -256,7 +256,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
 }
 
 static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
-                                    struct drm_plane_state *oldstate)
+                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *newstate = drm_plane->state;
        struct sti_plane *plane = to_sti_plane(drm_plane);
@@ -310,8 +310,10 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
 }
 
 static void sti_cursor_atomic_disable(struct drm_plane *drm_plane,
-                                     struct drm_plane_state *oldstate)
+                                     struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
 
        if (!oldstate->crtc) {
index 0407b7dbd228b4ac9ee9f8e50344dfdfee7f8947..eee17c6914a606aae334af06738ca27910bc19fd 100644 (file)
@@ -699,8 +699,10 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
 }
 
 static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
-                                 struct drm_plane_state *oldstate)
+                                 struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         drm_plane);
        struct drm_plane_state *newstate = drm_plane->state;
        struct sti_plane *plane = to_sti_plane(drm_plane);
        struct sti_gdp *gdp = to_sti_gdp(plane);
@@ -864,8 +866,10 @@ end:
 }
 
 static void sti_gdp_atomic_disable(struct drm_plane *drm_plane,
-                                  struct drm_plane_state *oldstate)
+                                  struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
 
        if (!oldstate->crtc) {
index 264a80d606f9ebe7590371dd599a29f68733ec48..f317c9aad9c5e46a927e99d14dafedc35316e4a1 100644 (file)
@@ -1109,8 +1109,10 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
 }
 
 static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,
-                                   struct drm_plane_state *oldstate)
+                                   struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         drm_plane);
        struct drm_plane_state *newstate = drm_plane->state;
        struct sti_plane *plane = to_sti_plane(drm_plane);
        struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane);
@@ -1240,8 +1242,10 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,
 }
 
 static void sti_hqvdp_atomic_disable(struct drm_plane *drm_plane,
-                                    struct drm_plane_state *oldstate)
+                                    struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         drm_plane);
        struct sti_plane *plane = to_sti_plane(drm_plane);
 
        if (!oldstate->crtc) {
index 3aa5bad8bbe4eb2284e503a02a5462299a8c3b36..338fa7d7fb2de64d8e4802fabd37bd39a5a1ab64 100644 (file)
@@ -775,7 +775,7 @@ static int ltdc_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void ltdc_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *oldstate)
+                                    struct drm_atomic_state *state)
 {
        struct ltdc_device *ldev = plane_to_ltdc(plane);
        struct drm_plane_state *newstate = plane->state;
@@ -889,8 +889,10 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void ltdc_plane_atomic_disable(struct drm_plane *plane,
-                                     struct drm_plane_state *oldstate)
+                                     struct drm_atomic_state *state)
 {
+       struct drm_plane_state *oldstate = drm_atomic_get_old_plane_state(state,
+                                                                         plane);
        struct ltdc_device *ldev = plane_to_ltdc(plane);
        u32 lofs = plane->index * LAY_OFS;
 
index 8a4316edfb20db606c0557ea6444bc420e3f5da7..76e67f0139aa6c37235872ef27eb7253ff854bd5 100644 (file)
@@ -6,6 +6,7 @@
  * Maxime Ripard <maxime.ripard@free-electrons.com>
  */
 
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_plane_helper.h>
@@ -63,8 +64,10 @@ static void sun4i_backend_layer_destroy_state(struct drm_plane *plane,
 }
 
 static void sun4i_backend_layer_atomic_disable(struct drm_plane *plane,
-                                              struct drm_plane_state *old_state)
+                                              struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct sun4i_layer_state *layer_state = state_to_sun4i_layer_state(old_state);
        struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
        struct sun4i_backend *backend = layer->backend;
@@ -81,7 +84,7 @@ static void sun4i_backend_layer_atomic_disable(struct drm_plane *plane,
 }
 
 static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
-                                             struct drm_plane_state *old_state)
+                                             struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct sun4i_layer_state *layer_state = state_to_sun4i_layer_state(new_state);
index 3a5e29a9860bc40e466bcc491d1d0831b616e3d0..cd0ee2233b6918efe8a2f6f2fada95ba4fd862dd 100644 (file)
@@ -289,8 +289,10 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane,
 }
 
 static void sun8i_ui_layer_atomic_disable(struct drm_plane *plane,
-                                         struct drm_plane_state *old_state)
+                                         struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
@@ -300,8 +302,10 @@ static void sun8i_ui_layer_atomic_disable(struct drm_plane *plane,
 }
 
 static void sun8i_ui_layer_atomic_update(struct drm_plane *plane,
-                                        struct drm_plane_state *old_state)
+                                        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 sun8i_ui_layer *layer = plane_to_sun8i_ui_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
index 8949c821ea923146fe740fee247219520fe63cd9..f80150de3d4ee5d76537afa8d1e95c9db982e171 100644 (file)
@@ -393,8 +393,10 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,
 }
 
 static void sun8i_vi_layer_atomic_disable(struct drm_plane *plane,
-                                         struct drm_plane_state *old_state)
+                                         struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
        unsigned int old_zpos = old_state->normalized_zpos;
        struct sun8i_mixer *mixer = layer->mixer;
@@ -404,8 +406,10 @@ static void sun8i_vi_layer_atomic_disable(struct drm_plane *plane,
 }
 
 static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
-                                        struct drm_plane_state *old_state)
+                                        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 sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
        unsigned int zpos = new_state->normalized_zpos;
index 4eafd45baa60e124f5957be4668f69ef16d4447a..c393db21c21ae1165ec64cb2c182b074ed3919a3 100644 (file)
@@ -691,8 +691,10 @@ static int tegra_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void tegra_plane_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct tegra_plane *p = to_tegra_plane(plane);
        u32 value;
 
@@ -706,7 +708,7 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static void tegra_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
@@ -720,7 +722,7 @@ static void tegra_plane_atomic_update(struct drm_plane *plane,
                return;
 
        if (!new_state->visible)
-               return tegra_plane_atomic_disable(plane, old_state);
+               return tegra_plane_atomic_disable(plane, state);
 
        memset(&window, 0, sizeof(window));
        window.src.x = new_state->src.x1 >> 16;
@@ -866,7 +868,7 @@ static int tegra_cursor_atomic_check(struct drm_plane *plane,
 }
 
 static void tegra_cursor_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
@@ -929,8 +931,10 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
 }
 
 static void tegra_cursor_atomic_disable(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct tegra_dc *dc;
        u32 value;
 
index 1d31086e1cc9caae31e91708a437f31610b6ed14..b264c9729d94ac9b1ab08e12569dce8dd7d2b6e6 100644 (file)
@@ -388,8 +388,10 @@ static int tegra_shared_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
-                                             struct drm_plane_state *old_state)
+                                             struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct tegra_plane *p = to_tegra_plane(plane);
        struct tegra_dc *dc;
        u32 value;
@@ -425,7 +427,7 @@ static void tegra_shared_plane_atomic_disable(struct drm_plane *plane,
 }
 
 static void tegra_shared_plane_atomic_update(struct drm_plane *plane,
-                                            struct drm_plane_state *old_state)
+                                            struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct tegra_plane_state *tegra_plane_state = to_tegra_plane_state(new_state);
@@ -442,7 +444,7 @@ static void tegra_shared_plane_atomic_update(struct drm_plane *plane,
                return;
 
        if (!new_state->visible) {
-               tegra_shared_plane_atomic_disable(plane, old_state);
+               tegra_shared_plane_atomic_disable(plane, state);
                return;
        }
 
index a87b8751ad2531b2eeb087de09fa3ad3f2457e2e..86980dbf2218af6ac0e3a54224bc26005e5d87ee 100644 (file)
@@ -105,7 +105,7 @@ static int tidss_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void tidss_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_device *ddev = plane->dev;
        struct tidss_device *tidss = to_tidss(ddev);
@@ -137,7 +137,7 @@ static void tidss_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void tidss_plane_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct drm_device *ddev = plane->dev;
        struct tidss_device *tidss = to_tidss(ddev);
index 1d134a6d9fc648beda2015345232b401d6de5a2f..c7c27f5774329b7b32cf2687f36c637b21f3b09f 100644 (file)
@@ -76,7 +76,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void tilcdc_plane_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
 
index a6f273e9a96656ccdcf0cef9eda14287778eb235..07fd7826b6a254f438e0f1fde5952c3d89c3f68b 100644 (file)
@@ -273,7 +273,7 @@ static int vbox_primary_atomic_check(struct drm_plane *plane,
 }
 
 static void vbox_primary_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct drm_crtc *crtc = new_state->crtc;
@@ -318,8 +318,10 @@ static void vbox_primary_atomic_update(struct drm_plane *plane,
 }
 
 static void vbox_primary_atomic_disable(struct drm_plane *plane,
-                                       struct drm_plane_state *old_state)
+                                       struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct drm_crtc *crtc = old_state->crtc;
 
        /* vbox_do_modeset checks plane->state->fb and will disable if NULL */
@@ -381,8 +383,10 @@ static void copy_cursor_image(u8 *src, u8 *dst, u32 width, u32 height,
 }
 
 static void vbox_cursor_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     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 vbox_private *vbox =
                container_of(plane->dev, struct vbox_private, ddev);
@@ -429,8 +433,10 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
 }
 
 static void vbox_cursor_atomic_disable(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state)
+                                      struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct vbox_private *vbox =
                container_of(plane->dev, struct vbox_private, ddev);
        struct vbox_crtc *vbox_crtc = to_vbox_crtc(old_state->crtc);
index 72a495cc4f43bf89e4fea23d3585d1368cc9d497..eb37d7f8a11885da9b76e029a30dc44e7171f9b5 100644 (file)
@@ -1060,7 +1060,7 @@ static int vc4_plane_atomic_check(struct drm_plane *plane,
 }
 
 static void vc4_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   struct drm_atomic_state *state)
 {
        /* No contents here.  Since we don't know where in the CRTC's
         * dlist we should be stored, our dlist is uploaded to the
index 9419aa611af98b0af695fbdb999fdfa311c1b5cd..4e1b175480073863a7f59ca619b27988165f1d03 100644 (file)
@@ -130,8 +130,10 @@ static void virtio_gpu_update_dumb_bo(struct virtio_gpu_device *vgdev,
 }
 
 static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
-                                           struct drm_plane_state *old_state)
+                                           struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct drm_device *dev = plane->dev;
        struct virtio_gpu_device *vgdev = dev->dev_private;
        struct virtio_gpu_output *output = NULL;
@@ -242,8 +244,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
 }
 
 static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
-                                          struct drm_plane_state *old_state)
+                                          struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct drm_device *dev = plane->dev;
        struct virtio_gpu_device *vgdev = dev->dev_private;
        struct virtio_gpu_output *output = NULL;
index 94d5fbc3317813c0df91d4570f64f1f006e2f8f1..c61954bc36d9da01cfcf38d6f966a7f558d90c73 100644 (file)
@@ -93,7 +93,7 @@ static const struct drm_plane_funcs vkms_plane_funcs = {
 };
 
 static void vkms_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct vkms_plane_state *vkms_plane_state;
index ab32d7a5159bcc8c5267309d2fa9abd9d60f78a1..abbca8b0b3c5344fd0b4ef284bca70e6cbf2a3e3 100644 (file)
@@ -370,9 +370,12 @@ vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane,
 
 void
 vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
-                                 struct drm_plane_state *old_state)
+                                 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_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc;
        struct vmw_private *dev_priv = vmw_priv(crtc->dev);
        struct vmw_display_unit *du = vmw_crtc_to_du(crtc);
index c5183e7eea0432cddf93ddd6c7886827d82442ee..bbc809f7bd8a914a6af98ccaa9c517b15b1a8e30 100644 (file)
@@ -460,7 +460,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,
 int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane,
                                     struct drm_atomic_state *state);
 void vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
-                                      struct drm_plane_state *old_state);
+                                      struct drm_atomic_state *state);
 int vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane,
                                   struct drm_plane_state *new_state);
 void vmw_du_plane_cleanup_fb(struct drm_plane *plane,
index 14de7936983ebdeeffca24311bf630b77dd8333a..dd8696fe794360c617f36652177a328c62d45219 100644 (file)
@@ -284,8 +284,10 @@ drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = {
 
 static void
 vmw_ldu_primary_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   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 vmw_private *dev_priv;
        struct vmw_legacy_display_unit *ldu;
index 68f6a03729ee026b5a3098ffccc93279b797e37b..1164494b4bb9889697665e5483ba2e1f3196e61e 100644 (file)
@@ -730,8 +730,9 @@ static int vmw_sou_plane_update_surface(struct vmw_private *dev_priv,
 
 static void
 vmw_sou_primary_plane_atomic_update(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   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_crtc *crtc = new_state->crtc;
        struct drm_pending_vblank_event *event = NULL;
index 936d12169dbe86b8b610e7568e833557bd660b15..dd586d34c80e1867277ac51c404f09a921deb2fb 100644 (file)
@@ -1580,8 +1580,9 @@ static int vmw_stdu_plane_update_surface(struct vmw_private *dev_priv,
  */
 static void
 vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane,
-                                    struct drm_plane_state *old_state)
+                                    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 vmw_plane_state *vps = vmw_plane_state_to_vps(new_state);
        struct drm_crtc *crtc = new_state->crtc;
index 8b87a17e9d566717e8524ba75c7ca8de927e6852..8daee2ab175632f888e8959ecb1146143a3edb8c 100644 (file)
@@ -1165,8 +1165,10 @@ zynqmp_disp_plane_atomic_check(struct drm_plane *plane,
 
 static void
 zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
-                                struct drm_plane_state *old_state)
+                                struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct zynqmp_disp_layer *layer = plane_to_layer(plane);
 
        if (!old_state->fb)
@@ -1177,8 +1179,9 @@ zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
 
 static void
 zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
-                               struct drm_plane_state *old_state)
+                               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 zynqmp_disp_layer *layer = plane_to_layer(plane);
        bool format_changed = false;
@@ -1484,8 +1487,6 @@ static void
 zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc,
                                struct drm_atomic_state *state)
 {
-       struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
-                                                                             crtc);
        struct zynqmp_disp *disp = crtc_to_disp(crtc);
        struct drm_plane_state *old_plane_state;
 
@@ -1494,10 +1495,9 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc,
         * .shutdown() path if the plane is already disabled, skip
         * zynqmp_disp_plane_atomic_disable() in that case.
         */
-       old_plane_state = drm_atomic_get_old_plane_state(old_crtc_state->state,
-                                                        crtc->primary);
+       old_plane_state = drm_atomic_get_old_plane_state(state, crtc->primary);
        if (old_plane_state)
-               zynqmp_disp_plane_atomic_disable(crtc->primary, old_plane_state);
+               zynqmp_disp_plane_atomic_disable(crtc->primary, state);
 
        zynqmp_disp_disable(disp);
 
index 2833734bd5fb4b5c60911167c970e078003160ad..fc2ac2672f1ce80760a6ffff197e7e612c1071ba 100644 (file)
@@ -181,7 +181,7 @@ static void zx_vl_rsz_setup(struct zx_plane *zplane, uint32_t format,
 }
 
 static void zx_vl_plane_atomic_update(struct drm_plane *plane,
-                                     struct drm_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct zx_plane *zplane = to_zx_plane(plane);
        struct drm_plane_state *new_state = plane->state;
@@ -259,8 +259,10 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
 }
 
 static void zx_plane_atomic_disable(struct drm_plane *plane,
-                                   struct drm_plane_state *old_state)
+                                   struct drm_atomic_state *state)
 {
+       struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state,
+                                                                          plane);
        struct zx_plane *zplane = to_zx_plane(plane);
        void __iomem *hbsc = zplane->hbsc;
 
@@ -351,7 +353,7 @@ 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_plane_state *old_state)
+                                     struct drm_atomic_state *state)
 {
        struct drm_plane_state *new_state = plane->state;
        struct zx_plane *zplane = to_zx_plane(plane);
index 8222ed9b43fcb0d8feceabfcdd7506fb5b33a356..f3a4b47b39866fec3087ee25e7bfd14ebc3a35e1 100644 (file)
@@ -1262,7 +1262,7 @@ struct drm_plane_helper_funcs {
         * transitional plane helpers, but it is optional.
         */
        void (*atomic_update)(struct drm_plane *plane,
-                             struct drm_plane_state *old_state);
+                             struct drm_atomic_state *state);
        /**
         * @atomic_disable:
         *
@@ -1286,7 +1286,7 @@ struct drm_plane_helper_funcs {
         * transitional plane helpers, but it is optional.
         */
        void (*atomic_disable)(struct drm_plane *plane,
-                              struct drm_plane_state *old_state);
+                              struct drm_atomic_state *state);
 
        /**
         * @atomic_async_check: