aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/apply.c')
-rw-r--r--drivers/video/omap2/dss/apply.c51
1 files changed, 44 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 62319b8328da..debd37aa9128 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -55,6 +55,10 @@
55 */ 55 */
56 56
57struct ovl_priv_data { 57struct ovl_priv_data {
58
59 bool user_info_dirty;
60 struct omap_overlay_info user_info;
61
58 /* If true, cache changed, but not written to shadow registers. Set 62 /* If true, cache changed, but not written to shadow registers. Set
59 * in apply(), cleared when registers written. */ 63 * in apply(), cleared when registers written. */
60 bool dirty; 64 bool dirty;
@@ -129,7 +133,38 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
129 133
130void dss_apply_init(void) 134void dss_apply_init(void)
131{ 135{
136 const int num_ovls = dss_feat_get_num_ovls();
137 int i;
138
132 spin_lock_init(&data_lock); 139 spin_lock_init(&data_lock);
140
141 for (i = 0; i < num_ovls; ++i) {
142 struct ovl_priv_data *op;
143
144 op = &dss_data.ovl_priv_data_array[i];
145
146 op->info.global_alpha = 255;
147
148 switch (i) {
149 case 0:
150 op->info.zorder = 0;
151 break;
152 case 1:
153 op->info.zorder =
154 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 3 : 0;
155 break;
156 case 2:
157 op->info.zorder =
158 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 2 : 0;
159 break;
160 case 3:
161 op->info.zorder =
162 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 1 : 0;
163 break;
164 }
165
166 op->user_info = op->info;
167 }
133} 168}
134 169
135static bool ovl_manual_update(struct omap_overlay *ovl) 170static bool ovl_manual_update(struct omap_overlay *ovl)
@@ -575,15 +610,15 @@ static void omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
575 610
576 if (ovl->manager_changed) { 611 if (ovl->manager_changed) {
577 ovl->manager_changed = false; 612 ovl->manager_changed = false;
578 ovl->info_dirty = true; 613 op->user_info_dirty = true;
579 } 614 }
580 615
581 if (!ovl->info_dirty) 616 if (!op->user_info_dirty)
582 return; 617 return;
583 618
584 ovl->info_dirty = false; 619 op->user_info_dirty = false;
585 op->dirty = true; 620 op->dirty = true;
586 op->info = ovl->info; 621 op->info = op->user_info;
587 622
588 op->channel = ovl->manager->id; 623 op->channel = ovl->manager->id;
589} 624}
@@ -821,12 +856,13 @@ err:
821int dss_ovl_set_info(struct omap_overlay *ovl, 856int dss_ovl_set_info(struct omap_overlay *ovl,
822 struct omap_overlay_info *info) 857 struct omap_overlay_info *info)
823{ 858{
859 struct ovl_priv_data *op = get_ovl_priv(ovl);
824 unsigned long flags; 860 unsigned long flags;
825 861
826 spin_lock_irqsave(&data_lock, flags); 862 spin_lock_irqsave(&data_lock, flags);
827 863
828 ovl->info = *info; 864 op->user_info = *info;
829 ovl->info_dirty = true; 865 op->user_info_dirty = true;
830 866
831 spin_unlock_irqrestore(&data_lock, flags); 867 spin_unlock_irqrestore(&data_lock, flags);
832 868
@@ -836,11 +872,12 @@ int dss_ovl_set_info(struct omap_overlay *ovl,
836void dss_ovl_get_info(struct omap_overlay *ovl, 872void dss_ovl_get_info(struct omap_overlay *ovl,
837 struct omap_overlay_info *info) 873 struct omap_overlay_info *info)
838{ 874{
875 struct ovl_priv_data *op = get_ovl_priv(ovl);
839 unsigned long flags; 876 unsigned long flags;
840 877
841 spin_lock_irqsave(&data_lock, flags); 878 spin_lock_irqsave(&data_lock, flags);
842 879
843 *info = ovl->info; 880 *info = op->user_info;
844 881
845 spin_unlock_irqrestore(&data_lock, flags); 882 spin_unlock_irqrestore(&data_lock, flags);
846} 883}