linux-stable/drivers/gpu/drm/vboxvideo
Maxime Ripard e05162c017
drm: Store new plane state in a variable for atomic_update and disable
In order to store the new plane state in a subsequent helper, let's move
the plane->state dereferences into a variable.

This was done using the following coccinelle script, plus some hand
changes for vmwgfx:

@ 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,
	...,
 };
)

@ has_new_state_old_state @
identifier plane_atomic_func.func;
identifier plane;
identifier new_state;
symbol old_state;
@@

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

@ depends on !has_new_state_old_state @
identifier plane_atomic_func.func;
identifier plane;
symbol old_state;
@@

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

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

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

@ depends on !has_new_state_state @
identifier plane_atomic_func.func;
identifier plane;
symbol state;
@@

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

@ has_new_state_old_s @
identifier plane_atomic_func.func;
identifier plane;
identifier new_state;
symbol old_s;
@@

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

@ depends on !has_new_state_old_s @
identifier plane_atomic_func.func;
identifier plane;
symbol old_s;
@@

 func(struct drm_plane *plane, struct drm_plane_state *old_s)
 {
+	struct drm_plane_state *new_s = plane->state;
 	<+...
-	plane->state
+	new_s
	...+>
 }

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://lore.kernel.org/r/20210219120032.260676-1-maxime@cerno.tech
2021-02-24 20:27:09 +01:00
..
hgsmi_base.c
hgsmi_ch_setup.h
hgsmi_channels.h
hgsmi_defs.h drm/vboxvideo: Replace HTTP links with HTTPS ones 2020-07-16 22:12:50 +02:00
Kconfig
Makefile
modesetting.c
vbox_drv.c drm/vboxvideo: Remove references to struct drm_device.pdev 2021-01-06 15:44:04 +01:00
vbox_drv.h drm/vboxvideo: Stop using drm_device->dev_private 2020-04-28 15:07:35 +02:00
vbox_hgsmi.c drm/vboxvideo: Replace HTTP links with HTTPS ones 2020-07-16 22:12:50 +02:00
vbox_irq.c drm/vboxvideo: Remove references to struct drm_device.pdev 2021-01-06 15:44:04 +01:00
vbox_main.c drm/vboxvideo: Remove references to struct drm_device.pdev 2021-01-06 15:44:04 +01:00
vbox_mode.c drm: Store new plane state in a variable for atomic_update and disable 2021-02-24 20:27:09 +01:00
vbox_ttm.c drm/vboxvideo: Remove references to struct drm_device.pdev 2021-01-06 15:44:04 +01:00
vboxvideo.h drm/vboxvideo/vboxvideo.h: Replace zero-length array with flexible-array member 2020-03-07 12:55:05 +01:00
vboxvideo_guest.h
vboxvideo_vbe.h
vbva_base.c