drm: Rely on mode_config data for fb_helper initialization
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>
Thu, 2 Feb 2017 16:26:40 +0000 (14:26 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Feb 2017 18:12:00 +0000 (19:12 +0100)
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
38 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
drivers/gpu/drm/arc/arcpgu_drv.c
drivers/gpu/drm/arm/hdlcd_drv.c
drivers/gpu/drm/arm/malidp_drv.c
drivers/gpu/drm/armada/armada_fbdev.c
drivers/gpu/drm/ast/ast_fb.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
drivers/gpu/drm/bochs/bochs_fbdev.c
drivers/gpu/drm/cirrus/cirrus_fbdev.c
drivers/gpu/drm/drm_fb_cma_helper.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
drivers/gpu/drm/i915/intel_fbdev.c
drivers/gpu/drm/imx/imx-drm-core.c
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/mgag200/mgag200_fb.c
drivers/gpu/drm/msm/msm_fbdev.c
drivers/gpu/drm/mxsfb/mxsfb_drv.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/omapdrm/omap_fbdev.c
drivers/gpu/drm/qxl/qxl_fb.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/rcar-du/rcar_du_kms.c
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
drivers/gpu/drm/sti/sti_drv.c
drivers/gpu/drm/sun4i/sun4i_framebuffer.c
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/tilcdc/tilcdc_drv.c
drivers/gpu/drm/udl/udl_fb.c
drivers/gpu/drm/vc4/vc4_kms.c
drivers/gpu/drm/virtio/virtgpu_fb.c
drivers/gpu/drm/zte/zx_drm_drv.c
include/drm/drm_fb_cma_helper.h
include/drm/drm_fb_helper.h

index 838943d0962e04dfebbe2f90f0f56539a326d607..36ce3cac81ba8541c845cf5bad0d10dcaf4137ee 100644 (file)
@@ -374,7 +374,6 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
                        &amdgpu_fb_helper_funcs);
 
        ret = drm_fb_helper_init(adev->ddev, &rfbdev->helper,
-                                adev->mode_info.num_crtc,
                                 AMDGPUFB_CONN_LIMIT);
        if (ret) {
                kfree(rfbdev);
index 0b6eaa49a1db15f5f4f8bdbe342fb40866931048..8d8344ed655e21f90c61515a3e3cbf01ab7ac2fc 100644 (file)
@@ -135,8 +135,7 @@ static int arcpgu_load(struct drm_device *drm)
        drm_kms_helper_poll_init(drm);
 
        arcpgu->fbdev = drm_fbdev_cma_init(drm, 16,
-                                             drm->mode_config.num_crtc,
-                                             drm->mode_config.num_connector);
+                                          drm->mode_config.num_connector);
        if (IS_ERR(arcpgu->fbdev)) {
                ret = PTR_ERR(arcpgu->fbdev);
                arcpgu->fbdev = NULL;
index a2e5b04cdee350d3a4c14d78bedf01c8805aae49..4ce4f970920b24607cefc1539c2b600b0662995b 100644 (file)
@@ -349,7 +349,7 @@ static int hdlcd_drm_bind(struct device *dev)
        drm_mode_config_reset(drm);
        drm_kms_helper_poll_init(drm);
 
-       hdlcd->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
+       hdlcd->fbdev = drm_fbdev_cma_init(drm, 32,
                                          drm->mode_config.num_connector);
 
        if (IS_ERR(hdlcd->fbdev)) {
index 99fb0ab391919846201396c9d35c44caf6e378de..8b0672d4aee9137d316a454e3f4d219219d99028 100644 (file)
@@ -457,7 +457,7 @@ static int malidp_bind(struct device *dev)
 
        drm_mode_config_reset(drm);
 
-       malidp->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
+       malidp->fbdev = drm_fbdev_cma_init(drm, 32,
                                           drm->mode_config.num_connector);
 
        if (IS_ERR(malidp->fbdev)) {
index 78335100cbc3e69f770d7ca1852ec7a83b6f1612..0233e1dc33e1b229f340ecc749c69c7435818f08 100644 (file)
@@ -137,7 +137,7 @@ int armada_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, fbh, &armada_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, fbh, 1, 1);
+       ret = drm_fb_helper_init(dev, fbh, 1);
        if (ret) {
                DRM_ERROR("failed to initialize drm fb helper\n");
                goto err_fb_helper;
index b085140fae958fea9392435fa84aa2e7993a348d..5d0ffab411a80b4a267ed24a26e2d2249c6b3f09 100644 (file)
@@ -315,8 +315,7 @@ int ast_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, &afbdev->helper, &ast_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, &afbdev->helper,
-                                1, 1);
+       ret = drm_fb_helper_init(dev, &afbdev->helper, 1);
        if (ret)
                goto free;
 
index 0bf32d6ac39ba0ddce7b149520e4f5c84a0c1fc9..427bdff425c24fc502e8b767eb6dcc26cd367289 100644 (file)
@@ -647,7 +647,6 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev)
        platform_set_drvdata(pdev, dev);
 
        dc->fbdev = drm_fbdev_cma_init(dev, 24,
-                       dev->mode_config.num_crtc,
                        dev->mode_config.num_connector);
        if (IS_ERR(dc->fbdev))
                dc->fbdev = NULL;
index 0317c3df6a2235cc06722d4520522f0764f77c6d..932a769637efedb021585f61f93645a3fe14edd4 100644 (file)
@@ -169,8 +169,7 @@ int bochs_fbdev_init(struct bochs_device *bochs)
        drm_fb_helper_prepare(bochs->dev, &bochs->fb.helper,
                              &bochs_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper,
-                                1, 1);
+       ret = drm_fb_helper_init(bochs->dev, &bochs->fb.helper, 1);
        if (ret)
                return ret;
 
index 79a5cd10824530ba95e1b6219c837d106682aa5c..4cc679278182da01f526b77843576a17e6767eca 100644 (file)
@@ -289,7 +289,7 @@ int cirrus_fbdev_init(struct cirrus_device *cdev)
                              &cirrus_fb_helper_funcs);
 
        ret = drm_fb_helper_init(cdev->dev, &gfbdev->helper,
-                                cdev->num_crtc, CIRRUSFB_CONN_LIMIT);
+                                CIRRUSFB_CONN_LIMIT);
        if (ret)
                return ret;
 
