OMAPDSS: modify get/find functions to go through the device chain
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 23 Apr 2013 11:35:40 +0000 (14:35 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 17 Jun 2013 11:00:57 +0000 (14:00 +0300)
In the future will have arbitrarily long video pipeline chains, instead
of the current two-entities-per-pipeline model.

This patch changes the affected get/find style functions so that they
properly go through the video pipeline chain, for example when getting
the overlay manager connected to a given display.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/apply.c
drivers/video/omap2/dss/output.c

index 752b98592908917da0a70790ae19ed83e1369838..d6212d63cfb213a4f09fb95c9e4f03faea03edcf 100644 (file)
@@ -422,7 +422,19 @@ static void wait_pending_extra_info_updates(void)
 
 static struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
 {
-       return mgr->output ? mgr->output->device : NULL;
+       struct omap_dss_device *dssdev;
+
+       dssdev = mgr->output;
+       if (dssdev == NULL)
+               return NULL;
+
+       while (dssdev->device)
+               dssdev = dssdev->device;
+
+       if (dssdev->driver)
+               return dssdev;
+       else
+               return NULL;
 }
 
 static struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl)
index 0ba168e239077d9411324b96b2c63b29758cb2f2..3f5c0a758b32cb816b05321089e3633ec43f0a47 100644 (file)
@@ -146,7 +146,13 @@ EXPORT_SYMBOL(omap_dss_find_output_by_node);
 
 struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
 {
-       return omap_dss_get_device(dssdev->output);
+       while (dssdev->output)
+               dssdev = dssdev->output;
+
+       if (dssdev->id != 0)
+               return omap_dss_get_device(dssdev);
+
+       return NULL;
 }
 EXPORT_SYMBOL(omapdss_find_output_from_display);