linux-stable/drivers/gpu/drm/armada
Maxime Ripard 41016fe102
drm: Rename plane->state variables in atomic update and disable
Some drivers are storing the plane->state pointer in atomic_update and
atomic_disable in a variable simply called state, while the state passed
as an argument is called old_state.

In order to ease subsequent reworks and to avoid confusing or
inconsistent names, let's rename those variables to new_state.

This was done using the following coccinelle script, plus some manual
changes for mtk and tegra.

@ plane_atomic_func @
identifier helpers;
identifier func;
@@

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

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

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

@ depends on moves_new_state_old_state @
identifier plane_atomic_func.func;
identifier plane;
identifier old_state;
symbol state;
@@

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

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

 func(struct drm_plane *plane, struct drm_plane_state *oldstate)
 {
 	...
-	struct drm_plane_state *state = plane->state;
+	struct drm_plane_state *newstate = plane->state;
	...
 }

@ depends on moves_new_state_oldstate @
identifier plane_atomic_func.func;
identifier plane;
identifier old_state;
symbol state;
@@

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

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

 func(struct drm_plane *plane, struct drm_plane_state *old_pstate)
 {
 	...
-	struct drm_plane_state *state = plane->state;
+	struct drm_plane_state *new_pstate = plane->state;
	...
 }

@ depends on moves_new_state_old_pstate @
identifier plane_atomic_func.func;
identifier plane;
identifier old_pstate;
symbol state;
@@

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

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210219120032.260676-8-maxime@cerno.tech
2021-02-24 20:27:12 +01:00
..
armada_510.c drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
armada_crtc.c drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
armada_crtc.h drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
armada_debugfs.c drm/armada: Don't use drm_device->dev_private 2020-09-11 10:47:19 +02:00
armada_drm.h drm/armada: Don't use drm_device->dev_private 2020-09-11 10:47:19 +02:00
armada_drv.c drm/<drivers>: Constify struct drm_driver 2020-11-06 10:31:26 +01:00
armada_fb.c drm/armada: remove _unlocked suffix in drm_gem_object_put_unlocked 2020-05-19 22:31:32 +01:00
armada_fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
armada_fbdev.c drm/armada: Don't use drm_device->dev_private 2020-09-11 10:47:19 +02:00
armada_gem.c Merge drm/drm-next into drm-misc-next 2020-11-02 11:17:54 +01:00
armada_gem.h drm/armada: Introduce GEM object functions 2020-09-25 09:20:13 +02:00
armada_hw.h drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
armada_ioctlP.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
armada_overlay.c drm: Rename plane->state variables in atomic update and disable 2021-02-24 20:27:12 +01:00
armada_plane.c drm: Rename plane->state variables in atomic update and disable 2021-02-24 20:27:12 +01:00
armada_plane.h drm/atomic: Pass the full state to planes atomic_check 2021-02-24 20:27:00 +01:00
armada_trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
armada_trace.h drm/armada: drop use of drmP.h 2019-08-14 18:31:10 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile drm/armada: move primary plane to separate file 2018-07-30 11:52:34 +01:00