-
- Downloads
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
Showing
- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c 0 additions, 1 deletiondrivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
- drivers/gpu/drm/arc/arcpgu_drv.c 1 addition, 2 deletionsdrivers/gpu/drm/arc/arcpgu_drv.c
- drivers/gpu/drm/arm/hdlcd_drv.c 1 addition, 1 deletiondrivers/gpu/drm/arm/hdlcd_drv.c
- drivers/gpu/drm/arm/malidp_drv.c 1 addition, 1 deletiondrivers/gpu/drm/arm/malidp_drv.c
- drivers/gpu/drm/armada/armada_fbdev.c 1 addition, 1 deletiondrivers/gpu/drm/armada/armada_fbdev.c
- drivers/gpu/drm/ast/ast_fb.c 1 addition, 2 deletionsdrivers/gpu/drm/ast/ast_fb.c
- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c 0 additions, 1 deletiondrivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
- drivers/gpu/drm/bochs/bochs_fbdev.c 1 addition, 2 deletionsdrivers/gpu/drm/bochs/bochs_fbdev.c
- drivers/gpu/drm/cirrus/cirrus_fbdev.c 1 addition, 1 deletiondrivers/gpu/drm/cirrus/cirrus_fbdev.c
- drivers/gpu/drm/drm_fb_cma_helper.c 7 additions, 8 deletionsdrivers/gpu/drm/drm_fb_cma_helper.c
- drivers/gpu/drm/drm_fb_helper.c 5 additions, 5 deletionsdrivers/gpu/drm/drm_fb_helper.c
- drivers/gpu/drm/exynos/exynos_drm_fbdev.c 1 addition, 4 deletionsdrivers/gpu/drm/exynos/exynos_drm_fbdev.c
- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c 1 addition, 1 deletiondrivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
- drivers/gpu/drm/gma500/framebuffer.c 1 addition, 1 deletiondrivers/gpu/drm/gma500/framebuffer.c
- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c 1 addition, 2 deletionsdrivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c
- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c 1 addition, 2 deletionsdrivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
- drivers/gpu/drm/i915/intel_fbdev.c 1 addition, 2 deletionsdrivers/gpu/drm/i915/intel_fbdev.c
- drivers/gpu/drm/imx/imx-drm-core.c 1 addition, 2 deletionsdrivers/gpu/drm/imx/imx-drm-core.c
- drivers/gpu/drm/meson/meson_drv.c 0 additions, 1 deletiondrivers/gpu/drm/meson/meson_drv.c
- drivers/gpu/drm/mgag200/mgag200_fb.c 1 addition, 1 deletiondrivers/gpu/drm/mgag200/mgag200_fb.c
Loading
Please register or sign in to comment