drm/omap: dss: Add function to retrieve display for an output
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 5 Mar 2018 12:28:06 +0000 (14:28 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:27 +0000 (16:13 +0300)
Add a new omapdss_display_get() function to retrieve the omap_dss_device
for a given DSS output. This will be used when reversing the direction
of the DSS pipeline handling logic.

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/display.c
drivers/gpu/drm/omapdrm/dss/omapdss.h

index 53cb46f6503d0d5b2d1cad20f3bfaf8c34d2aabc..34b2a4ef63a4b11614872921d19daf6cfc4e40af 100644 (file)
@@ -49,3 +49,12 @@ void omapdss_display_init(struct omap_dss_device *dssdev)
                                              "display%u", id);
 }
 EXPORT_SYMBOL_GPL(omapdss_display_init);
+
+struct omap_dss_device *omapdss_display_get(struct omap_dss_device *output)
+{
+       while (output->next)
+               output = output->next;
+
+       return omapdss_device_get(output);
+}
+EXPORT_SYMBOL_GPL(omapdss_display_get);
index 5cbbfb16369be9a1ec8392182daa9e4b99b160a6..1621d1eaed4252f1df91031f10f89ec5013373dd 100644 (file)
@@ -496,6 +496,7 @@ static inline bool omapdss_is_initialized(void)
 #define for_each_dss_display(d) \
        while ((d = omapdss_device_get_next(d, OMAP_DSS_DEVICE_TYPE_DISPLAY)) != NULL)
 void omapdss_display_init(struct omap_dss_device *dssdev);
+struct omap_dss_device *omapdss_display_get(struct omap_dss_device *output);
 
 void omapdss_device_register(struct omap_dss_device *dssdev);
 void omapdss_device_unregister(struct omap_dss_device *dssdev);