index 0ef8b284a4b8efdec6292636f804089852b24901..596fabf18c3e6243133eb5f23a309d387c0bef80 100644 (file)
@@ -489,15 +489,14 @@ static const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
  * drm_fbdev_cma_init_with_funcs() - Allocate and initializes a drm_fbdev_cma struct
  * @dev: DRM device
  * @preferred_bpp: Preferred bits per pixel for the device
- * @num_crtc: Number of CRTCs
  * @max_conn_count: Maximum number of connectors
  * @funcs: fb helper functions, in particular a custom dirty() callback
  *
  * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
  */
 struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
-       unsigned int preferred_bpp, unsigned int num_crtc,
-       unsigned int max_conn_count, const struct drm_framebuffer_funcs *funcs)
+       unsigned int preferred_bpp, unsigned int max_conn_count,
+       const struct drm_framebuffer_funcs *funcs)
 {
        struct drm_fbdev_cma *fbdev_cma;
        struct drm_fb_helper *helper;
@@ -514,7 +513,7 @@ struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
 
        drm_fb_helper_prepare(dev, helper, &drm_fb_cma_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, helper, num_crtc, max_conn_count);
+       ret = drm_fb_helper_init(dev, helper, max_conn_count);
        if (ret < 0) {
                dev_err(dev->dev, "Failed to initialize drm fb helper.\n");
                goto err_free;
@@ -554,11 +553,11 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs);
  * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
  */
 struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
-       unsigned int preferred_bpp, unsigned int num_crtc,
-       unsigned int max_conn_count)
+       unsigned int preferred_bpp, unsigned int max_conn_count)
 {
-       return drm_fbdev_cma_init_with_funcs(dev, preferred_bpp, num_crtc,
-                               max_conn_count, &drm_fb_cma_funcs);
+       return drm_fbdev_cma_init_with_funcs(dev, preferred_bpp,
+                                            max_conn_count,
+                                            &drm_fb_cma_funcs);
 }
 EXPORT_SYMBOL_GPL(drm_fbdev_cma_init);
 
