aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/manager.c')
-rw-r--r--drivers/video/omap2/dss/manager.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 27d9c465c851..913142d4cab1 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);
@@ -509,17 +522,18 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
509 u32 irq; 522 u32 irq;
510 int r; 523 int r;
511 int i; 524 int i;
525 struct omap_dss_device *dssdev = mgr->device;
512 526
513 if (!mgr->device) 527 if (!dssdev)
514 return 0; 528 return 0;
515 529
516 if (mgr->device->type == OMAP_DISPLAY_TYPE_VENC) { 530 if (dssdev->type == OMAP_DISPLAY_TYPE_VENC) {
517 irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; 531 irq = DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
518 channel = OMAP_DSS_CHANNEL_DIGIT; 532 channel = OMAP_DSS_CHANNEL_DIGIT;
519 } else { 533 } else {
520 if (mgr->device->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { 534 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
521 enum omap_dss_update_mode mode; 535 enum omap_dss_update_mode mode;
522 mode = mgr->device->get_update_mode(mgr->device); 536 mode = dssdev->driver->get_update_mode(dssdev);
523 if (mode != OMAP_DSS_UPDATE_AUTO) 537 if (mode != OMAP_DSS_UPDATE_AUTO)
524 return 0; 538 return 0;
525 539
@@ -592,7 +606,7 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
592 } else { 606 } else {
593 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { 607 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
594 enum omap_dss_update_mode mode; 608 enum omap_dss_update_mode mode;
595 mode = dssdev->get_update_mode(dssdev); 609 mode = dssdev->driver->get_update_mode(dssdev);
596 if (mode != OMAP_DSS_UPDATE_AUTO) 610 if (mode != OMAP_DSS_UPDATE_AUTO)
597 return 0; 611 return 0;
598 612
@@ -1064,7 +1078,7 @@ void dss_start_update(struct omap_dss_device *dssdev)
1064 mc->shadow_dirty = false; 1078 mc->shadow_dirty = false;
1065 } 1079 }
1066 1080
1067 dispc_enable_lcd_out(1); 1081 dssdev->manager->enable(dssdev->manager);
1068} 1082}
1069 1083
1070static void dss_apply_irq_handler(void *data, u32 mask) 1084static void dss_apply_irq_handler(void *data, u32 mask)
@@ -1196,7 +1210,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1196 1210
1197 oc->manual_update = 1211 oc->manual_update =
1198 dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && 1212 dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
1199 dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO; 1213 dssdev->driver->get_update_mode(dssdev) !=
1214 OMAP_DSS_UPDATE_AUTO;
1200 1215
1201 ++num_planes_enabled; 1216 ++num_planes_enabled;
1202 } 1217 }
@@ -1237,7 +1252,8 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1237 1252
1238 mc->manual_update = 1253 mc->manual_update =
1239 dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE && 1254 dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE &&
1240 dssdev->get_update_mode(dssdev) != OMAP_DSS_UPDATE_AUTO; 1255 dssdev->driver->get_update_mode(dssdev) !=
1256 OMAP_DSS_UPDATE_AUTO;
1241 } 1257 }
1242 1258
1243 /* XXX TODO: Try to get fifomerge working. The problem is that it 1259 /* XXX TODO: Try to get fifomerge working. The problem is that it
@@ -1351,6 +1367,18 @@ static void omap_dss_mgr_get_info(struct omap_overlay_manager *mgr,
1351 *info = mgr->info; 1367 *info = mgr->info;
1352} 1368}
1353 1369
1370static int dss_mgr_enable(struct omap_overlay_manager *mgr)
1371{
1372 dispc_enable_channel(mgr->id, 1);
1373 return 0;
1374}
1375
1376static int dss_mgr_disable(struct omap_overlay_manager *mgr)
1377{
1378 dispc_enable_channel(mgr->id, 0);
1379 return 0;
1380}
1381
1354static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager) 1382static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
1355{ 1383{
1356 ++num_managers; 1384 ++num_managers;
@@ -1394,6 +1422,10 @@ int dss_init_overlay_managers(struct platform_device *pdev)
1394 mgr->set_manager_info = &omap_dss_mgr_set_info; 1422 mgr->set_manager_info = &omap_dss_mgr_set_info;
1395 mgr->get_manager_info = &omap_dss_mgr_get_info; 1423 mgr->get_manager_info = &omap_dss_mgr_get_info;
1396 mgr->wait_for_go = &dss_mgr_wait_for_go; 1424 mgr->wait_for_go = &dss_mgr_wait_for_go;
1425 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
1426
1427 mgr->enable = &dss_mgr_enable;
1428 mgr->disable = &dss_mgr_disable;
1397 1429
1398 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC; 1430 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
1399 1431