aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-16 08:00:22 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-01-25 06:46:18 -0500
commitfb0119742291b6f30cd97026ee137b2d3d1f4de8 (patch)
tree2facad7cd414ac20101696e094939a39532a457c
parente6b0f884520e604408ebda3b60605cabe0a8d162 (diff)
OMAPDSS: APPLY: add fifo merge support funcs
Add mechanism to set/unset the DISPC fifo-merge: Add new fields to dss_data, fifo_merge and fifo_merge_dirty. These are similar to the other info/dirty flags in ovl_priv_data and ovl_mgr_data, but fifo merge is a common attribute to all managers and thus outside the ovl_mgr_data. The fifo-merge field is used in the dss_write_regs_common, which handles writing the register. dss_apply_fifo_merge() can be used to set/unset the fifo merge field in the dss_data. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/apply.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 052dc874cd3d..604737f1187d 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -105,6 +105,9 @@ static struct {
105 struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS]; 105 struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
106 struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS]; 106 struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS];
107 107
108 bool fifo_merge_dirty;
109 bool fifo_merge;
110
108 bool irq_enabled; 111 bool irq_enabled;
109} dss_data; 112} dss_data;
110 113
@@ -585,11 +588,40 @@ static void dss_mgr_write_regs(struct omap_overlay_manager *mgr)
585 } 588 }
586} 589}
587 590
591static void dss_write_regs_common(void)
592{
593 const int num_mgrs = omap_dss_get_num_overlay_managers();
594 int i;
595
596 if (!dss_data.fifo_merge_dirty)
597 return;
598
599 for (i = 0; i < num_mgrs; ++i) {
600 struct omap_overlay_manager *mgr;
601 struct mgr_priv_data *mp;
602
603 mgr = omap_dss_get_overlay_manager(i);
604 mp = get_mgr_priv(mgr);
605
606 if (mp->enabled) {
607 if (dss_data.fifo_merge_dirty) {
608 dispc_enable_fifomerge(dss_data.fifo_merge);
609 dss_data.fifo_merge_dirty = false;
610 }
611
612 if (mp->updating)
613 mp->shadow_info_dirty = true;
614 }
615 }
616}
617
588static void dss_write_regs(void) 618static void dss_write_regs(void)
589{ 619{
590 const int num_mgrs = omap_dss_get_num_overlay_managers(); 620 const int num_mgrs = omap_dss_get_num_overlay_managers();
591 int i; 621 int i;
592 622
623 dss_write_regs_common();
624
593 for (i = 0; i < num_mgrs; ++i) { 625 for (i = 0; i < num_mgrs; ++i) {
594 struct omap_overlay_manager *mgr; 626 struct omap_overlay_manager *mgr;
595 struct mgr_priv_data *mp; 627 struct mgr_priv_data *mp;
@@ -659,6 +691,8 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr)
659 691
660 dss_mgr_write_regs(mgr); 692 dss_mgr_write_regs(mgr);
661 693
694 dss_write_regs_common();
695
662 mp->updating = true; 696 mp->updating = true;
663 697
664 if (!dss_data.irq_enabled && need_isr()) 698 if (!dss_data.irq_enabled && need_isr())
@@ -859,6 +893,15 @@ static void dss_apply_ovl_fifo_thresholds(struct omap_overlay *ovl,
859 op->extra_info_dirty = true; 893 op->extra_info_dirty = true;
860} 894}
861 895
896static void dss_apply_fifo_merge(bool use_fifo_merge)
897{
898 if (dss_data.fifo_merge == use_fifo_merge)
899 return;
900
901 dss_data.fifo_merge = use_fifo_merge;
902 dss_data.fifo_merge_dirty = true;
903}
904
862static void dss_ovl_setup_fifo(struct omap_overlay *ovl) 905static void dss_ovl_setup_fifo(struct omap_overlay *ovl)
863{ 906{
864 struct ovl_priv_data *op = get_ovl_priv(ovl); 907 struct ovl_priv_data *op = get_ovl_priv(ovl);