diff mbox series

[v3,46/61] drm/omap: dss: Add function to retrieve display for an output

Message ID 20180806002741.30929-47-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series omapdrm: Reverse direction of DSS device (dis)connect operations | expand

Commit Message

Laurent Pinchart Aug. 6, 2018, 12:27 a.m. UTC
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>
---
 drivers/gpu/drm/omapdrm/dss/display.c | 9 +++++++++
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 +
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c
index 53cb46f6503d..34b2a4ef63a4 100644
--- a/drivers/gpu/drm/omapdrm/dss/display.c
+++ b/drivers/gpu/drm/omapdrm/dss/display.c
@@ -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);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 5cbbfb16369b..1621d1eaed42 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -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);