UPSTREAM: drm: Pass 'name' to drm_crtc_init_with_planes()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 9 Dec 2015 14:19:31 +0000 (16:19 +0200)
committerMark Yao <mark.yao@rock-chips.com>
Thu, 17 Mar 2016 01:42:01 +0000 (09:42 +0800)
Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.

I didn't convert drm_crtc_init() since passing the varargs through
would mean either cpp macros or va_list, and I figured we don't
care about these legacy functions enough to warrant the extra pain.

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               )
{ ... }

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               );

@@
expression E1, E2, E3, E4, E5;
@@
 drm_crtc_init_with_planes(E1, E2, E3, E4, E5
+                          ,NULL
                           )

v2: Split crtc and plane changes apart
    Pass NULL for no-name instead of ""
    Leave drm_crtc_init() alone
v3: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
(cherry picked from commit f98828769c8838f526703ef180b3088a714af2f9)

Change-Id: I8eb2a67b3a01bd0cb49e552f05a5ee5c6ac99d40
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
18 files changed:
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_plane_helper.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/imx/imx-drm-core.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
drivers/gpu/drm/omapdrm/omap_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/sti/sti_crtc.c
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/virtio/virtgpu_display.c
include/drm/drm_crtc.h

index cebcab5606268f76aa1f9161315ef17ba82981d7..c3f3a7031bb1b827df0cf082b87eb0fc38745b20 100644 (file)
@@ -1223,7 +1223,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
        }
 
        ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL,
-                                       &armada_crtc_funcs);
+                                       &armada_crtc_funcs, NULL);
        if (ret)
                goto err_crtc_init;
 
index 9f6e234e70296a9c35f4877cac98d5ff73b2c73c..468a14f266a7bb122dfea97fec20c19a7245317c 100644 (file)
@@ -344,7 +344,7 @@ int atmel_hlcdc_crtc_create(struct drm_device *dev)
        ret = drm_crtc_init_with_planes(dev, &crtc->base,
                                &planes->primary->base,
                                planes->cursor ? &planes->cursor->base : NULL,
-                               &atmel_hlcdc_crtc_funcs);
+                               &atmel_hlcdc_crtc_funcs, NULL);
        if (ret < 0)
                goto fail;
 
index 24c5434abd1c44e1040676220b84002fdce74ee9..9dda242a6c1e2b627cd6e54f24b6cd4fb5187e52 100644 (file)
@@ -657,6 +657,7 @@ DEFINE_WW_CLASS(crtc_ww_class);
  * @primary: Primary plane for CRTC
  * @cursor: Cursor plane for CRTC
  * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
  *
  * Inits a new object created as base part of a driver crtc object.
  *
@@ -666,7 +667,8 @@ DEFINE_WW_CLASS(crtc_ww_class);
 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
                              struct drm_plane *primary,
                              struct drm_plane *cursor,
-                             const struct drm_crtc_funcs *funcs)
+                             const struct drm_crtc_funcs *funcs,
+                             const char *name, ...)
 {
        struct drm_mode_config *config = &dev->mode_config;
        int ret;
index d384ebcf0aaf52a63125c9599553fc24e6a7f87b..958c7b303423f45c523d190df1625587b08f556a 100644 (file)
@@ -394,7 +394,8 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
        struct drm_plane *primary;
 
        primary = create_primary_plane(dev);
-       return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs);
+       return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs,
+                                        NULL);
 }
 EXPORT_SYMBOL(drm_crtc_init);
 
index e69357172ffb56d2e5f5e86ff551b599196079ba..d06119b8b92367a9176c67066f19a85fe2dec3df 100644 (file)
@@ -153,7 +153,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
        private->crtc[pipe] = crtc;
 
        ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL,
-                                       &exynos_crtc_funcs);
+                                       &exynos_crtc_funcs, NULL);
        if (ret < 0)
                goto err_crtc;
 
index 82a3d311e164f53f4431f2b659a890610f099b90..d8ab8f0af10cbe484c83bbaec9fe23b31fde5b8c 100644 (file)
@@ -175,7 +175,7 @@ int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev)
 
        primary = fsl_dcu_drm_primary_create_plane(fsl_dev->drm);
        ret = drm_crtc_init_with_planes(fsl_dev->drm, crtc, primary, NULL,
-                                       &fsl_dcu_drm_crtc_funcs);
+                                       &fsl_dcu_drm_crtc_funcs, NULL);
        if (ret < 0)
                return ret;
 
index 32cf973469785cb916eb3c2bdd125a741efb5e4c..a7c179f20b630f02539d20722c3ea7c1900a9e26 100644 (file)
@@ -13925,7 +13925,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
                goto fail;
 
        ret = drm_crtc_init_with_planes(dev, &intel_crtc->base, primary,
-                                       cursor, &intel_crtc_funcs);
+                                       cursor, &intel_crtc_funcs, NULL);
        if (ret)
                goto fail;
 
index 7b990b4e96d234bcdc965572383092e3d9b303a0..e9eb8bb1d4800992bc01d3a8b6c1a030b539fd01 100644 (file)
@@ -379,7 +379,7 @@ int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
                        imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs);
 
        drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
-                       imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs);
+                       imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs, NULL);
 
        return 0;
 
