mirror_ubuntu-kernels/drivers/gpu/drm/msm
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
..
adreno drm/msm: a5xx: Make preemption reset case reentrant 2020-12-05 08:19:15 -08:00
disp drm/atomic: Pass the full state to planes atomic_check 2021-02-24 20:27:00 +01:00
dp drm/msm/dp: fix connect/disconnect handled at irq_hpd 2020-12-03 08:51:40 -08:00
dsi drm/msm: dsi: Constify dsi_host_ops 2020-11-29 10:54:08 -08:00
edp drm/msm: sync generated headers 2020-07-31 06:46:16 -07:00
hdmi drm/msm: sync generated headers 2020-07-31 06:46:16 -07:00
Kconfig drm/msm: add IOMMU_SUPPORT dependency 2020-12-05 08:25:52 -08:00
Makefile drm/msm/dpu: initial support for merge3D hardware block 2020-11-04 08:26:26 -08:00
msm_atomic_trace.h
msm_atomic_tracepoints.c
msm_atomic.c drm/gem: Move drm_gem_fb_prepare_fb() to GEM atomic helpers 2021-02-23 08:54:22 +01:00
msm_debugfs.c drm/msm/shrinker: Only iterate dontneed objs 2020-11-21 09:50:24 -08:00
msm_debugfs.h
msm_drv.c Merge tag 'drm-msm-next-2020-12-07' of https://gitlab.freedesktop.org/drm/msm into drm-next 2020-12-10 09:42:47 +10:00
msm_drv.h Merge tag 'drm-msm-next-2020-12-07' of https://gitlab.freedesktop.org/drm/msm into drm-next 2020-12-10 09:42:47 +10:00
msm_fb.c
msm_fbdev.c drm/msm/gem: Move prototypes to msm_gem.h 2020-11-04 16:00:55 -08:00
msm_fence.c
msm_fence.h
msm_gem_prime.c drm/msm: Use struct dma_buf_map in GEM vmap ops 2020-11-10 10:38:57 +01:00
msm_gem_shrinker.c drm/msm/msm_gem_shrinker: Fix descriptions for 'drm_device' 2020-11-29 10:36:53 -08:00
msm_gem_submit.c drm/msm: Refcount submits 2020-11-04 16:00:56 -08:00
msm_gem_vma.c drm/msm: Leave inuse count intact on map failure 2020-09-22 08:28:15 -07:00
msm_gem.c Merge drm/drm-next into drm-misc-next 2020-12-15 11:05:43 +01:00
msm_gem.h Merge tag 'drm-msm-next-2020-12-07' of https://gitlab.freedesktop.org/drm/msm into drm-next 2020-12-10 09:42:47 +10:00
msm_gpu_trace.h drm/msm/gpu: Add suspend/resume tracepoints 2020-09-12 09:59:58 -07:00
msm_gpu_tracepoints.c
msm_gpu.c drm/msm: Protect obj->active_count under obj lock 2020-11-21 09:50:23 -08:00
msm_gpu.h drm/msm: rearrange the gpu_rmw() function 2020-11-29 11:03:04 -08:00
msm_gpummu.c Merge tag 'drm-msm-next-2020-09-27' of https://gitlab.freedesktop.org/drm/msm into drm-next 2020-09-29 10:18:49 +10:00
msm_iommu.c iommu/io-pgtable: Remove tlb_flush_leaf 2020-12-08 15:23:37 +00:00
msm_kms.h drm/msm/atomic: Convert to per-CRTC kthread_work 2020-11-01 10:13:32 -08:00
msm_mmu.h drm/msm: Add support to create a local pagetable 2020-09-12 10:48:32 -07:00
msm_perf.c
msm_rd.c drm/msm/gem: Switch over to obj->resv for locking 2020-11-04 16:00:56 -08:00
msm_ringbuffer.c drm/msm: Protect ring->submits with it's own lock 2020-11-04 16:00:56 -08:00
msm_ringbuffer.h drm/msm: Protect ring->submits with it's own lock 2020-11-04 16:00:56 -08:00
msm_submitqueue.c drm/msm: Add a context pointer to the submitqueue 2020-09-12 10:45:56 -07:00
NOTES