aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-15 05:11:11 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:39 -0500
commitf77b30700e5c0a6b5220b3a964bf6c40d5e71416 (patch)
tree3f1ee820f481f8e2a606852414b599c067564ff5 /drivers/video/omap2/dss
parentd09c7aa8989caf44e8754e8aa81ce80217a0e98a (diff)
OMAPDSS: APPLY: move ovl funcs to apply.c
apply.c will handle the management of dispc in the future patches. This patch moves overlay related functions to apply.c so that they will have access to the private data and functions of apply.c. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r--drivers/video/omap2/dss/apply.c84
-rw-r--r--drivers/video/omap2/dss/dss.h8
-rw-r--r--drivers/video/omap2/dss/overlay.c96
3 files changed, 98 insertions, 90 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 64f9997e5d01..e42d1d3baae2 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -662,3 +662,87 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
662 mgr->enabled = false; 662 mgr->enabled = false;
663} 663}
664 664
665int dss_ovl_set_info(struct omap_overlay *ovl,
666 struct omap_overlay_info *info)
667{
668 int r;
669 struct omap_overlay_info old_info;
670
671 old_info = ovl->info;
672 ovl->info = *info;
673
674 if (ovl->manager) {
675 r = dss_check_overlay(ovl, ovl->manager->device);
676 if (r) {
677 ovl->info = old_info;
678 return r;
679 }
680 }
681
682 ovl->info_dirty = true;
683
684 return 0;
685}
686
687void dss_ovl_get_info(struct omap_overlay *ovl,
688 struct omap_overlay_info *info)
689{
690 *info = ovl->info;
691}
692
693int dss_ovl_set_manager(struct omap_overlay *ovl,
694 struct omap_overlay_manager *mgr)
695{
696 if (!mgr)
697 return -EINVAL;
698
699 if (ovl->manager) {
700 DSSERR("overlay '%s' already has a manager '%s'\n",
701 ovl->name, ovl->manager->name);
702 return -EINVAL;
703 }
704
705 if (ovl->info.enabled) {
706 DSSERR("overlay has to be disabled to change the manager\n");
707 return -EINVAL;
708 }
709
710 ovl->manager = mgr;
711 list_add_tail(&ovl->list, &mgr->overlays);
712 ovl->manager_changed = true;
713
714 /* XXX: When there is an overlay on a DSI manual update display, and
715 * the overlay is first disabled, then moved to tv, and enabled, we
716 * seem to get SYNC_LOST_DIGIT error.
717 *
718 * Waiting doesn't seem to help, but updating the manual update display
719 * after disabling the overlay seems to fix this. This hints that the
720 * overlay is perhaps somehow tied to the LCD output until the output
721 * is updated.
722 *
723 * Userspace workaround for this is to update the LCD after disabling
724 * the overlay, but before moving the overlay to TV.
725 */
726
727 return 0;
728}
729
730int dss_ovl_unset_manager(struct omap_overlay *ovl)
731{
732 if (!ovl->manager) {
733 DSSERR("failed to detach overlay: manager not set\n");
734 return -EINVAL;
735 }
736
737 if (ovl->info.enabled) {
738 DSSERR("overlay has to be disabled to unset the manager\n");
739 return -EINVAL;
740 }
741
742 ovl->manager = NULL;
743 list_del(&ovl->list);
744 ovl->manager_changed = true;
745
746 return 0;
747}
748
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 1535496677ba..163b9d9b7a44 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -172,6 +172,14 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr);
172void dss_mgr_enable(struct omap_overlay_manager *mgr); 172void dss_mgr_enable(struct omap_overlay_manager *mgr);
173void dss_mgr_disable(struct omap_overlay_manager *mgr); 173void dss_mgr_disable(struct omap_overlay_manager *mgr);
174 174
175int dss_ovl_set_info(struct omap_overlay *ovl,
176 struct omap_overlay_info *info);
177void dss_ovl_get_info(struct omap_overlay *ovl,
178 struct omap_overlay_info *info);
179int dss_ovl_set_manager(struct omap_overlay *ovl,
180 struct omap_overlay_manager *mgr);
181int dss_ovl_unset_manager(struct omap_overlay *ovl);
182
175/* display */ 183/* display */
176int dss_suspend_all_devices(void); 184int dss_suspend_all_devices(void);
177int dss_resume_all_devices(void); 185int dss_resume_all_devices(void);
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 3c940654ef91..00c01a395554 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -520,90 +520,6 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
520 return 0; 520 return 0;
521} 521}
522 522
523static int dss_ovl_set_overlay_info(struct omap_overlay *ovl,
524 struct omap_overlay_info *info)
525{
526 int r;
527 struct omap_overlay_info old_info;
528
529 old_info = ovl->info;
530 ovl->info = *info;
531
532 if (ovl->manager) {
533 r = dss_check_overlay(ovl, ovl->manager->device);
534 if (r) {
535 ovl->info = old_info;
536 return r;
537 }
538 }
539
540 ovl->info_dirty = true;
541
542 return 0;
543}
544
545static void dss_ovl_get_overlay_info(struct omap_overlay *ovl,
546 struct omap_overlay_info *info)
547{
548 *info = ovl->info;
549}
550
551static int omap_dss_set_manager(struct omap_overlay *ovl,
552 struct omap_overlay_manager *mgr)
553{
554 if (!mgr)
555 return -EINVAL;
556
557 if (ovl->manager) {
558 DSSERR("overlay '%s' already has a manager '%s'\n",
559 ovl->name, ovl->manager->name);
560 return -EINVAL;
561 }
562
563 if (ovl->info.enabled) {
564 DSSERR("overlay has to be disabled to change the manager\n");
565 return -EINVAL;
566 }
567
568 ovl->manager = mgr;
569 list_add_tail(&ovl->list, &mgr->overlays);
570 ovl->manager_changed = true;
571
572 /* XXX: When there is an overlay on a DSI manual update display, and
573 * the overlay is first disabled, then moved to tv, and enabled, we
574 * seem to get SYNC_LOST_DIGIT error.
575 *
576 * Waiting doesn't seem to help, but updating the manual update display
577 * after disabling the overlay seems to fix this. This hints that the
578 * overlay is perhaps somehow tied to the LCD output until the output
579 * is updated.
580 *
581 * Userspace workaround for this is to update the LCD after disabling
582 * the overlay, but before moving the overlay to TV.
583 */
584
585 return 0;
586}
587
588static int omap_dss_unset_manager(struct omap_overlay *ovl)
589{
590 if (!ovl->manager) {
591 DSSERR("failed to detach overlay: manager not set\n");
592 return -EINVAL;
593 }
594
595 if (ovl->info.enabled) {
596 DSSERR("overlay has to be disabled to unset the manager\n");
597 return -EINVAL;
598 }
599
600 ovl->manager = NULL;
601 list_del(&ovl->list);
602 ovl->manager_changed = true;
603
604 return 0;
605}
606
607int omap_dss_get_num_overlays(void) 523int omap_dss_get_num_overlays(void)
608{ 524{
609 return num_overlays; 525 return num_overlays;
@@ -663,10 +579,10 @@ void dss_init_overlays(struct platform_device *pdev)
663 break; 579 break;
664 } 580 }
665 581
666 ovl->set_manager = &omap_dss_set_manager; 582 ovl->set_manager = &dss_ovl_set_manager;
667 ovl->unset_manager = &omap_dss_unset_manager; 583 ovl->unset_manager = &dss_ovl_unset_manager;
668 ovl->set_overlay_info = &dss_ovl_set_overlay_info; 584 ovl->set_overlay_info = &dss_ovl_set_info;
669 ovl->get_overlay_info = &dss_ovl_get_overlay_info; 585 ovl->get_overlay_info = &dss_ovl_get_info;
670 ovl->wait_for_go = &dss_mgr_wait_for_go_ovl; 586 ovl->wait_for_go = &dss_mgr_wait_for_go_ovl;
671 587
672 ovl->caps = dss_feat_get_overlay_caps(ovl->id); 588 ovl->caps = dss_feat_get_overlay_caps(ovl->id);
@@ -731,8 +647,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
731 ovl = omap_dss_get_overlay(i); 647 ovl = omap_dss_get_overlay(i);
732 if (!ovl->manager || force) { 648 if (!ovl->manager || force) {
733 if (ovl->manager) 649 if (ovl->manager)
734 omap_dss_unset_manager(ovl); 650 ovl->unset_manager(ovl);
735 omap_dss_set_manager(ovl, mgr); 651 ovl->set_manager(ovl, mgr);
736 } 652 }
737 } 653 }
738 654