]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: Remove drm_fb_helper add, add all and remove connector calls
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Thu, 5 Mar 2020 12:04:32 +0000 (17:34 +0530)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 6 Mar 2020 13:19:58 +0000 (14:19 +0100)
drm_fb_helper_{add,remove}_one_connector() and
drm_fb_helper_single_add_all_connectors() are dummy functions now
and serve no purpose. Hence remove their calls.

This is the preparatory step for removing the
drm_fb_helper_{add,remove}_one_connector() functions from
drm_fb_helper.h

This removal is done using below sementic patch and unused variable
compilation warnings are fixed manually.

@@
@@

- drm_fb_helper_single_add_all_connectors(...);

@@
expression e1;
statement S;
@@
- e1 = drm_fb_helper_single_add_all_connectors(...);
- S

@@
@@

- drm_fb_helper_add_one_connector(...);

@@
@@

- drm_fb_helper_remove_one_connector(...);

Changes since v1:
* Squashed warning fixes into the patch that introduced the
  warnings (into 5/7) (Laurent, Emil, Lyude)

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305120434.111091-6-pankaj.laxminarayan.bharadiya@intel.com
14 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
drivers/gpu/drm/armada/armada_fbdev.c
drivers/gpu/drm/bridge/tc358764.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/i915/display/intel_fbdev.c
drivers/gpu/drm/msm/msm_fbdev.c
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/omapdrm/omap_fbdev.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
drivers/gpu/drm/tegra/fb.c

index 579d614c7b70b62d68ca51c5034ab1c1b281dc08..9ae7b61f696a244c7182b06843330728ec455e47 100644 (file)
@@ -342,8 +342,6 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
                return ret;
        }
 
-       drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
-
        /* disable all the possible outputs/crtcs before entering KMS mode */
        if (!amdgpu_device_has_dc_support(adev))
                drm_helper_disable_unused_functions(adev->ddev);
index 6254353c00ae3d7fdfdf9ede92a26d2fbfe02316..f2dc371bd8e5743c45ad6c36c3daaeef15e7537b 100644 (file)
@@ -135,12 +135,6 @@ int armada_fbdev_init(struct drm_device *dev)
                goto err_fb_helper;
        }
 
-       ret = drm_fb_helper_single_add_all_connectors(fbh);
-       if (ret) {
-               DRM_ERROR("failed to add fb connectors\n");
-               goto err_fb_setup;
-       }
-
        ret = drm_fb_helper_initial_config(fbh, 32);
        if (ret) {
                DRM_ERROR("failed to set initial config\n");
index 283e4a8dd923e60b12a8245b6385fe2dc8b5d9d2..5ac1430fab04991c27d13f3e7129baee8ef33fb5 100644 (file)
@@ -375,7 +375,6 @@ static int tc358764_attach(struct drm_bridge *bridge,
        drm_connector_attach_encoder(&ctx->connector, bridge->encoder);
        drm_panel_attach(ctx->panel, &ctx->connector);
        ctx->connector.funcs->reset(&ctx->connector);
-       drm_fb_helper_add_one_connector(drm->fb_helper, &ctx->connector);
        drm_connector_register(&ctx->connector);
 
        return 0;
@@ -384,10 +383,8 @@ static int tc358764_attach(struct drm_bridge *bridge,
 static void tc358764_detach(struct drm_bridge *bridge)
 {
        struct tc358764 *ctx = bridge_to_tc358764(bridge);
-       struct drm_device *drm = bridge->dev;
 
        drm_connector_unregister(&ctx->connector);
-       drm_fb_helper_remove_one_connector(drm->fb_helper, &ctx->connector);
        drm_panel_detach(ctx->panel);
        ctx->panel = NULL;
        drm_connector_put(&ctx->connector);
index 669d3857502a9c6ffc8c98863c7940502c9a0795..38e43d957ae010f1b722d93936f48c6fea164f43 100644 (file)
@@ -1514,7 +1514,6 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder)
                return 0;
 
        connector->funcs->reset(connector);
-       drm_fb_helper_add_one_connector(drm->fb_helper, connector);
        drm_connector_register(connector);
        return 0;
 }
index 5afecb6a30adde3cef6a347c4b17b9f66844ce61..e6ceaf36fb044ab2081b871b83f5b7528cc348a2 100644 (file)
@@ -207,14 +207,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
                goto err_init;
        }
 
-       ret = drm_fb_helper_single_add_all_connectors(helper);
-       if (ret < 0) {
-               DRM_DEV_ERROR(dev->dev,
-                             "failed to register drm_fb_helper_connector.\n");
-               goto err_setup;
-
-       }
-
        ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP);
        if (ret < 0) {
                DRM_DEV_ERROR(dev->dev,
index fe892e1243db5740de077b759d2ae0b7ca1cd791..1d8f67e4795a685f2d720074c0c126e6a8492833 100644 (file)
@@ -517,10 +517,6 @@ int psb_fbdev_init(struct drm_device *dev)
        if (ret)
                goto free;
 
-       ret = drm_fb_helper_single_add_all_connectors(fb_helper);
-       if (ret)
-               goto fini;
-
        /* disable all the possible outputs/crtcs before entering KMS mode */
        drm_helper_disable_unused_functions(dev);
 
index 66e94e6b9764e74e589fe8e31600ad72fe4dda2f..876264fc656018d8970bc674a94a013a9ca4ee7f 100644 (file)
@@ -462,8 +462,6 @@ int intel_fbdev_init(struct drm_device *dev)
        dev_priv->fbdev = ifbdev;
        INIT_WORK(&dev_priv->fbdev_suspend_work, intel_fbdev_suspend_worker);
 
-       drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
-
        return 0;
 }
 
index b4f44146d9de240b714e92a7da7ba90ea0729b81..47235f8c5922e3110f5f1dc953423ed38a6be3bb 100644 (file)
@@ -166,10 +166,6 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
                goto fail;
        }
 
