WSL2-Linux-Kernel/drivers/gpu/drm/nouveau
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
..
dispnv04 drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
dispnv50 drm/atomic: Pass the full state to planes atomic_check 2021-02-24 20:27:00 +01:00
include drm/nouveau/kms/nv50-: Program notifier offset before requesting disp caps 2020-10-30 09:34:12 +10:00
nvif drm/nouveau/nvif: add support for object-level debug output 2020-07-24 18:50:51 +10:00
nvkm drm/nouveau/nvkm/core/firmware: Fix formatting, provide missing param description 2020-11-17 20:02:03 +01:00
Kbuild drm/nouveau/bo: split buffer move functions into their own source files 2020-07-24 18:50:56 +10:00
Kconfig drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends 2020-11-09 09:19:24 +01:00
nouveau_abi16.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_abi16.h
nouveau_acpi.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_acpi.h
nouveau_backlight.c
nouveau_bios.c drm/nouveau: remove set but not used variable ‘pdev’ in nouveau_bios_init 2021-02-03 09:19:19 +01:00
nouveau_bios.h
nouveau_bo.c drm/ttm: move memory accounting into vmwgfx v4 2021-02-09 17:27:33 +01:00
nouveau_bo.h drm/ttm: device naming cleanup 2021-01-21 14:51:45 +01:00
nouveau_bo0039.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_bo74c1.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_bo85b5.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_bo90b5.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_bo5039.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_bo9039.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_boa0b5.c Merge drm/drm-next into drm-misc-next 2020-08-12 20:42:08 +02:00
nouveau_chan.c drm/nouveau: switch over to the new pin interface 2020-09-24 16:16:50 +02:00
nouveau_chan.h drm/nouveau: interop with new push macros 2020-07-24 18:50:56 +10:00
nouveau_connector.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_connector.h drm/nouveau/kms: Only use hpd_work for reprobing in HPD paths 2020-08-31 19:10:08 -04:00
nouveau_crtc.h
nouveau_debugfs.c drm/nouveau/nvif: give every object a human-readable identifier 2020-07-24 18:50:50 +10:00
nouveau_debugfs.h
nouveau_display.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
nouveau_display.h drm/nouveau/kms: Only use hpd_work for reprobing in HPD paths 2020-08-31 19:10:08 -04:00
nouveau_dma.c drm/nouveau/fbcon: convert imageblit() to new push macros 2020-07-24 18:50:56 +10:00
nouveau_dma.h drm/nouveau/fence: use NVIDIA's headers for sync() 2020-07-24 18:51:04 +10:00
nouveau_dmem.c drm next for 5.10-rc1 2020-10-15 10:46:16 -07:00
nouveau_dmem.h
nouveau_dp.c drm/nouveau/kms/nv50-: Fix clock checking algorithm in nv50_dp_mode_valid() 2020-10-30 09:34:13 +10:00
nouveau_drm.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_drv.h drm/ttm: move memory accounting into vmwgfx v4 2021-02-09 17:27:33 +01:00
nouveau_encoder.h drm/nouveau/kms/nv50-: Add support for DP_SINK_COUNT 2020-08-31 19:10:09 -04:00
nouveau_fbcon.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_fbcon.h
nouveau_fence.c drm/nouveau/nvif: give every notify object a human-readable name 2020-07-24 18:50:51 +10:00
nouveau_fence.h
nouveau_gem.c drm for 5.11-rc1 2020-12-14 11:07:56 -08:00
nouveau_gem.h drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends 2020-11-09 09:19:24 +01:00
nouveau_hwmon.c
nouveau_hwmon.h
nouveau_ioc32.c
nouveau_ioctl.h
nouveau_led.c
nouveau_led.h
nouveau_mem.c Merge drm/drm-next into drm-misc-next 2020-11-02 11:17:54 +01:00
nouveau_mem.h drm/ttm: merge ttm_dma_tt back into ttm_tt 2020-10-26 14:45:42 +01:00
nouveau_nvif.c
nouveau_platform.c
nouveau_platform.h
nouveau_prime.c drm/ttm: cleanup BO size handling v3 2020-12-14 14:20:46 +01:00
nouveau_reg.h
nouveau_sgdma.c drm/ttm: device naming cleanup 2021-01-21 14:51:45 +01:00
nouveau_svm.c drm/nouveau/nouveau: fix the start/end range for migration 2020-10-30 09:34:11 +10:00
nouveau_svm.h nouveau/svm: use the new migration invalidation 2020-07-28 16:20:33 -03:00
nouveau_ttm.c drm/ttm: device naming cleanup 2021-01-21 14:51:45 +01:00
nouveau_ttm.h drm/ttm: device naming cleanup 2021-01-21 14:51:45 +01:00
nouveau_usif.c
nouveau_usif.h
nouveau_vga.c drm/nouveau: Remove references to struct drm_device.pdev 2021-01-13 09:04:04 +01:00
nouveau_vga.h
nouveau_vmm.c drm/nouveau/nvif: give every vmm object a human-readable identifier 2020-07-24 18:50:51 +10:00
nouveau_vmm.h
nv04_fbcon.c drm/nouveau/fbcon: convert copyarea() to new push macros 2020-07-24 18:50:56 +10:00
nv04_fence.c drm/nouveau/fence: convert emit() to new push macros 2020-07-24 18:50:58 +10:00
nv10_fence.c drm/nouveau/fence: use NVIDIA's headers for read() 2020-07-24 18:51:04 +10:00
nv10_fence.h
nv17_fence.c drm/ttm: cleanup BO size handling v3 2020-12-14 14:20:46 +01:00
nv50_display.h
nv50_fbcon.c drm/nouveau/fbcon/nv50-: use NVIDIA's headers for fillrect() 2020-07-24 18:51:04 +10:00
nv50_fence.c drm/ttm: cleanup BO size handling v3 2020-12-14 14:20:46 +01:00
nv84_fence.c drm/nouveau: stop using TTM placement flags 2020-09-11 13:31:23 +02:00
nvc0_fbcon.c drm/nouveau/fbcon/nv50-: use NVIDIA's headers for fillrect() 2020-07-24 18:51:04 +10:00
nvc0_fence.c drm/nouveau/fence: use NVIDIA's headers for sync() 2020-07-24 18:51:04 +10:00