drm/omap: Pass pipe pointer to omap_crtc_init()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 6 Mar 2018 21:37:25 +0000 (23:37 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:28 +0000 (16:13 +0300)
Replace the dss display device pointer by a pipe pointer that will allow
the omap_crtc_init() function to access both the display and the DSS
output. As a result we can remove the omapdss_device_get_dispc_channel()
function that is now unneeded.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/base.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_crtc.c
drivers/gpu/drm/omapdrm/omap_crtc.h
drivers/gpu/drm/omapdrm/omap_drv.c

index 89472715ee8f04a8ec8ad09eddcdf321d4a5203e..2051bab30484e5b8d58731d0f64a95848bcda7cc 100644 (file)
@@ -246,15 +246,6 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
 }
 EXPORT_SYMBOL_GPL(omapdss_device_disconnect);
 
-enum omap_channel omapdss_device_get_dispc_channel(struct omap_dss_device *dssdev)
-{
-       while (dssdev->src)
-               dssdev = dssdev->src;
-
-       return dssdev->dispc_channel;
-}
-EXPORT_SYMBOL(omapdss_device_get_dispc_channel);
-
 /* -----------------------------------------------------------------------------
  * Components Handling
  */
index 8f9538e17ea40ecb4b4ddbc375d5cd43b18e56db..a732a4a0dc363cfd45655f66ec5ef9910836ebb1 100644 (file)
@@ -513,7 +513,6 @@ int omapdss_device_connect(struct dss_device *dss,
                           struct omap_dss_device *dst);
 void omapdss_device_disconnect(struct omap_dss_device *src,
                               struct omap_dss_device *dst);
-enum omap_channel omapdss_device_get_dispc_channel(struct omap_dss_device *dssdev);
 
 int omap_dss_get_num_overlay_managers(void);
 
index f5bf553a862ff062e66c5c6e911a61b330c7f22b..f5bdb8de98f4474c038bd458db33f977221e2636 100644 (file)
@@ -693,7 +693,8 @@ void omap_crtc_pre_uninit(struct omap_drm_private *priv)
 
 /* initialize crtc */
 struct drm_crtc *omap_crtc_init(struct drm_device *dev,
-               struct drm_plane *plane, struct omap_dss_device *dssdev)
+                               struct omap_drm_pipeline *pipe,
+                               struct drm_plane *plane)
 {
        struct omap_drm_private *priv = dev->dev_private;
        struct drm_crtc *crtc = NULL;
@@ -701,7 +702,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
        enum omap_channel channel;
        int ret;
 
-       channel = omapdss_device_get_dispc_channel(dssdev);
+       channel = pipe->output->dispc_channel;
 
        DBG("%s", channel_names[channel]);
 
@@ -724,7 +725,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
                                        &omap_crtc_funcs, NULL);
        if (ret < 0) {
                dev_err(dev->dev, "%s(): could not init crtc for: %s\n",
-                       __func__, dssdev->name);
+                       __func__, pipe->display->name);
                kfree(omap_crtc);
                return ERR_PTR(ret);
        }
index 1c65307038554416c6a2b08ad0ad6fa8c1696865..d9de437ba9ddb2d747550913e1c62893c20d764a 100644 (file)
@@ -27,6 +27,7 @@ enum omap_channel;
 struct drm_crtc;
 struct drm_device;
 struct drm_plane;
+struct omap_drm_pipeline;
 struct omap_dss_device;
 struct videomode;
 
@@ -35,7 +36,8 @@ enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
 void omap_crtc_pre_init(struct omap_drm_private *priv);
 void omap_crtc_pre_uninit(struct omap_drm_private *priv);
 struct drm_crtc *omap_crtc_init(struct drm_device *dev,
-               struct drm_plane *plane, struct omap_dss_device *dssdev);
+                               struct omap_drm_pipeline *pipe,
+                               struct drm_plane *plane);
 int omap_crtc_wait_pending(struct drm_crtc *crtc);
 void omap_crtc_error_irq(struct drm_crtc *crtc, u32 irqstatus);
 void omap_crtc_vblank_irq(struct drm_crtc *crtc);
index 0052f151bf7a9cbae7897ab2fe264a0f86561c38..bb9ee2c93eca00e8ef881ac5a787de8d8f298973 100644 (file)
@@ -308,7 +308,7 @@ static int omap_modeset_init(struct drm_device *dev)
                if (!connector)
                        return -ENOMEM;
 
-               crtc = omap_crtc_init(dev, priv->planes[i], display);
+               crtc = omap_crtc_init(dev, pipe, priv->planes[i]);
                if (IS_ERR(crtc))
                        return PTR_ERR(crtc);