index c7fafa17575585de6ac5e4b92629692610ccc94d..a30c645035dee8f9a1a27495c1c87242f87f88a5 100644 (file)
@@ -712,7 +712,6 @@ EXPORT_SYMBOL(drm_fb_helper_prepare);
  * drm_fb_helper_init - initialize a drm_fb_helper structure
  * @dev: drm device
  * @fb_helper: driver-allocated fbdev helper structure to initialize
- * @crtc_count: maximum number of crtcs to support in this fbdev emulation
  * @max_conn_count: max connector count
  *
  * This allocates the structures for the fbdev helper with the given limits.
@@ -727,9 +726,10 @@ EXPORT_SYMBOL(drm_fb_helper_prepare);
  */
 int drm_fb_helper_init(struct drm_device *dev,
                       struct drm_fb_helper *fb_helper,
-                      int crtc_count, int max_conn_count)
+                      int max_conn_count)
 {
        struct drm_crtc *crtc;
+       struct drm_mode_config *config = &dev->mode_config;
        int i;
 
        if (!drm_fbdev_emulation)
@@ -738,11 +738,11 @@ int drm_fb_helper_init(struct drm_device *dev,
        if (!max_conn_count)
                return -EINVAL;
 
-       fb_helper->crtc_info = kcalloc(crtc_count, sizeof(struct drm_fb_helper_crtc), GFP_KERNEL);
+       fb_helper->crtc_info = kcalloc(config->num_crtc, sizeof(struct drm_fb_helper_crtc), GFP_KERNEL);
        if (!fb_helper->crtc_info)
                return -ENOMEM;
 
-       fb_helper->crtc_count = crtc_count;
+       fb_helper->crtc_count = config->num_crtc;
        fb_helper->connector_info = kcalloc(dev->mode_config.num_connector, sizeof(struct drm_fb_helper_connector *), GFP_KERNEL);
        if (!fb_helper->connector_info) {
                kfree(fb_helper->crtc_info);
@@ -751,7 +751,7 @@ int drm_fb_helper_init(struct drm_device *dev,
        fb_helper->connector_info_alloc_count = dev->mode_config.num_connector;
        fb_helper->connector_count = 0;
 
-       for (i = 0; i < crtc_count; i++) {
+       for (i = 0; i < fb_helper->crtc_count; i++) {
                fb_helper->crtc_info[i].mode_set.connectors =
                        kcalloc(max_conn_count,
                                sizeof(struct drm_connector *),
index a7884bea42eb84c5fcea45e5459686709e5d458e..bcdb2720b68e70caa59faf9b53a2930833e930c1 100644 (file)
@@ -208,7 +208,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
        struct exynos_drm_fbdev *fbdev;
        struct exynos_drm_private *private = dev->dev_private;
        struct drm_fb_helper *helper;
-       unsigned int num_crtc;
        int ret;
 
        if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
@@ -225,9 +224,7 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, helper, &exynos_drm_fb_helper_funcs);
 
-       num_crtc = dev->mode_config.num_crtc;
-
-       ret = drm_fb_helper_init(dev, helper, num_crtc, MAX_CONNECTOR);
+       ret = drm_fb_helper_init(dev, helper, MAX_CONNECTOR);
        if (ret < 0) {
                DRM_ERROR("failed to initialize drm fb helper.\n");
                goto err_init;
index 48705248f894da25aae649454960c416c9a8802f..04173235f4482adb2a9de172fd420f9e85285654 100644 (file)
@@ -94,7 +94,7 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
                        "Invalid legacyfb_depth.  Defaulting to 24bpp\n");
                legacyfb_depth = 24;
        }
-       fsl_dev->fbdev = drm_fbdev_cma_init(dev, legacyfb_depth, 1, 1);
+       fsl_dev->fbdev = drm_fbdev_cma_init(dev, legacyfb_depth, 1);
        if (IS_ERR(fsl_dev->fbdev)) {
                ret = PTR_ERR(fsl_dev->fbdev);
                fsl_dev->fbdev = NULL;
index fd1488bf5189f3adb8ce61c1c6554f405d2239df..da42d2e1d3976b46b267d0b6f00fc398402181c3 100644 (file)
@@ -564,7 +564,7 @@ int psb_fbdev_init(struct drm_device *dev)
        drm_fb_helper_prepare(dev, &fbdev->psb_fb_helper, &psb_fb_helper_funcs);
 
        ret = drm_fb_helper_init(dev, &fbdev->psb_fb_helper,
-                                dev_priv->ops->crtcs, INTELFB_CONN_LIMIT);
+                                INTELFB_CONN_LIMIT);
        if (ret)
                goto free;
 
index 16fe79053ee1ebf57112e0189d62e0b394a510da..d7a4d9095b334d19ac28a0066da7a5e93cd20a7c 100644 (file)
@@ -200,8 +200,7 @@ int hibmc_fbdev_init(struct hibmc_drm_private *priv)
                              &hibmc_fbdev_helper_funcs);
 
        /* Now just one crtc and one channel */
-       ret = drm_fb_helper_init(priv->dev,
-                                &hifbdev->helper, 1, 1);
+       ret = drm_fb_helper_init(priv->dev, &hifbdev->helper, 1);
        if (ret) {
                DRM_ERROR("failed to initialize fb helper: %d\n", ret);
                return ret;
index 7df0e8535e414e0ac072e3d33bf98f679239917e..7ec93aec7e880ec524a1b1bc0eec21721b8311b9 100644 (file)
@@ -59,8 +59,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
                drm_fbdev_cma_hotplug_event(priv->fbdev);
        } else {
                priv->fbdev = drm_fbdev_cma_init(dev, 32,
-                               dev->mode_config.num_crtc,
-                               dev->mode_config.num_connector);
+                                                dev->mode_config.num_connector);
                if (IS_ERR(priv->fbdev))
                        priv->fbdev = NULL;
        }
index e0d9e72cf3d1dfee344896c120a9937f4a8b5824..1b8ba2e77539577f5eb997f9e1eb315f1f7ae078 100644 (file)
@@ -713,8 +713,7 @@ int intel_fbdev_init(struct drm_device *dev)
        if (!intel_fbdev_init_bios(dev, ifbdev))
                ifbdev->preferred_bpp = 32;
 
-       ret = drm_fb_helper_init(dev, &ifbdev->helper,
-                                INTEL_INFO(dev_priv)->num_pipes, 4);
+       ret = drm_fb_helper_init(dev, &ifbdev->helper, 4);
        if (ret) {
                kfree(ifbdev);
                return ret;
index 33404295b447c981654109089c4073338b0b5c1a..5ae48836652ebd5a5bea77583c677f5583d9959f 100644 (file)
@@ -389,8 +389,7 @@ static int imx_drm_bind(struct device *dev)
                dev_warn(dev, "Invalid legacyfb_depth.  Defaulting to 16bpp\n");
                legacyfb_depth = 16;
        }
-       imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth,
-                               drm->mode_config.num_crtc, MAX_CRTC);
+       imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, MAX_CRTC);
        if (IS_ERR(imxdrm->fbhelper)) {
                ret = PTR_ERR(imxdrm->fbhelper);
                imxdrm->fbhelper = NULL;
index 380bde7fce1642aa54287103c203383b0970633b..6f2fd82ed483da291b7d3f4d6de8655f38a0281e 100644 (file)
@@ -279,7 +279,6 @@ static int meson_drv_probe(struct platform_device *pdev)
        drm->mode_config.funcs = &meson_mode_config_funcs;
 
        priv->fbdev = drm_fbdev_cma_init(drm, 32,
-                                        drm->mode_config.num_crtc,
                                         drm->mode_config.num_connector);
        if (IS_ERR(priv->fbdev)) {
                ret = PTR_ERR(priv->fbdev);
index 1a665e1671b8fe657b06fe350af672815ce7aa9d..a449bb91213aa8f3a7fa8b4db496eed42288d995 100644 (file)
@@ -286,7 +286,7 @@ int mgag200_fbdev_init(struct mga_device *mdev)
        drm_fb_helper_prepare(mdev->dev, &mfbdev->helper, &mga_fb_helper_funcs);
 
        ret = drm_fb_helper_init(mdev->dev, &mfbdev->helper,
-                                mdev->num_crtc, MGAG200FB_CONN_LIMIT);
+                                MGAG200FB_CONN_LIMIT);
        if (ret)
                goto err_fb_helper;
 
index f8a587eac6b86b495c540fcc973f05361ff585f1..6b1b375653f726f9217f201fc8e11d004de8f7b7 100644 (file)
@@ -201,8 +201,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, helper, &msm_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, helper,
-                       priv->num_crtcs, priv->num_connectors);
+       ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
        if (ret) {
                dev_err(dev->dev, "could not init fbdev: ret=%d\n", ret);
                goto fail;
index 955441f7150074a7700a0ffe49f50bd4859e66ae..cdfbe0284635decf262db79c0b048291cc87c026 100644 (file)
@@ -218,7 +218,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 
        drm_kms_helper_poll_init(drm);
 
-       mxsfb->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
+       mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
                                          drm->mode_config.num_connector);
        if (IS_ERR(mxsfb->fbdev)) {
                mxsfb->fbdev = NULL;
index 9de6abb65781d454288c7a847565ac2662f80a60..971c147a3984ada0593fc803750b6fbfbf470a6b 100644 (file)
@@ -507,8 +507,7 @@ nouveau_fbcon_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, &fbcon->helper, &nouveau_fbcon_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, &fbcon->helper,
-                                dev->mode_config.num_crtc, 4);
+       ret = drm_fb_helper_init(dev, &fbcon->helper, 4);
        if (ret)
                goto free;
 
index 2a839956dae620df7ecb1c4d223fa1429641680c..942c4d4830080c15e8a81f0d6b1133da62b219b5 100644 (file)
@@ -263,8 +263,7 @@ struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, helper, &omap_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, helper,
-                       priv->num_crtcs, priv->num_connectors);
+       ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
        if (ret) {
                dev_err(dev->dev, "could not init fbdev: ret=%d\n", ret);
                goto fail;
index 53edfa498af5de37c05589a00ebee091a9292ae9..d479b7a7abe41aa9e1d0b7f4f2d4f2963bc6e73a 100644 (file)
@@ -399,7 +399,6 @@ int qxl_fbdev_init(struct qxl_device *qdev)
                              &qxl_fb_helper_funcs);
 
        ret = drm_fb_helper_init(&qdev->ddev, &qfbdev->helper,
-                                qxl_num_crtc,
                                 QXLFB_CONN_LIMIT);
        if (ret)
                goto free;
