28bd9095d00ca53c13a168e404d03a0dde4a2c8a
[openwrt/staging/robimarko.git] /
1 From 41661de0a014d606f6f55dd030a14bc341e677fc Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 8 Oct 2020 14:44:08 +0200
4 Subject: [PATCH] drm/atomic: Pass the full state to CRTC atomic
5 enable/disable
6
7 Commit 351f950db4ab28c321a1bd4b92e4bb03e34c4703 upstream.
8
9 If the CRTC driver ever needs to access the full DRM state, it can't do so
10 at atomic_enable / atomic_disable time since drm_atomic_helper_swap_state
11 will have cleared the pointer from the struct drm_crtc_state to the struct
12 drm_atomic_state before calling those hooks.
13
14 In order to allow that, let's pass the full DRM state to atomic_enable and
15 atomic_disable. The conversion was done using the coccinelle script below,
16 built tested on all the drivers and actually tested on vc4.
17
18 virtual report
19
20 @@
21 struct drm_crtc_helper_funcs *FUNCS;
22 identifier dev, state;
23 identifier crtc, crtc_state;
24 @@
25
26 disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
27 {
28 <...
29 - FUNCS->atomic_disable(crtc, crtc_state);
30 + FUNCS->atomic_disable(crtc, state);
31 ...>
32 }
33
34 @@
35 struct drm_crtc_helper_funcs *FUNCS;
36 identifier dev, state;
37 identifier crtc, crtc_state;
38 @@
39
40 drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state)
41 {
42 <...
43 - FUNCS->atomic_enable(crtc, crtc_state);
44 + FUNCS->atomic_enable(crtc, state);
45 ...>
46 }
47
48 @@
49 identifier crtc, old_state;
50 @@
51
52 struct drm_crtc_helper_funcs {
53 ...
54 - void (*atomic_enable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
55 + void (*atomic_enable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
56 ...
57 - void (*atomic_disable)(struct drm_crtc *crtc, struct drm_crtc_state *old_state);
58 + void (*atomic_disable)(struct drm_crtc *crtc, struct drm_atomic_state *state);
59 ...
60 }
61
62 @ crtc_atomic_func @
63 identifier helpers;
64 identifier func;
65 @@
66
67 (
68 static struct drm_crtc_helper_funcs helpers = {
69 ...,
70 .atomic_enable = func,
71 ...,
72 };
73 |
74 static struct drm_crtc_helper_funcs helpers = {
75 ...,
76 .atomic_disable = func,
77 ...,
78 };
79 )
80
81 @ ignores_old_state @
82 identifier crtc_atomic_func.func;
83 identifier crtc, old_state;
84 @@
85
86 void func(struct drm_crtc *crtc,
87 struct drm_crtc_state *old_state)
88 {
89 ... when != old_state
90 }
91
92 @ adds_old_state depends on crtc_atomic_func && !ignores_old_state @
93 identifier crtc_atomic_func.func;
94 identifier crtc, old_state;
95 @@
96
97 void func(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
98 {
99 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
100 ...
101 }
102
103 @ depends on crtc_atomic_func @
104 identifier crtc_atomic_func.func;
105 expression E;
106 type T;
107 @@
108
109 void func(...)
110 {
111 ...
112 - T state = E;
113 + T crtc_state = E;
114 <+...
115 - state
116 + crtc_state
117 ...+>
118
119 }
120
121 @ depends on crtc_atomic_func @
122 identifier crtc_atomic_func.func;
123 type T;
124 @@
125
126 void func(...)
127 {
128 ...
129 - T state;
130 + T crtc_state;
131 <+...
132 - state
133 + crtc_state
134 ...+>
135
136 }
137
138 @ depends on crtc_atomic_func @
139 identifier crtc_atomic_func.func;
140 identifier old_state;
141 identifier crtc;
142 @@
143
144 void func(struct drm_crtc *crtc,
145 - struct drm_crtc_state *old_state
146 + struct drm_atomic_state *state
147 )
148 { ... }
149
150 @ include depends on adds_old_state @
151 @@
152
153 #include <drm/drm_atomic.h>
154
155 @ no_include depends on !include && adds_old_state @
156 @@
157
158 + #include <drm/drm_atomic.h>
159 #include <drm/...>
160
161 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
162 Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
163 Link: https://patchwork.freedesktop.org/patch/msgid/845aa10ef171fc0ea060495efef142a0c13f7870.1602161031.git-series.maxime@cerno.tech
164 ---
165 drivers/gpu/drm/arc/arcpgu_crtc.c | 4 ++--
166 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 8 ++++++--
167 drivers/gpu/drm/arm/hdlcd_crtc.c | 4 ++--
168 drivers/gpu/drm/arm/malidp_crtc.c | 6 ++++--
169 drivers/gpu/drm/armada/armada_crtc.c | 8 ++++++--
170 drivers/gpu/drm/ast/ast_mode.c | 6 ++++--
171 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 4 ++--
172 drivers/gpu/drm/drm_atomic_helper.c | 4 ++--
173 drivers/gpu/drm/drm_simple_kms_helper.c | 4 ++--
174 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++--
175 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c | 6 ++++--
176 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 4 ++--
177 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 ++--
178 drivers/gpu/drm/imx/dcss/dcss-crtc.c | 9 +++++++--
179 drivers/gpu/drm/imx/ipuv3-crtc.c | 6 ++++--
180 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++--
181 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++--
182 drivers/gpu/drm/meson/meson_crtc.c | 8 ++++----
183 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +++++--
184 drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 4 ++--
185 drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 ++--
186 drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 ++--
187 drivers/gpu/drm/omapdrm/omap_crtc.c | 4 ++--
188 drivers/gpu/drm/qxl/qxl_display.c | 4 ++--
189 drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++--
190 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++--
191 drivers/gpu/drm/sti/sti_crtc.c | 4 ++--
192 drivers/gpu/drm/stm/ltdc.c | 4 ++--
193 drivers/gpu/drm/sun4i/sun4i_crtc.c | 4 ++--
194 drivers/gpu/drm/tegra/dc.c | 8 ++++----
195 drivers/gpu/drm/tidss/tidss_crtc.c | 6 ++++--
196 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 4 ++--
197 drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 ++--
198 drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++++--
199 drivers/gpu/drm/vc4/vc4_txp.c | 9 +++++++--
200 drivers/gpu/drm/virtio/virtgpu_display.c | 4 ++--
201 drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++--
202 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ++--
203 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 4 ++--
204 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 ++--
205 drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 ++++--
206 drivers/gpu/drm/zte/zx_vou.c | 4 ++--
207 include/drm/drm_modeset_helper_vtables.h | 13 ++-----------
208 43 files changed, 131 insertions(+), 99 deletions(-)
209
210 --- a/drivers/gpu/drm/arc/arcpgu_crtc.c
211 +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
212 @@ -116,7 +116,7 @@ static void arc_pgu_crtc_mode_set_nofb(s
213 }
214
215 static void arc_pgu_crtc_atomic_enable(struct drm_crtc *crtc,
216 - struct drm_crtc_state *old_state)
217 + struct drm_atomic_state *state)
218 {
219 struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
220
221 @@ -127,7 +127,7 @@ static void arc_pgu_crtc_atomic_enable(s
222 }
223
224 static void arc_pgu_crtc_atomic_disable(struct drm_crtc *crtc,
225 - struct drm_crtc_state *old_state)
226 + struct drm_atomic_state *state)
227 {
228 struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
229
230 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
231 +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
232 @@ -273,8 +273,10 @@ komeda_crtc_do_flush(struct drm_crtc *cr
233
234 static void
235 komeda_crtc_atomic_enable(struct drm_crtc *crtc,
236 - struct drm_crtc_state *old)
237 + struct drm_atomic_state *state)
238 {
239 + struct drm_crtc_state *old = drm_atomic_get_old_crtc_state(state,
240 + crtc);
241 pm_runtime_get_sync(crtc->dev->dev);
242 komeda_crtc_prepare(to_kcrtc(crtc));
243 drm_crtc_vblank_on(crtc);
244 @@ -319,8 +321,10 @@ komeda_crtc_flush_and_wait_for_flip_done
245
246 static void
247 komeda_crtc_atomic_disable(struct drm_crtc *crtc,
248 - struct drm_crtc_state *old)
249 + struct drm_atomic_state *state)
250 {
251 + struct drm_crtc_state *old = drm_atomic_get_old_crtc_state(state,
252 + crtc);
253 struct komeda_crtc *kcrtc = to_kcrtc(crtc);
254 struct komeda_crtc_state *old_st = to_kcrtc_st(old);
255 struct komeda_pipeline *master = kcrtc->master;
256 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c
257 +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
258 @@ -168,7 +168,7 @@ static void hdlcd_crtc_mode_set_nofb(str
259 }
260
261 static void hdlcd_crtc_atomic_enable(struct drm_crtc *crtc,
262 - struct drm_crtc_state *old_state)
263 + struct drm_atomic_state *state)
264 {
265 struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
266
267 @@ -179,7 +179,7 @@ static void hdlcd_crtc_atomic_enable(str
268 }
269
270 static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc,
271 - struct drm_crtc_state *old_state)
272 + struct drm_atomic_state *state)
273 {
274 struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
275
276 --- a/drivers/gpu/drm/arm/malidp_crtc.c
277 +++ b/drivers/gpu/drm/arm/malidp_crtc.c
278 @@ -46,7 +46,7 @@ static enum drm_mode_status malidp_crtc_
279 }
280
281 static void malidp_crtc_atomic_enable(struct drm_crtc *crtc,
282 - struct drm_crtc_state *old_state)
283 + struct drm_atomic_state *state)
284 {
285 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
286 struct malidp_hw_device *hwdev = malidp->dev;
287 @@ -70,8 +70,10 @@ static void malidp_crtc_atomic_enable(st
288 }
289
290 static void malidp_crtc_atomic_disable(struct drm_crtc *crtc,
291 - struct drm_crtc_state *old_state)
292 + struct drm_atomic_state *state)
293 {
294 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
295 + crtc);
296 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
297 struct malidp_hw_device *hwdev = malidp->dev;
298 int err;
299 --- a/drivers/gpu/drm/armada/armada_crtc.c
300 +++ b/drivers/gpu/drm/armada/armada_crtc.c
301 @@ -467,8 +467,10 @@ static void armada_drm_crtc_atomic_flush
302 }
303
304 static void armada_drm_crtc_atomic_disable(struct drm_crtc *crtc,
305 - struct drm_crtc_state *old_state)
306 + struct drm_atomic_state *state)
307 {
308 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
309 + crtc);
310 struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
311 struct drm_pending_vblank_event *event;
312
313 @@ -503,8 +505,10 @@ static void armada_drm_crtc_atomic_disab
314 }
315
316 static void armada_drm_crtc_atomic_enable(struct drm_crtc *crtc,
317 - struct drm_crtc_state *old_state)
318 + struct drm_atomic_state *state)
319 {
320 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
321 + crtc);
322 struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
323
324 DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name);
325 --- a/drivers/gpu/drm/ast/ast_mode.c
326 +++ b/drivers/gpu/drm/ast/ast_mode.c
327 @@ -793,7 +793,7 @@ ast_crtc_helper_atomic_flush(struct drm_
328
329 static void
330 ast_crtc_helper_atomic_enable(struct drm_crtc *crtc,
331 - struct drm_crtc_state *old_crtc_state)
332 + struct drm_atomic_state *state)
333 {
334 struct drm_device *dev = crtc->dev;
335 struct ast_private *ast = to_ast_private(dev);
336 @@ -816,8 +816,10 @@ ast_crtc_helper_atomic_enable(struct drm
337
338 static void
339 ast_crtc_helper_atomic_disable(struct drm_crtc *crtc,
340 - struct drm_crtc_state *old_crtc_state)
341 + struct drm_atomic_state *state)
342 {
343 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
344 + crtc);
345 struct drm_device *dev = crtc->dev;
346 struct ast_private *ast = to_ast_private(dev);
347
348 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
349 +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
350 @@ -165,7 +165,7 @@ atmel_hlcdc_crtc_mode_valid(struct drm_c
351 }
352
353 static void atmel_hlcdc_crtc_atomic_disable(struct drm_crtc *c,
354 - struct drm_crtc_state *old_state)
355 + struct drm_atomic_state *state)
356 {
357 struct drm_device *dev = c->dev;
358 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
359 @@ -200,7 +200,7 @@ static void atmel_hlcdc_crtc_atomic_disa
360 }
361
362 static void atmel_hlcdc_crtc_atomic_enable(struct drm_crtc *c,
363 - struct drm_crtc_state *old_state)
364 + struct drm_atomic_state *state)
365 {
366 struct drm_device *dev = c->dev;
367 struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
368 --- a/drivers/gpu/drm/drm_atomic_helper.c
369 +++ b/drivers/gpu/drm/drm_atomic_helper.c
370 @@ -1093,7 +1093,7 @@ disable_outputs(struct drm_device *dev,
371 if (new_crtc_state->enable && funcs->prepare)
372 funcs->prepare(crtc);
373 else if (funcs->atomic_disable)
374 - funcs->atomic_disable(crtc, old_crtc_state);
375 + funcs->atomic_disable(crtc, old_state);
376 else if (funcs->disable)
377 funcs->disable(crtc);
378 else if (funcs->dpms)
379 @@ -1358,7 +1358,7 @@ void drm_atomic_helper_commit_modeset_en
380 DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n",
381 crtc->base.id, crtc->name);
382 if (funcs->atomic_enable)
383 - funcs->atomic_enable(crtc, old_crtc_state);
384 + funcs->atomic_enable(crtc, old_state);
385 else if (funcs->commit)
386 funcs->commit(crtc);
387 }
388 --- a/drivers/gpu/drm/drm_simple_kms_helper.c
389 +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
390 @@ -99,7 +99,7 @@ static int drm_simple_kms_crtc_check(str
391 }
392
393 static void drm_simple_kms_crtc_enable(struct drm_crtc *crtc,
394 - struct drm_crtc_state *old_state)
395 + struct drm_atomic_state *state)
396 {
397 struct drm_plane *plane;
398 struct drm_simple_display_pipe *pipe;
399 @@ -113,7 +113,7 @@ static void drm_simple_kms_crtc_enable(s
400 }
401
402 static void drm_simple_kms_crtc_disable(struct drm_crtc *crtc,
403 - struct drm_crtc_state *old_state)
404 + struct drm_atomic_state *state)
405 {
406 struct drm_simple_display_pipe *pipe;
407
408 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
409 +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
410 @@ -19,7 +19,7 @@
411 #include "exynos_drm_plane.h"
412
413 static void exynos_drm_crtc_atomic_enable(struct drm_crtc *crtc,
414 - struct drm_crtc_state *old_state)
415 + struct drm_atomic_state *state)
416 {
417 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
418
419 @@ -30,7 +30,7 @@ static void exynos_drm_crtc_atomic_enabl
420 }
421
422 static void exynos_drm_crtc_atomic_disable(struct drm_crtc *crtc,
423 - struct drm_crtc_state *old_state)
424 + struct drm_atomic_state *state)
425 {
426 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
427
428 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
429 +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
430 @@ -43,8 +43,10 @@ static void fsl_dcu_drm_crtc_atomic_flus
431 }
432
433 static void fsl_dcu_drm_crtc_atomic_disable(struct drm_crtc *crtc,
434 - struct drm_crtc_state *old_crtc_state)
435 + struct drm_atomic_state *state)
436 {
437 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
438 + crtc);
439 struct drm_device *dev = crtc->dev;
440 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
441
442 @@ -62,7 +64,7 @@ static void fsl_dcu_drm_crtc_atomic_disa
443 }
444
445 static void fsl_dcu_drm_crtc_atomic_enable(struct drm_crtc *crtc,
446 - struct drm_crtc_state *old_state)
447 + struct drm_atomic_state *state)
448 {
449 struct drm_device *dev = crtc->dev;
450 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
451 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
452 +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c
453 @@ -172,7 +172,7 @@ static void hibmc_crtc_dpms(struct drm_c
454 }
455
456 static void hibmc_crtc_atomic_enable(struct drm_crtc *crtc,
457 - struct drm_crtc_state *old_state)
458 + struct drm_atomic_state *state)
459 {
460 unsigned int reg;
461 struct hibmc_drm_private *priv = crtc->dev->dev_private;
462 @@ -191,7 +191,7 @@ static void hibmc_crtc_atomic_enable(str
463 }
464
465 static void hibmc_crtc_atomic_disable(struct drm_crtc *crtc,
466 - struct drm_crtc_state *old_state)
467 + struct drm_atomic_state *state)
468 {
469 unsigned int reg;
470 struct hibmc_drm_private *priv = crtc->dev->dev_private;
471 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
472 +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
473 @@ -436,7 +436,7 @@ static void ade_dump_regs(void __iomem *
474 #endif
475
476 static void ade_crtc_atomic_enable(struct drm_crtc *crtc,
477 - struct drm_crtc_state *old_state)
478 + struct drm_atomic_state *state)
479 {
480 struct kirin_crtc *kcrtc = to_kirin_crtc(crtc);
481 struct ade_hw_ctx *ctx = kcrtc->hw_ctx;
482 @@ -459,7 +459,7 @@ static void ade_crtc_atomic_enable(struc
483 }
484
485 static void ade_crtc_atomic_disable(struct drm_crtc *crtc,
486 - struct drm_crtc_state *old_state)
487 + struct drm_atomic_state *state)
488 {
489 struct kirin_crtc *kcrtc = to_kirin_crtc(crtc);
490 struct ade_hw_ctx *ctx = kcrtc->hw_ctx;
491 --- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c
492 +++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c
493 @@ -3,6 +3,7 @@
494 * Copyright 2019 NXP.
495 */
496
497 +#include <drm/drm_atomic.h>
498 #include <drm/drm_atomic_helper.h>
499 #include <drm/drm_vblank.h>
500 #include <linux/platform_device.h>
501 @@ -77,8 +78,10 @@ static void dcss_crtc_atomic_flush(struc
502 }
503
504 static void dcss_crtc_atomic_enable(struct drm_crtc *crtc,
505 - struct drm_crtc_state *old_crtc_state)
506 + struct drm_atomic_state *state)
507 {
508 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
509 + crtc);
510 struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc,
511 base);
512 struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private;
513 @@ -111,8 +114,10 @@ static void dcss_crtc_atomic_enable(stru
514 }
515
516 static void dcss_crtc_atomic_disable(struct drm_crtc *crtc,
517 - struct drm_crtc_state *old_crtc_state)
518 + struct drm_atomic_state *state)
519 {
520 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
521 + crtc);
522 struct dcss_crtc *dcss_crtc = container_of(crtc, struct dcss_crtc,
523 base);
524 struct dcss_dev *dcss = dcss_crtc->base.dev->dev_private;
525 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
526 +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
527 @@ -47,7 +47,7 @@ static inline struct ipu_crtc *to_ipu_cr
528 }
529
530 static void ipu_crtc_atomic_enable(struct drm_crtc *crtc,
531 - struct drm_crtc_state *old_state)
532 + struct drm_atomic_state *state)
533 {
534 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
535 struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent);
536 @@ -79,8 +79,10 @@ static void ipu_crtc_disable_planes(stru
537 }
538
539 static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
540 - struct drm_crtc_state *old_crtc_state)
541 + struct drm_atomic_state *state)
542 {
543 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
544 + crtc);
545 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
546 struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent);
547
548 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
549 +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
550 @@ -112,7 +112,7 @@ static inline struct ingenic_drm *drm_cr
551 }
552
553 static void ingenic_drm_crtc_atomic_enable(struct drm_crtc *crtc,
554 - struct drm_crtc_state *state)
555 + struct drm_atomic_state *state)
556 {
557 struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
558
559 @@ -126,7 +126,7 @@ static void ingenic_drm_crtc_atomic_enab
560 }
561
562 static void ingenic_drm_crtc_atomic_disable(struct drm_crtc *crtc,
563 - struct drm_crtc_state *state)
564 + struct drm_atomic_state *state)
565 {
566 struct ingenic_drm *priv = drm_crtc_get_priv(crtc);
567 unsigned int var;
568 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
569 +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
570 @@ -517,7 +517,7 @@ void mtk_drm_crtc_async_update(struct dr
571 }
572
573 static void mtk_drm_crtc_atomic_enable(struct drm_crtc *crtc,
574 - struct drm_crtc_state *old_state)
575 + struct drm_atomic_state *state)
576 {
577 struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
578 struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
579 @@ -542,7 +542,7 @@ static void mtk_drm_crtc_atomic_enable(s
580 }
581
582 static void mtk_drm_crtc_atomic_disable(struct drm_crtc *crtc,
583 - struct drm_crtc_state *old_state)
584 + struct drm_atomic_state *state)
585 {
586 struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
587 struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
588 --- a/drivers/gpu/drm/meson/meson_crtc.c
589 +++ b/drivers/gpu/drm/meson/meson_crtc.c
590 @@ -82,7 +82,7 @@ static const struct drm_crtc_funcs meson
591 };
592
593 static void meson_g12a_crtc_atomic_enable(struct drm_crtc *crtc,
594 - struct drm_crtc_state *old_state)
595 + struct drm_atomic_state *state)
596 {
597 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
598 struct drm_crtc_state *crtc_state = crtc->state;
599 @@ -118,7 +118,7 @@ static void meson_g12a_crtc_atomic_enabl
600 }
601
602 static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
603 - struct drm_crtc_state *old_state)
604 + struct drm_atomic_state *state)
605 {
606 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
607 struct drm_crtc_state *crtc_state = crtc->state;
608 @@ -146,7 +146,7 @@ static void meson_crtc_atomic_enable(str
609 }
610
611 static void meson_g12a_crtc_atomic_disable(struct drm_crtc *crtc,
612 - struct drm_crtc_state *old_state)
613 + struct drm_atomic_state *state)
614 {
615 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
616 struct meson_drm *priv = meson_crtc->priv;
617 @@ -171,7 +171,7 @@ static void meson_g12a_crtc_atomic_disab
618 }
619
620 static void meson_crtc_atomic_disable(struct drm_crtc *crtc,
621 - struct drm_crtc_state *old_state)
622 + struct drm_atomic_state *state)
623 {
624 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
625 struct meson_drm *priv = meson_crtc->priv;
626 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
627 +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
628 @@ -11,6 +11,7 @@
629 #include <linux/ktime.h>
630 #include <linux/bits.h>
631
632 +#include <drm/drm_atomic.h>
633 #include <drm/drm_crtc.h>
634 #include <drm/drm_flip_work.h>
635 #include <drm/drm_mode.h>
636 @@ -706,10 +707,12 @@ static struct drm_crtc_state *dpu_crtc_d
637 }
638
639 static void dpu_crtc_disable(struct drm_crtc *crtc,
640 - struct drm_crtc_state *old_crtc_state)
641 + struct drm_atomic_state *state)
642 {
643 struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
644 struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
645 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
646 + crtc);
647 struct drm_encoder *encoder;
648 unsigned long flags;
649 bool release_bandwidth = false;
650 @@ -770,7 +773,7 @@ static void dpu_crtc_disable(struct drm_
651 }
652
653 static void dpu_crtc_enable(struct drm_crtc *crtc,
654 - struct drm_crtc_state *old_crtc_state)
655 + struct drm_atomic_state *state)
656 {
657 struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
658 struct drm_encoder *encoder;
659 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
660 +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
661 @@ -264,7 +264,7 @@ static void mdp4_crtc_mode_set_nofb(stru
662 }
663
664 static void mdp4_crtc_atomic_disable(struct drm_crtc *crtc,
665 - struct drm_crtc_state *old_state)
666 + struct drm_atomic_state *state)
667 {
668 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
669 struct mdp4_kms *mdp4_kms = get_kms(crtc);
670 @@ -284,7 +284,7 @@ static void mdp4_crtc_atomic_disable(str
671 }
672
673 static void mdp4_crtc_atomic_enable(struct drm_crtc *crtc,
674 - struct drm_crtc_state *old_state)
675 + struct drm_atomic_state *state)
676 {
677 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
678 struct mdp4_kms *mdp4_kms = get_kms(crtc);
679 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
680 +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
681 @@ -483,7 +483,7 @@ static u32 mdp5_crtc_get_vblank_counter(
682 }
683
684 static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc,
685 - struct drm_crtc_state *old_state)
686 + struct drm_atomic_state *state)
687 {
688 struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
689 struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state);
690 @@ -529,7 +529,7 @@ static void mdp5_crtc_vblank_on(struct d
691 }
692
693 static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc,
694 - struct drm_crtc_state *old_state)
695 + struct drm_atomic_state *state)
696 {
697 struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
698 struct mdp5_crtc_state *mdp5_cstate = to_mdp5_crtc_state(crtc->state);
699 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c
700 +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c
701 @@ -343,7 +343,7 @@ static void mxsfb_crtc_atomic_flush(stru
702 }
703
704 static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
705 - struct drm_crtc_state *old_state)
706 + struct drm_atomic_state *state)
707 {
708 struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev);
709 struct drm_device *drm = mxsfb->drm;
710 @@ -367,7 +367,7 @@ static void mxsfb_crtc_atomic_enable(str
711 }
712
713 static void mxsfb_crtc_atomic_disable(struct drm_crtc *crtc,
714 - struct drm_crtc_state *old_state)
715 + struct drm_atomic_state *state)
716 {
717 struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev);
718 struct drm_device *drm = mxsfb->drm;
719 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
720 +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
721 @@ -436,7 +436,7 @@ static void omap_crtc_arm_event(struct d
722 }
723
724 static void omap_crtc_atomic_enable(struct drm_crtc *crtc,
725 - struct drm_crtc_state *old_state)
726 + struct drm_atomic_state *state)
727 {
728 struct omap_drm_private *priv = crtc->dev->dev_private;
729 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
730 @@ -462,7 +462,7 @@ static void omap_crtc_atomic_enable(stru
731 }
732
733 static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
734 - struct drm_crtc_state *old_state)
735 + struct drm_atomic_state *state)
736 {
737 struct omap_drm_private *priv = crtc->dev->dev_private;
738 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
739 --- a/drivers/gpu/drm/qxl/qxl_display.c
740 +++ b/drivers/gpu/drm/qxl/qxl_display.c
741 @@ -445,13 +445,13 @@ static const struct drm_framebuffer_func
742 };
743
744 static void qxl_crtc_atomic_enable(struct drm_crtc *crtc,
745 - struct drm_crtc_state *old_state)
746 + struct drm_atomic_state *state)
747 {
748 qxl_crtc_update_monitors_config(crtc, "enable");
749 }
750
751 static void qxl_crtc_atomic_disable(struct drm_crtc *crtc,
752 - struct drm_crtc_state *old_state)
753 + struct drm_atomic_state *state)
754 {
755 qxl_crtc_update_monitors_config(crtc, "disable");
756 }
757 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
758 +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
759 @@ -716,7 +716,7 @@ static int rcar_du_crtc_atomic_check(str
760 }
761
762 static void rcar_du_crtc_atomic_enable(struct drm_crtc *crtc,
763 - struct drm_crtc_state *old_state)
764 + struct drm_atomic_state *state)
765 {
766 struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
767 struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(crtc->state);
768 @@ -751,8 +751,10 @@ static void rcar_du_crtc_atomic_enable(s
769 }
770
771 static void rcar_du_crtc_atomic_disable(struct drm_crtc *crtc,
772 - struct drm_crtc_state *old_state)
773 + struct drm_atomic_state *state)
774 {
775 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
776 + crtc);
777 struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
778 struct rcar_du_crtc_state *rstate = to_rcar_crtc_state(old_state);
779 struct rcar_du_device *rcdu = rcrtc->dev;
780 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
781 +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
782 @@ -693,7 +693,7 @@ static void rockchip_drm_set_win_enabled
783 }
784
785 static void vop_crtc_atomic_disable(struct drm_crtc *crtc,
786 - struct drm_crtc_state *old_state)
787 + struct drm_atomic_state *state)
788 {
789 struct vop *vop = to_vop(crtc);
790
791 @@ -1261,8 +1261,10 @@ static void vop_crtc_atomic_begin(struct
792 }
793
794 static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
795 - struct drm_crtc_state *old_state)
796 + struct drm_atomic_state *state)
797 {
798 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
799 + crtc);
800 struct vop *vop = to_vop(crtc);
801 const struct vop_data *vop_data = vop->data;
802 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
803 --- a/drivers/gpu/drm/sti/sti_crtc.c
804 +++ b/drivers/gpu/drm/sti/sti_crtc.c
805 @@ -23,7 +23,7 @@
806 #include "sti_vtg.h"
807
808 static void sti_crtc_atomic_enable(struct drm_crtc *crtc,
809 - struct drm_crtc_state *old_state)
810 + struct drm_atomic_state *state)
811 {
812 struct sti_mixer *mixer = to_sti_mixer(crtc);
813
814 @@ -35,7 +35,7 @@ static void sti_crtc_atomic_enable(struc
815 }
816
817 static void sti_crtc_atomic_disable(struct drm_crtc *crtc,
818 - struct drm_crtc_state *old_state)
819 + struct drm_atomic_state *state)
820 {
821 struct sti_mixer *mixer = to_sti_mixer(crtc);
822
823 --- a/drivers/gpu/drm/stm/ltdc.c
824 +++ b/drivers/gpu/drm/stm/ltdc.c
825 @@ -420,7 +420,7 @@ static void ltdc_crtc_update_clut(struct
826 }
827
828 static void ltdc_crtc_atomic_enable(struct drm_crtc *crtc,
829 - struct drm_crtc_state *old_state)
830 + struct drm_atomic_state *state)
831 {
832 struct ltdc_device *ldev = crtc_to_ltdc(crtc);
833 struct drm_device *ddev = crtc->dev;
834 @@ -442,7 +442,7 @@ static void ltdc_crtc_atomic_enable(stru
835 }
836
837 static void ltdc_crtc_atomic_disable(struct drm_crtc *crtc,
838 - struct drm_crtc_state *old_state)
839 + struct drm_atomic_state *state)
840 {
841 struct ltdc_device *ldev = crtc_to_ltdc(crtc);
842 struct drm_device *ddev = crtc->dev;
843 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
844 +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
845 @@ -101,7 +101,7 @@ static void sun4i_crtc_atomic_flush(stru
846 }
847
848 static void sun4i_crtc_atomic_disable(struct drm_crtc *crtc,
849 - struct drm_crtc_state *old_state)
850 + struct drm_atomic_state *state)
851 {
852 struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc);
853 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc);
854 @@ -122,7 +122,7 @@ static void sun4i_crtc_atomic_disable(st
855 }
856
857 static void sun4i_crtc_atomic_enable(struct drm_crtc *crtc,
858 - struct drm_crtc_state *old_state)
859 + struct drm_atomic_state *state)
860 {
861 struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc);
862 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc);
863 --- a/drivers/gpu/drm/tegra/dc.c
864 +++ b/drivers/gpu/drm/tegra/dc.c
865 @@ -1748,7 +1748,7 @@ static int tegra_dc_wait_idle(struct teg
866 }
867
868 static void tegra_crtc_atomic_disable(struct drm_crtc *crtc,
869 - struct drm_crtc_state *old_state)
870 + struct drm_atomic_state *state)
871 {
872 struct tegra_dc *dc = to_tegra_dc(crtc);
873 u32 value;
874 @@ -1805,10 +1805,10 @@ static void tegra_crtc_atomic_disable(st
875 }
876
877 static void tegra_crtc_atomic_enable(struct drm_crtc *crtc,
878 - struct drm_crtc_state *old_state)
879 + struct drm_atomic_state *state)
880 {
881 struct drm_display_mode *mode = &crtc->state->adjusted_mode;
882 - struct tegra_dc_state *state = to_dc_state(crtc->state);
883 + struct tegra_dc_state *crtc_state = to_dc_state(crtc->state);
884 struct tegra_dc *dc = to_tegra_dc(crtc);
885 u32 value;
886 int err;
887 @@ -1888,7 +1888,7 @@ static void tegra_crtc_atomic_enable(str
888 tegra_dc_writel(dc, 0, DC_DISP_BORDER_COLOR);
889
890 /* apply PLL and pixel clock changes */
891 - tegra_dc_commit_state(dc, state);
892 + tegra_dc_commit_state(dc, crtc_state);
893
894 /* program display mode */
895 tegra_dc_set_timings(dc, mode);
896 --- a/drivers/gpu/drm/tidss/tidss_crtc.c
897 +++ b/drivers/gpu/drm/tidss/tidss_crtc.c
898 @@ -212,8 +212,10 @@ static void tidss_crtc_atomic_flush(stru
899 }
900
901 static void tidss_crtc_atomic_enable(struct drm_crtc *crtc,
902 - struct drm_crtc_state *old_state)
903 + struct drm_atomic_state *state)
904 {
905 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
906 + crtc);
907 struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
908 struct drm_device *ddev = crtc->dev;
909 struct tidss_device *tidss = to_tidss(ddev);
910 @@ -255,7 +257,7 @@ static void tidss_crtc_atomic_enable(str
911 }
912
913 static void tidss_crtc_atomic_disable(struct drm_crtc *crtc,
914 - struct drm_crtc_state *old_state)
915 + struct drm_atomic_state *state)
916 {
917 struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
918 struct drm_device *ddev = crtc->dev;
919 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
920 +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
921 @@ -484,7 +484,7 @@ static void tilcdc_crtc_enable(struct dr
922 }
923
924 static void tilcdc_crtc_atomic_enable(struct drm_crtc *crtc,
925 - struct drm_crtc_state *old_state)
926 + struct drm_atomic_state *state)
927 {
928 tilcdc_crtc_enable(crtc);
929 }
930 @@ -541,7 +541,7 @@ static void tilcdc_crtc_disable(struct d
931 }
932
933 static void tilcdc_crtc_atomic_disable(struct drm_crtc *crtc,
934 - struct drm_crtc_state *old_state)
935 + struct drm_atomic_state *state)
936 {
937 tilcdc_crtc_disable(crtc);
938 }
939 --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
940 +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
941 @@ -213,12 +213,12 @@ static void vbox_crtc_set_base_and_mode(
942 }
943
944 static void vbox_crtc_atomic_enable(struct drm_crtc *crtc,
945 - struct drm_crtc_state *old_crtc_state)
946 + struct drm_atomic_state *state)
947 {
948 }
949
950 static void vbox_crtc_atomic_disable(struct drm_crtc *crtc,
951 - struct drm_crtc_state *old_crtc_state)
952 + struct drm_atomic_state *state)
953 {
954 }
955
956 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
957 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
958 @@ -489,8 +489,10 @@ int vc4_crtc_disable_at_boot(struct drm_
959 }
960
961 static void vc4_crtc_atomic_disable(struct drm_crtc *crtc,
962 - struct drm_crtc_state *old_state)
963 + struct drm_atomic_state *state)
964 {
965 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
966 + crtc);
967 struct vc4_crtc_state *old_vc4_state = to_vc4_crtc_state(old_state);
968 struct drm_device *dev = crtc->dev;
969
970 @@ -516,8 +518,10 @@ static void vc4_crtc_atomic_disable(stru
971 }
972
973 static void vc4_crtc_atomic_enable(struct drm_crtc *crtc,
974 - struct drm_crtc_state *old_state)
975 + struct drm_atomic_state *state)
976 {
977 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
978 + crtc);
979 struct drm_device *dev = crtc->dev;
980 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
981 struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc);
982 --- a/drivers/gpu/drm/vc4/vc4_txp.c
983 +++ b/drivers/gpu/drm/vc4/vc4_txp.c
984 @@ -13,6 +13,7 @@
985 #include <linux/of_platform.h>
986 #include <linux/pm_runtime.h>
987
988 +#include <drm/drm_atomic.h>
989 #include <drm/drm_atomic_helper.h>
990 #include <drm/drm_edid.h>
991 #include <drm/drm_fb_cma_helper.h>
992 @@ -401,15 +402,19 @@ static int vc4_txp_atomic_check(struct d
993 }
994
995 static void vc4_txp_atomic_enable(struct drm_crtc *crtc,
996 - struct drm_crtc_state *old_state)
997 + struct drm_atomic_state *state)
998 {
999 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
1000 + crtc);
1001 drm_crtc_vblank_on(crtc);
1002 vc4_hvs_atomic_enable(crtc, old_state);
1003 }
1004
1005 static void vc4_txp_atomic_disable(struct drm_crtc *crtc,
1006 - struct drm_crtc_state *old_state)
1007 + struct drm_atomic_state *state)
1008 {
1009 + struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
1010 + crtc);
1011 struct drm_device *dev = crtc->dev;
1012
1013 /* Disable vblank irq handling before crtc is disabled. */
1014 --- a/drivers/gpu/drm/virtio/virtgpu_display.c
1015 +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
1016 @@ -95,12 +95,12 @@ static void virtio_gpu_crtc_mode_set_nof
1017 }
1018
1019 static void virtio_gpu_crtc_atomic_enable(struct drm_crtc *crtc,
1020 - struct drm_crtc_state *old_state)
1021 + struct drm_atomic_state *state)
1022 {
1023 }
1024
1025 static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc,
1026 - struct drm_crtc_state *old_state)
1027 + struct drm_atomic_state *state)
1028 {
1029 struct drm_device *dev = crtc->dev;
1030 struct virtio_gpu_device *vgdev = dev->dev_private;
1031 --- a/drivers/gpu/drm/vkms/vkms_crtc.c
1032 +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
1033 @@ -215,13 +215,13 @@ static int vkms_crtc_atomic_check(struct
1034 }
1035
1036 static void vkms_crtc_atomic_enable(struct drm_crtc *crtc,
1037 - struct drm_crtc_state *old_state)
1038 + struct drm_atomic_state *state)
1039 {
1040 drm_crtc_vblank_on(crtc);
1041 }
1042
1043 static void vkms_crtc_atomic_disable(struct drm_crtc *crtc,
1044 - struct drm_crtc_state *old_state)
1045 + struct drm_atomic_state *state)
1046 {
1047 drm_crtc_vblank_off(crtc);
1048 }
1049 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
1050 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
1051 @@ -214,7 +214,7 @@ static void vmw_ldu_crtc_mode_set_nofb(s
1052 * CRTC, it makes more sense to do those at plane update time.
1053 */
1054 static void vmw_ldu_crtc_atomic_enable(struct drm_crtc *crtc,
1055 - struct drm_crtc_state *old_state)
1056 + struct drm_atomic_state *state)
1057 {
1058 }
1059
1060 @@ -224,7 +224,7 @@ static void vmw_ldu_crtc_atomic_enable(s
1061 * @crtc: CRTC to be turned off
1062 */
1063 static void vmw_ldu_crtc_atomic_disable(struct drm_crtc *crtc,
1064 - struct drm_crtc_state *old_state)
1065 + struct drm_atomic_state *state)
1066 {
1067 }
1068
1069 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
1070 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
1071 @@ -279,7 +279,7 @@ static void vmw_sou_crtc_helper_prepare(
1072 * This is called after a mode set has been completed.
1073 */
1074 static void vmw_sou_crtc_atomic_enable(struct drm_crtc *crtc,
1075 - struct drm_crtc_state *old_state)
1076 + struct drm_atomic_state *state)
1077 {
1078 }
1079
1080 @@ -289,7 +289,7 @@ static void vmw_sou_crtc_atomic_enable(s
1081 * @crtc: CRTC to be turned off
1082 */
1083 static void vmw_sou_crtc_atomic_disable(struct drm_crtc *crtc,
1084 - struct drm_crtc_state *old_state)
1085 + struct drm_atomic_state *state)
1086 {
1087 struct vmw_private *dev_priv;
1088 struct vmw_screen_object_unit *sou;
1089 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
1090 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
1091 @@ -408,12 +408,12 @@ static void vmw_stdu_crtc_helper_prepare
1092 }
1093
1094 static void vmw_stdu_crtc_atomic_enable(struct drm_crtc *crtc,
1095 - struct drm_crtc_state *old_state)
1096 + struct drm_atomic_state *state)
1097 {
1098 }
1099
1100 static void vmw_stdu_crtc_atomic_disable(struct drm_crtc *crtc,
1101 - struct drm_crtc_state *old_state)
1102 + struct drm_atomic_state *state)
1103 {
1104 struct vmw_private *dev_priv;
1105 struct vmw_screen_target_display_unit *stdu;
1106 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
1107 +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
1108 @@ -1441,7 +1441,7 @@ static int zynqmp_disp_crtc_setup_clock(
1109
1110 static void
1111 zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc,
1112 - struct drm_crtc_state *old_crtc_state)
1113 + struct drm_atomic_state *state)
1114 {
1115 struct zynqmp_disp *disp = crtc_to_disp(crtc);
1116 struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode;
1117 @@ -1473,8 +1473,10 @@ zynqmp_disp_crtc_atomic_enable(struct dr
1118
1119 static void
1120 zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc,
1121 - struct drm_crtc_state *old_crtc_state)
1122 + struct drm_atomic_state *state)
1123 {
1124 + struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
1125 + crtc);
1126 struct zynqmp_disp *disp = crtc_to_disp(crtc);
1127 struct drm_plane_state *old_plane_state;
1128
1129 --- a/drivers/gpu/drm/zte/zx_vou.c
1130 +++ b/drivers/gpu/drm/zte/zx_vou.c
1131 @@ -350,7 +350,7 @@ static inline void vou_chn_set_update(st
1132 }
1133
1134 static void zx_crtc_atomic_enable(struct drm_crtc *crtc,
1135 - struct drm_crtc_state *old_state)
1136 + struct drm_atomic_state *state)
1137 {
1138 struct drm_display_mode *mode = &crtc->state->adjusted_mode;
1139 bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE;
1140 @@ -455,7 +455,7 @@ static void zx_crtc_atomic_enable(struct
1141 }
1142
1143 static void zx_crtc_atomic_disable(struct drm_crtc *crtc,
1144 - struct drm_crtc_state *old_state)
1145 + struct drm_atomic_state *state)
1146 {
1147 struct zx_crtc *zcrtc = to_zx_crtc(crtc);
1148 const struct zx_crtc_bits *bits = zcrtc->bits;
1149 --- a/include/drm/drm_modeset_helper_vtables.h
1150 +++ b/include/drm/drm_modeset_helper_vtables.h
1151 @@ -417,14 +417,10 @@ struct drm_crtc_helper_funcs {
1152 * @atomic_enable must be the inverse of @atomic_disable for atomic
1153 * drivers.
1154 *
1155 - * Drivers can use the @old_crtc_state input parameter if the operations
1156 - * needed to enable the CRTC don't depend solely on the new state but
1157 - * also on the transition between the old state and the new state.
1158 - *
1159 * This function is optional.
1160 */
1161 void (*atomic_enable)(struct drm_crtc *crtc,
1162 - struct drm_crtc_state *old_crtc_state);
1163 + struct drm_atomic_state *state);
1164
1165 /**
1166 * @atomic_disable:
1167 @@ -441,15 +437,10 @@ struct drm_crtc_helper_funcs {
1168 * need to implement it if there's no need to disable anything at the
1169 * CRTC level.
1170 *
1171 - * Comparing to @disable, this one provides the additional input
1172 - * parameter @old_crtc_state which could be used to access the old
1173 - * state. Atomic drivers should consider to use this one instead
1174 - * of @disable.
1175 - *
1176 * This function is optional.
1177 */
1178 void (*atomic_disable)(struct drm_crtc *crtc,
1179 - struct drm_crtc_state *old_crtc_state);
1180 + struct drm_atomic_state *state);
1181
1182 /**
1183 * @get_scanout_position: