aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-08 10:06:04 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-24 07:31:27 -0500
commit3f71cbe736e7e9909559fcc4463f43e4b4b348a8 (patch)
tree5dfcab336179739a06c82c72fc37272af39b795a
parent87424e1bffeaea7bf9e2b8afc16fe584a8641e5e (diff)
OMAP: DSS2: move wait_vsync()
Move wait_vsync() from omap_dss_device to overlay manager. This is part of a larger patch-set, which moves the control from omapdss driver to the display driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--arch/arm/plat-omap/include/plat/display.h2
-rw-r--r--drivers/video/omap2/dss/display.c14
-rw-r--r--drivers/video/omap2/dss/manager.c14
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c2
4 files changed, 16 insertions, 16 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 9291aa133e71..059b35cfd125 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -370,6 +370,7 @@ struct omap_overlay_manager {
370 370
371 int (*apply)(struct omap_overlay_manager *mgr); 371 int (*apply)(struct omap_overlay_manager *mgr);
372 int (*wait_for_go)(struct omap_overlay_manager *mgr); 372 int (*wait_for_go)(struct omap_overlay_manager *mgr);
373 int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
373}; 374};
374 375
375struct omap_dss_device { 376struct omap_dss_device {
@@ -479,7 +480,6 @@ struct omap_dss_device {
479 int (*update)(struct omap_dss_device *dssdev, 480 int (*update)(struct omap_dss_device *dssdev,
480 u16 x, u16 y, u16 w, u16 h); 481 u16 x, u16 y, u16 w, u16 h);
481 int (*sync)(struct omap_dss_device *dssdev); 482 int (*sync)(struct omap_dss_device *dssdev);
482 int (*wait_vsync)(struct omap_dss_device *dssdev);
483 483
484 int (*set_update_mode)(struct omap_dss_device *dssdev, 484 int (*set_update_mode)(struct omap_dss_device *dssdev,
485 enum omap_dss_update_mode); 485 enum omap_dss_update_mode);
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 263d2fd93bac..80b67d1c9d03 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -323,19 +323,6 @@ void default_get_overlay_fifo_thresholds(enum omap_plane plane,
323 *fifo_low = fifo_size - burst_size_bytes; 323 *fifo_low = fifo_size - burst_size_bytes;
324} 324}
325 325
326static int default_wait_vsync(struct omap_dss_device *dssdev)
327{
328 unsigned long timeout = msecs_to_jiffies(500);
329 u32 irq;
330
331 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC)
332 irq = DISPC_IRQ_EVSYNC_ODD;
333 else
334 irq = DISPC_IRQ_VSYNC;
335
336 return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
337}
338
339static int default_get_recommended_bpp(struct omap_dss_device *dssdev) 326static int default_get_recommended_bpp(struct omap_dss_device *dssdev)
340{ 327{
341 if (dssdev->panel.recommended_bpp) 328 if (dssdev->panel.recommended_bpp)
@@ -427,7 +414,6 @@ void dss_init_device(struct platform_device *pdev,
427 414
428 dssdev->get_resolution = default_get_resolution; 415 dssdev->get_resolution = default_get_resolution;
429 dssdev->get_recommended_bpp = default_get_recommended_bpp; 416 dssdev->get_recommended_bpp = default_get_recommended_bpp;
430 dssdev->wait_vsync = default_wait_vsync;
431 417
432 switch (dssdev->type) { 418 switch (dssdev->type) {
433 case OMAP_DISPLAY_TYPE_DPI: 419 case OMAP_DISPLAY_TYPE_DPI:
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 27d9c465c851..486cd4aec652 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -501,6 +501,19 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
501 return 0; 501 return 0;
502} 502}
503 503
504static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
505{
506 unsigned long timeout = msecs_to_jiffies(500);
507 u32 irq;
508
509 if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC)
510 irq = DISPC_IRQ_EVSYNC_ODD;
511 else
512 irq = DISPC_IRQ_VSYNC;
513
514 return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
515}
516
504static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) 517static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
505{ 518{
506 unsigned long timeout = msecs_to_jiffies(500); 519 unsigned long timeout = msecs_to_jiffies(500);
@@ -1394,6 +1407,7 @@ int dss_init_overlay_managers(struct platform_device *pdev)
1394 mgr->set_manager_info = &omap_dss_mgr_set_info; 1407 mgr->set_manager_info = &omap_dss_mgr_set_info;
1395 mgr->get_manager_info = &omap_dss_mgr_get_info; 1408 mgr->get_manager_info = &omap_dss_mgr_get_info;
1396 mgr->wait_for_go = &dss_mgr_wait_for_go; 1409 mgr->wait_for_go = &dss_mgr_wait_for_go;
1410 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
1397 1411
1398 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC; 1412 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
1399 1413
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 6e0186edc7da..36afab30921e 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -649,7 +649,7 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
649 break; 649 break;
650 } 650 }
651 651
652 r = display->wait_vsync(display); 652 r = display->manager->wait_for_vsync(display->manager);
653 break; 653 break;
654 654
655 case OMAPFB_WAITFORGO: 655 case OMAPFB_WAITFORGO: