linux/drivers/gpu/drm
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
..
amd drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
arc drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
arm drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
armada drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
ast drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
atmel-hlcdc drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
bochs drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
bridge drm/bridge/sii8620: enable interlace modes 2017-02-02 15:15:31 +05:30
cirrus drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
etnaviv
exynos drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
fsl-dcu drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
gma500 drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
hisilicon drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
i2c
i810
i915 drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
imx drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
lib
mediatek
meson drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
mga
mgag200 drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
msm drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
mxsfb drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
nouveau drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
omapdrm drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
panel
qxl drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
r128
radeon drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
rcar-du drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
rockchip drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
savage
selftests
shmobile
sis
sti drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
sun4i drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
tdfx
tegra drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
tilcdc drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
ttm
udl drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
vc4 drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
vgem
via
virtio drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
vmwgfx
zte drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
ati_pcigart.c
drm_agpsupport.c
drm_atomic_helper.c
drm_atomic.c
drm_auth.c
drm_blend.c
drm_bridge.c
drm_bufs.c
drm_cache.c
drm_color_mgmt.c
drm_connector.c
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h drm: Clean up the 1366x768 fixup codes 2017-02-01 19:01:47 +02:00
drm_crtc.c
drm_debugfs_crc.c
drm_debugfs.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c
drm_dp_mst_topology.c
drm_drv.c drm: Provide a driver hook for drm_dev_release() 2017-02-02 15:58:06 +01:00
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm: Clean up the 1366x768 fixup codes 2017-02-01 19:01:47 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
drm_fb_helper.c drm: Rely on mode_config data for fb_helper initialization 2017-02-02 19:12:00 +01:00
drm_flip_work.c
drm_fops.c
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem.c
drm_global.c
drm_hashtab.c
drm_info.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_legacy.h
drm_lock.c
drm_memory.c
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c drm: Clean up the 1366x768 fixup codes 2017-02-01 19:01:47 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_pci.c
drm_plane_helper.c
drm_plane.c
drm_platform.c
drm_prime.c
drm_print.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c
drm_simple_kms_helper.c
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vm.c
drm_vma_manager.c
Kconfig
Makefile