index 6c10a83f336207438597c7c3015d64f4351b8132..2be4fe9c7217f2730dca89e8be9cb41b0e1b7c08 100644 (file)
@@ -366,7 +366,6 @@ int radeon_fbdev_init(struct radeon_device *rdev)
                              &radeon_fb_helper_funcs);
 
        ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
-                                rdev->num_crtc,
                                 RADEONFB_CONN_LIMIT);
        if (ret)
                goto free;
index b5d3f16cfa12afafeff2c5fcf30aa87f2225366a..ff61f6032f2c46d28f730d826b86bf2c84bca847 100644 (file)
@@ -662,7 +662,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
        drm_kms_helper_poll_init(dev);
 
        if (dev->mode_config.num_connector) {
-               fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc,
+               fbdev = drm_fbdev_cma_init(dev, 32,
                                           dev->mode_config.num_connector);
                if (IS_ERR(fbdev))
                        return PTR_ERR(fbdev);
index 52d1fdf9f9da9913089c8caa0ff945c93ad63335..70ad50dd594d127d6cab5180e048afc6191e6848 100644 (file)
@@ -129,19 +129,16 @@ int rockchip_drm_fbdev_init(struct drm_device *dev)
 {
        struct rockchip_drm_private *private = dev->dev_private;
        struct drm_fb_helper *helper;
-       unsigned int num_crtc;
        int ret;
 
        if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
                return -EINVAL;
 
-       num_crtc = dev->mode_config.num_crtc;
-
        helper = &private->fbdev_helper;
 
        drm_fb_helper_prepare(dev, helper, &rockchip_drm_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, helper, num_crtc, ROCKCHIP_MAX_CONNECTOR);
+       ret = drm_fb_helper_init(dev, helper, ROCKCHIP_MAX_CONNECTOR);
        if (ret < 0) {
                dev_err(dev->dev, "Failed to initialize drm fb helper - %d.\n",
                        ret);
index acc056644cd01f56f7ac9b9fefeebb10849b9f60..788feed208d7c1b1c6b03ea3760a06e4b04c3513 100644 (file)
@@ -360,7 +360,7 @@ static int sti_bind(struct device *dev)
 
        private = ddev->dev_private;
        if (ddev->mode_config.num_connector) {
-               fbdev = drm_fbdev_cma_init(ddev, 32, ddev->mode_config.num_crtc,
+               fbdev = drm_fbdev_cma_init(ddev, 32,
                                           ddev->mode_config.num_connector);
                if (IS_ERR(fbdev)) {
                        DRM_DEBUG_DRIVER("Warning: fails to create fbdev\n");
index 8b6ce619ad814497100a2e9c1ccb6098a707e881..2c3beff8b53e2d89de3a6d4e705ae3b9b047ae2f 100644 (file)
@@ -40,9 +40,7 @@ struct drm_fbdev_cma *sun4i_framebuffer_init(struct drm_device *drm)
 
        drm->mode_config.funcs = &sun4i_de_mode_config_funcs;
 
-       return drm_fbdev_cma_init(drm, 32,
-                                 drm->mode_config.num_crtc,
-                                 drm->mode_config.num_connector);
+       return drm_fbdev_cma_init(drm, 32, drm->mode_config.num_connector);
 }
 
 void sun4i_framebuffer_free(struct drm_device *drm)
index f896e2ff7d471c545f1ee305457bdbd7a12ac21d..f142f6a4db252a91402305829c91a9b10754a69b 100644 (file)
@@ -309,7 +309,7 @@ static int tegra_fbdev_init(struct tegra_fbdev *fbdev,
        struct drm_device *drm = fbdev->base.dev;
        int err;
 
-       err = drm_fb_helper_init(drm, &fbdev->base, num_crtc, max_connectors);
+       err = drm_fb_helper_init(drm, &fbdev->base, max_connectors);
        if (err < 0) {
                dev_err(drm->dev, "failed to initialize DRM FB helper: %d\n",
                        err);
index 919294a735febf0731dda1004032b09ef92b5d17..372d86fbb093865816845331aea01651a6e6f1c0 100644 (file)
@@ -403,8 +403,7 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
        drm_mode_config_reset(ddev);
 
        priv->fbdev = drm_fbdev_cma_init(ddev, bpp,
-                       ddev->mode_config.num_crtc,
-                       ddev->mode_config.num_connector);
+                                        ddev->mode_config.num_connector);
        if (IS_ERR(priv->fbdev)) {
                ret = PTR_ERR(priv->fbdev);
                goto init_failed;
index b8dc06d68777973c3a7ec11a57af5ca86cf28567..8e8d60e9a1a26ba512932d865fac63cc3c476eb3 100644 (file)
@@ -441,8 +441,7 @@ int udl_fbdev_init(struct drm_device *dev)
 
        drm_fb_helper_prepare(dev, &ufbdev->helper, &udl_fb_helper_funcs);
 
-       ret = drm_fb_helper_init(dev, &ufbdev->helper,
-                                1, 1);
+       ret = drm_fb_helper_init(dev, &ufbdev->helper, 1);
        if (ret)
                goto free;
 
index be8dd8262f2794866e12655f6b4fda70e6b8b8cd..ad7925a9e0ea4c331bdad8474388e8e6058af1c8 100644 (file)
@@ -231,7 +231,6 @@ int vc4_kms_load(struct drm_device *dev)
        drm_mode_config_reset(dev);
 
        vc4->fbdev = drm_fbdev_cma_init(dev, 32,
-                                       dev->mode_config.num_crtc,
                                        dev->mode_config.num_connector);
        if (IS_ERR(vc4->fbdev))
                vc4->fbdev = NULL;
index 24f99fc9d8a47a2fae3c29cef5de1f5e9861c674..163a67db8cf1e27f94af0457a9dc30f641435506 100644 (file)
@@ -387,7 +387,6 @@ int virtio_gpu_fbdev_init(struct virtio_gpu_device *vgdev)
        drm_fb_helper_prepare(vgdev->ddev, &vgfbdev->helper,
                              &virtio_gpu_fb_helper_funcs);
        ret = drm_fb_helper_init(vgdev->ddev, &vgfbdev->helper,
-                                vgdev->num_scanouts,
                                 VIRTIO_GPUFB_CONN_LIMIT);
        if (ret) {
                kfree(vgfbdev);
index 13081fed902d9bd07b99c402a212ccb0e5e846fc..5c6944a1e72c3fa31340d189abb4be6aac168cb5 100644 (file)
@@ -141,7 +141,7 @@ static int zx_drm_bind(struct device *dev)
        drm_mode_config_reset(drm);
        drm_kms_helper_poll_init(drm);
 
-       priv->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc,
+       priv->fbdev = drm_fbdev_cma_init(drm, 32,
                                         drm->mode_config.num_connector);
        if (IS_ERR(priv->fbdev)) {
                ret = PTR_ERR(priv->fbdev);
index 8dd6e5585e513eb898145adf173da166b2fd89bc..a5ecc0a582602cdf551cece988ee7348d75bdf9d 100644 (file)
@@ -16,11 +16,10 @@ struct drm_plane;
 struct drm_plane_state;
 
 struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev,
-       unsigned int preferred_bpp, unsigned int num_crtc,
-       unsigned int max_conn_count, const struct drm_framebuffer_funcs *funcs);
+       unsigned int preferred_bpp, unsigned int max_conn_count,
+       const struct drm_framebuffer_funcs *funcs);
 struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
-       unsigned int preferred_bpp, unsigned int num_crtc,
-       unsigned int max_conn_count);
+       unsigned int preferred_bpp, unsigned int max_conn_count);
 void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
 
 void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
index e62e1cf22678474644c6aa94ab585135bb0f3d54..278820ee17ad24ceacdecfbe36eb61389fb83ba2 100644 (file)
@@ -236,8 +236,7 @@ struct drm_fb_helper {
 void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
                           const struct drm_fb_helper_funcs *funcs);
 int drm_fb_helper_init(struct drm_device *dev,
-                      struct drm_fb_helper *helper, int crtc_count,
-                      int max_conn);
+                      struct drm_fb_helper *helper, int max_conn);
 void drm_fb_helper_fini(struct drm_fb_helper *helper);
 int drm_fb_helper_blank(int blank, struct fb_info *info);
 int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,