index 6ac9aa165768da569e9ac1ea3bd5f36331c83fee..28df397c3b040a9d6575ad541ef36adb1703468c 100644 (file)
@@ -678,7 +678,8 @@ struct drm_crtc *mdp4_crtc_init(struct drm_device *dev,
        drm_flip_work_init(&mdp4_crtc->unref_cursor_work,
                        "unref cursor", unref_cursor_worker);
 
-       drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp4_crtc_funcs);
+       drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp4_crtc_funcs,
+                                 NULL);
        drm_crtc_helper_add(crtc, &mdp4_crtc_helper_funcs);
        plane->crtc = crtc;
 
index 7f9f4ac88029c4cf6f7b46ae410478f2a5697e75..20cee5ce4071e4a0a4d2d101b3d70965f8cd6b13 100644 (file)
@@ -797,7 +797,8 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
        snprintf(mdp5_crtc->name, sizeof(mdp5_crtc->name), "%s:%d",
                        pipe2name(mdp5_plane_pipe(plane)), id);
 
-       drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp5_crtc_funcs);
+       drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp5_crtc_funcs,
+                                 NULL);
 
        drm_flip_work_init(&mdp5_crtc->unref_cursor_work,
                        "unref cursor", unref_cursor_worker);
index ad09590e8a4688d22756217542b6716157d5e37d..2ed0754ed19edc586c2a70c1bdc01aecb8593aa1 100644 (file)
@@ -524,7 +524,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
        omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
 
        ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
-                                       &omap_crtc_funcs);
+                                       &omap_crtc_funcs, NULL);
        if (ret < 0) {
                kfree(omap_crtc);
                return NULL;
index 48cb19949ca3f01eeb365b3a1dadc30509888cfd..88a4b706be169ff81c279137ac3d2df62df8fb97 100644 (file)
@@ -613,7 +613,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
 
        ret = drm_crtc_init_with_planes(rcdu->ddev, crtc,
                                        &rgrp->planes[index % 2].plane,
-                                       NULL, &crtc_funcs);
+                                       NULL, &crtc_funcs, NULL);
        if (ret < 0)
                return ret;
 
index 03c47eeadc812ba649e68ad97270d5c512efea86..8e89e80ec9064305c8cdd360574484c231761d6b 100644 (file)
@@ -1492,7 +1492,7 @@ static int vop_create_crtc(struct vop *vop)
        }
 
        ret = drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor,
-                                       &vop_crtc_funcs);
+                                       &vop_crtc_funcs, NULL);
        if (ret)
                return ret;
 
index 3ae09dcd4fd86c65fad95b13fc60aa596a1271e4..de11c7cfb02f4b1d8d65d52cca8676526e80a68b 100644 (file)
@@ -367,7 +367,7 @@ int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
        int res;
 
        res = drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor,
-                                       &sti_crtc_funcs);
+                                       &sti_crtc_funcs, NULL);
        if (res) {
                DRM_ERROR("Can't initialze CRTC\n");
                return -EINVAL;
index e9f24a85a1038701cc819f38e9b0318260e6679d..be894103fa49957c04291c4677efab7955c11c11 100644 (file)
@@ -1732,7 +1732,7 @@ static int tegra_dc_init(struct host1x_client *client)
        }
 
        err = drm_crtc_init_with_planes(drm, &dc->base, primary, cursor,
-                                       &tegra_crtc_funcs);
+                                       &tegra_crtc_funcs, NULL);
        if (err < 0)
                goto cleanup;
 
index 265064c62d493b54023947d49597852a16328a5f..2168a99d59aaa46d1a13f10d9a6ac418a639c986 100644 (file)
@@ -606,7 +606,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
        }
 
        drm_crtc_init_with_planes(drm, crtc, primary_plane, cursor_plane,
-                                 &vc4_crtc_funcs);
+                                 &vc4_crtc_funcs, NULL);
        drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs);
        primary_plane->crtc = crtc;
        cursor_plane->crtc = crtc;
index 578fe0a9324cd9bd710e3d9ef2d393e8311d3cb2..2542e2d489a64c16fa32f866063c636701fc6422 100644 (file)
@@ -443,7 +443,7 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
        if (IS_ERR(plane))
                return PTR_ERR(plane);
        drm_crtc_init_with_planes(dev, crtc, plane, NULL,
-                                 &virtio_gpu_crtc_funcs);
+                                 &virtio_gpu_crtc_funcs, NULL);
        drm_mode_crtc_set_gamma_size(crtc, 256);
        drm_crtc_helper_add(crtc, &virtio_gpu_crtc_helper_funcs);
        plane->crtc = crtc;
index 3f0c6909dda17f9ec14959353a440da171a87ca6..167f57928b9a735187ff6d6a4d88b0632138ce3a 100644 (file)
@@ -1183,11 +1183,13 @@ struct drm_prop_enum_list {
        char *name;
 };
 
-extern int drm_crtc_init_with_planes(struct drm_device *dev,
-                                    struct drm_crtc *crtc,
-                                    struct drm_plane *primary,
-                                    struct drm_plane *cursor,
-                                    const struct drm_crtc_funcs *funcs);
+extern __printf(6, 7)
+int drm_crtc_init_with_planes(struct drm_device *dev,
+                             struct drm_crtc *crtc,
+                             struct drm_plane *primary,
+                             struct drm_plane *cursor,
+                             const struct drm_crtc_funcs *funcs,
+                             const char *name, ...);
 extern void drm_crtc_cleanup(struct drm_crtc *crtc);
 extern unsigned int drm_crtc_index(struct drm_crtc *crtc);