]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/omap: dss: Modify omapdss_find_output_from_display() to return channel
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 2 Mar 2018 01:11:49 +0000 (03:11 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:26 +0000 (16:13 +0300)
The omapdss_find_output_from_display() function is only used to retrieve
the dispc channel corresponding to the display. Return the dispc channel
directly, and rename the function to omapdss_device_get_dispc_channel()
to match its new purpose.

The dssdev->id check is removed as the dssdev is guaranteed to be an
output and have a non-zero id, as proved by the lack of crash despite
the caller never checking the returned pointer before dereferencing it.

As the function is not specific to outputs anymore, move it from
output.c to base.c.

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/dss/output.c
drivers/gpu/drm/omapdrm/omap_crtc.c

index 991c424960c7d9666b5ba9fb2e4ff5a50014cf1b..2728589724961f2d8b8124d6c5d7d524c1f32d18 100644 (file)
@@ -236,6 +236,15 @@ 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 4df405ae20db11b60778fa5d399bab83dfc9d1d1..121bc953ba3161168ccd91a95a28ac374020f965 100644 (file)
@@ -504,6 +504,7 @@ 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);
 
@@ -513,8 +514,6 @@ int omapdss_output_set_device(struct omap_dss_device *out,
                struct omap_dss_device *dssdev);
 int omapdss_output_unset_device(struct omap_dss_device *out);
 
-struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
-
 typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
 int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
 int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
index a5df6eed4aefa7f5df8c8295382ea099df95cffa..191b2e801257e0af23dc051aaf36ac20e6f56ee0 100644 (file)
@@ -88,18 +88,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out)
 }
 EXPORT_SYMBOL(omapdss_output_unset_device);
 
-struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
-{
-       while (dssdev->src)
-               dssdev = dssdev->src;
-
-       if (dssdev->id != 0)
-               return omapdss_device_get(dssdev);
-
-       return NULL;
-}
-EXPORT_SYMBOL(omapdss_find_output_from_display);
-
 int dss_install_mgr_ops(struct dss_device *dss,
                        const struct dss_mgr_ops *mgr_ops,
                        struct omap_drm_private *priv)
index 4ddc4ed18b4717852f980529a35223382c4057fa..c5f1915aef674ad8488b365d456a8ac04d065fa6 100644 (file)
@@ -699,12 +699,9 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
        struct drm_crtc *crtc = NULL;
        struct omap_crtc *omap_crtc;
        enum omap_channel channel;
-       struct omap_dss_device *out;
        int ret;
 
-       out = omapdss_find_output_from_display(dssdev);
-       channel = out->dispc_channel;
-       omapdss_device_put(out);
+       channel = omapdss_device_get_dispc_channel(dssdev);
 
        DBG("%s", channel_names[channel]);