-       ret = drm_fb_helper_single_add_all_connectors(helper);
-       if (ret)
-               goto fini;
-
        /* the fw fb could be anywhere in memory */
        drm_fb_helper_remove_conflicting_framebuffers(NULL, "msm", false);
 
index a3dc2ba19fb2b92704a280014544defa02e4a8e8..4e164ad8003fe23aa1b321210e3cf9b97be8b0b5 100644 (file)
@@ -1260,23 +1260,16 @@ static void
 nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr,
                            struct drm_connector *connector)
 {
-       struct nouveau_drm *drm = nouveau_drm(connector->dev);
        struct nv50_mstc *mstc = nv50_mstc(connector);
 
        drm_connector_unregister(&mstc->connector);
 
-       drm_fb_helper_remove_one_connector(&drm->fbcon->helper, &mstc->connector);
-
        drm_connector_put(&mstc->connector);
 }
 
 static void
 nv50_mstm_register_connector(struct drm_connector *connector)
 {
-       struct nouveau_drm *drm = nouveau_drm(connector->dev);
-
-       drm_fb_helper_add_one_connector(&drm->fbcon->helper, connector);
-
        drm_connector_register(connector);
 }
 
index 21fc7c63e2f7024a31ed10dd01359f2ca1d74447..24d543a01f435ae2bfa9861c78edc7339a2704f5 100644 (file)
@@ -562,10 +562,6 @@ nouveau_fbcon_init(struct drm_device *dev)
        if (ret)
                goto free;
 
-       ret = drm_fb_helper_single_add_all_connectors(&fbcon->helper);
-       if (ret)
-               goto fini;
-
        if (preferred_bpp != 8 && preferred_bpp != 16 && preferred_bpp != 32) {
                if (drm->client.device.info.ram_size <= 32 * 1024 * 1024)
                        preferred_bpp = 8;
index eba57ac31cc6e1a10b888e15a2c06d99dff0c386..09a84919ef738846204a038033d7e00ff2997a52 100644 (file)
@@ -246,10 +246,6 @@ void omap_fbdev_init(struct drm_device *dev)
        if (ret)
                goto fail;
 
-       ret = drm_fb_helper_single_add_all_connectors(helper);
-       if (ret)
-               goto fini;
-
        ret = drm_fb_helper_initial_config(helper, 32);
        if (ret)
                goto fini;
index 1c02cd771d526f4423dcc0cb820ed9cfda9d7615..cf3156a65fc1c1b06558cceba9fe8bc022f14149 100644 (file)
@@ -358,10 +358,6 @@ int radeon_fbdev_init(struct radeon_device *rdev)
        if (ret)
                goto free;
 
-       ret = drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
-       if (ret)
-               goto fini;
-
        /* disable all the possible outputs/crtcs before entering KMS mode */
        drm_helper_disable_unused_functions(rdev->ddev);
 
index 6ad4cce17089e6d8b0c7af6168c8420f520d8065..2fdc455c4ad7fad641fb4f36e645163855c8dce2 100644 (file)
@@ -132,13 +132,6 @@ int rockchip_drm_fbdev_init(struct drm_device *dev)
                return ret;
        }
 
-       ret = drm_fb_helper_single_add_all_connectors(helper);
-       if (ret < 0) {
-               DRM_DEV_ERROR(dev->dev,
-                             "Failed to add connectors - %d.\n", ret);
-               goto err_drm_fb_helper_fini;
-       }
-
        ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP);
        if (ret < 0) {
                DRM_DEV_ERROR(dev->dev,
index feefe62be8dd4a358250a1660fdccb8c8414fae8..b8a328f538626e7a2b833a9f4aac60c70ee6077d 100644 (file)
@@ -321,12 +321,6 @@ static int tegra_fbdev_init(struct tegra_fbdev *fbdev,
                return err;
        }
 
-       err = drm_fb_helper_single_add_all_connectors(&fbdev->base);
-       if (err < 0) {
-               dev_err(drm->dev, "failed to add connectors: %d\n", err);
-               goto fini;
-       }
-
        err = drm_fb_helper_initial_config(&fbdev->base, preferred_bpp);
        if (err < 0) {
                dev_err(drm->dev, "failed to set initial configuration: %d\n",