linux/drivers/gpu/drm/zte
Gabriel Krisman Bertazi e4563f6ba7 drm: Rely on mode_config data for fb_helper initialization
Instead of receiving the num_crts as a parameter, we can read it
directly from the mode_config structure.  I audited the drivers that
invoke this helper and I believe all of them initialize the mode_config
struct accordingly, prior to calling the fb_helper.

I used the following coccinelle hack to make this transformation, except
for the function headers and comment updates.  The first and second
rules are split because I couldn't find a way to remove the unused
temporary variables at the same time I removed the parameter.

// <smpl>
@r@
expression A,B,D,E;
identifier C;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
identifier r.C;
type T;
expression V;
@@
- T C;
<...
when != C
- C = V;
...>
// </smpl>

Changes since v1:
 - Rebased on top of the tip of drm-misc-next.
 - Remove mention to sti since a proper fix got merged.

Suggested-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170202162640.27261-1-krisman@collabora.co.uk
2017-02-02 19:12:00 +01:00
..
Kconfig drm: zte: support hdmi audio through spdif 2017-01-28 10:17:39 +08:00
Makefile drm: zte: add tvenc driver support 2017-01-28 11:51:23 +08:00
zx_drm_drv.c drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
zx_drm_drv.h drm: zte: add tvenc driver support 2017-01-28 11:51:23 +08:00
zx_hdmi.c drm: zte: move struct vou_inf into zx_vou driver 2017-01-28 11:51:21 +08:00
zx_hdmi_regs.h drm: zte: support hdmi audio through spdif 2017-01-28 10:17:39 +08:00
zx_plane.c ZTE DRM driver updates for 4.11: 2017-02-01 08:29:04 +10:00
zx_plane.h drm: zte: add .atomic_disable hook to disable graphic layer 2017-01-28 10:17:40 +08:00
zx_plane_regs.h drm: zte: add overlay plane support 2017-01-28 10:17:41 +08:00
zx_tvenc.c drm: zte: add tvenc driver support 2017-01-28 11:51:23 +08:00
zx_tvenc_regs.h drm: zte: add tvenc driver support 2017-01-28 11:51:23 +08:00
zx_vou.c ZTE DRM driver updates for 4.11: 2017-02-01 08:29:04 +10:00
zx_vou.h drm: zte: add function to configure vou_ctrl dividers 2017-01-28 11:51:22 +08:00
zx_vou_regs.h drm: zte: add function to configure vou_ctrl dividers 2017-01-28 11:51:22 +08:00