linux-stable/drivers/gpu/drm/qxl
Maxime Ripard 7c11b99a8e
drm/atomic: Pass the full state to planes atomic_check
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 all the remaining helpers to provide a consistent
interface, starting with the planes atomic_check.

The conversion was done using the coccinelle script below plus some
manual changes for vmwgfx, built tested on all the drivers.

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

 struct drm_plane_helper_funcs {
 	...
	int (*atomic_check)(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_check = func,
	...,
};

@@
struct drm_plane_helper_funcs *FUNCS;
identifier f;
identifier dev;
identifier plane, plane_state, state;
@@

 f(struct drm_device *dev, struct drm_atomic_state *state)
 {
 	<+...
-	FUNCS->atomic_check(plane, plane_state)
+	FUNCS->atomic_check(plane, state)
 	...+>
 }

@ ignores_new_state @
identifier plane_atomic_func.func;
identifier plane, new_plane_state;
@@

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

@ adds_new_state depends on plane_atomic_func && !ignores_new_state @
identifier plane_atomic_func.func;
identifier plane, new_plane_state;
@@

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

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

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

@ include depends on adds_new_state @
@@

 #include <drm/drm_atomic.h>

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

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

Reviewed-by: 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-4-maxime@cerno.tech
2021-02-24 20:27:00 +01:00
..
Kconfig drm/qxl: Fix randbuild error 2019-10-17 14:31:50 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
qxl_cmd.c drm/qxl: use ttm bo priorities 2021-02-19 09:13:25 +01:00
qxl_debugfs.c drm/qxl: switch over to the new pin interface 2020-09-24 16:16:50 +02:00
qxl_dev.h drm/qxl: use flexible-array member instead of zero-length array 2020-12-22 13:43:29 +01:00
qxl_display.c drm/atomic: Pass the full state to planes atomic_check 2021-02-24 20:27:00 +01:00
qxl_draw.c drm/qxl: rename qxl_bo_kmap -> qxl_bo_vmap_locked 2021-02-19 09:13:25 +01:00
qxl_drv.c Revert "drm/qxl: do not run release if qxl failed to init" 2021-02-05 08:52:15 +01:00
qxl_drv.h drm/qxl: properly free qxl releases 2021-02-05 08:52:45 +01:00
qxl_dumb.c drm/qxl: allocate dumb buffers in ram 2021-02-05 09:02:40 +01:00
qxl_gem.c drm/qxl: use ttm bo priorities 2021-02-19 09:13:25 +01:00
qxl_image.c drm/qxl: rename qxl_bo_kmap -> qxl_bo_vmap_locked 2021-02-19 09:13:25 +01:00
qxl_ioctl.c drm/qxl: Remove references to struct drm_device.pdev 2021-01-06 15:43:14 +01:00
qxl_irq.c drm/qxl: properly free qxl releases 2021-02-05 08:52:45 +01:00
qxl_kms.c drm/qxl: properly handle device init failures 2021-02-19 09:13:25 +01:00
qxl_object.c drm/qxl: add lock asserts to qxl_bo_vmap_locked + qxl_bo_vunmap_locked 2021-02-19 09:13:25 +01:00
qxl_object.h drm/qxl: add qxl_bo_vmap/qxl_bo_vunmap 2021-02-19 09:13:25 +01:00
qxl_prime.c drm/qxl: fix prime vmap 2021-02-19 09:13:25 +01:00
qxl_release.c drm/qxl: fix lockdep issue in qxl_alloc_release_reserved 2021-02-19 09:13:25 +01:00
qxl_ttm.c drm/ttm: device naming cleanup 2021-01-21 14:51:45 +01:00