aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/apply.c
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/apply.c
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/apply.c')
-rw-r--r--drivers/video/omap2/dss/apply.c84
1 files changed, 84 insertions, 0 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