aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-23 08:35:35 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:00:42 -0400
commitbe8e8e1c62678765868c0bc7b8b5209c38af105c (patch)
tree405e8641bb55bbd9ab0b82f304961bb1a19474d7 /drivers/video/omap2/omapfb
parente724366498ead17579686f7ad83235f911a9c4f7 (diff)
OMAPDSS: add helpers to get mgr or output from display
Add two helper functions that can be used to find either the DSS output or the overlay manager that is connected to the given display. This hides how the output and the manager are actually connected, making it easier to change the connections in the future. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c9
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c16
2 files changed, 14 insertions, 11 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index d30b45d72649..146b6f5428db 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -770,12 +770,17 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
770 770
771 case OMAPFB_WAITFORVSYNC: 771 case OMAPFB_WAITFORVSYNC:
772 DBG("ioctl WAITFORVSYNC\n"); 772 DBG("ioctl WAITFORVSYNC\n");
773 if (!display || !display->output || !display->output->manager) { 773
774 if (!display) {
774 r = -EINVAL; 775 r = -EINVAL;
775 break; 776 break;
776 } 777 }
777 778
778 mgr = display->output->manager; 779 mgr = omapdss_find_mgr_from_display(display);
780 if (!mgr) {
781 r = -EINVAL;
782 break;
783 }
779 784
780 r = mgr->wait_for_vsync(mgr); 785 r = mgr->wait_for_vsync(mgr);
781 break; 786 break;
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 856917b33616..cc8953c4faa1 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2363,18 +2363,16 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
2363 int i, r; 2363 int i, r;
2364 struct omap_overlay_manager *mgr; 2364 struct omap_overlay_manager *mgr;
2365 2365
2366 if (!def_dssdev->output) {
2367 dev_err(fbdev->dev, "no output for the default display\n");
2368 return -EINVAL;
2369 }
2370
2371 for (i = 0; i < fbdev->num_displays; ++i) { 2366 for (i = 0; i < fbdev->num_displays; ++i) {
2372 struct omap_dss_device *dssdev = fbdev->displays[i].dssdev; 2367 struct omap_dss_device *dssdev = fbdev->displays[i].dssdev;
2373 struct omap_dss_output *out = dssdev->output; 2368 struct omap_dss_output *out;
2374 2369
2375 mgr = omap_dss_get_overlay_manager(out->dispc_channel); 2370 out = omapdss_find_output_from_display(dssdev);
2371 if (!out)
2372 continue;
2376 2373
2377 if (!mgr || !out) 2374 mgr = omap_dss_get_overlay_manager(out->dispc_channel);
2375 if (!mgr)
2378 continue; 2376 continue;
2379 2377
2380 if (mgr->output) 2378 if (mgr->output)
@@ -2383,7 +2381,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
2383 mgr->set_output(mgr, out); 2381 mgr->set_output(mgr, out);
2384 } 2382 }
2385 2383
2386 mgr = def_dssdev->output->manager; 2384 mgr = omapdss_find_mgr_from_display(def_dssdev);
2387 2385
2388 if (!mgr) { 2386 if (!mgr) {
2389 dev_err(fbdev->dev, "no ovl manager for the default display\n"); 2387 dev_err(fbdev->dev, "no ovl manager for the default display\n");