aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/omap2/dss/apply.c51
-rw-r--r--drivers/video/omap2/dss/overlay.c53
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c12
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c12
-rw-r--r--include/video/omapdss.h3
5 files changed, 93 insertions, 38 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}
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 7d7cdf62059b..8d036e661a26 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -124,19 +124,31 @@ err:
124 124
125static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf) 125static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf)
126{ 126{
127 struct omap_overlay_info info;
128
129 ovl->get_overlay_info(ovl, &info);
130
127 return snprintf(buf, PAGE_SIZE, "%d,%d\n", 131 return snprintf(buf, PAGE_SIZE, "%d,%d\n",
128 ovl->info.width, ovl->info.height); 132 info.width, info.height);
129} 133}
130 134
131static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf) 135static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf)
132{ 136{
133 return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.screen_width); 137 struct omap_overlay_info info;
138
139 ovl->get_overlay_info(ovl, &info);
140
141 return snprintf(buf, PAGE_SIZE, "%d\n", info.screen_width);
134} 142}
135 143
136static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf) 144static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf)
137{ 145{
146 struct omap_overlay_info info;
147
148 ovl->get_overlay_info(ovl, &info);
149
138 return snprintf(buf, PAGE_SIZE, "%d,%d\n", 150 return snprintf(buf, PAGE_SIZE, "%d,%d\n",
139 ovl->info.pos_x, ovl->info.pos_y); 151 info.pos_x, info.pos_y);
140} 152}
141 153
142static ssize_t overlay_position_store(struct omap_overlay *ovl, 154static ssize_t overlay_position_store(struct omap_overlay *ovl,
@@ -170,8 +182,12 @@ static ssize_t overlay_position_store(struct omap_overlay *ovl,
170 182
171static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf) 183static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf)
172{ 184{
185 struct omap_overlay_info info;
186
187 ovl->get_overlay_info(ovl, &info);
188
173 return snprintf(buf, PAGE_SIZE, "%d,%d\n", 189 return snprintf(buf, PAGE_SIZE, "%d,%d\n",
174 ovl->info.out_width, ovl->info.out_height); 190 info.out_width, info.out_height);
175} 191}
176 192
177static ssize_t overlay_output_size_store(struct omap_overlay *ovl, 193static ssize_t overlay_output_size_store(struct omap_overlay *ovl,
@@ -231,8 +247,12 @@ static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
231 247
232static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf) 248static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf)
233{ 249{
250 struct omap_overlay_info info;
251
252 ovl->get_overlay_info(ovl, &info);
253
234 return snprintf(buf, PAGE_SIZE, "%d\n", 254 return snprintf(buf, PAGE_SIZE, "%d\n",
235 ovl->info.global_alpha); 255 info.global_alpha);
236} 256}
237 257
238static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl, 258static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
@@ -269,8 +289,12 @@ static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
269static ssize_t overlay_pre_mult_alpha_show(struct omap_overlay *ovl, 289static ssize_t overlay_pre_mult_alpha_show(struct omap_overlay *ovl,
270 char *buf) 290 char *buf)
271{ 291{
292 struct omap_overlay_info info;
293
294 ovl->get_overlay_info(ovl, &info);
295
272 return snprintf(buf, PAGE_SIZE, "%d\n", 296 return snprintf(buf, PAGE_SIZE, "%d\n",
273 ovl->info.pre_mult_alpha); 297 info.pre_mult_alpha);
274} 298}
275 299
276static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl, 300static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,
@@ -306,7 +330,11 @@ static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,
306 330
307static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf) 331static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf)
308{ 332{
309 return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.zorder); 333 struct omap_overlay_info info;
334
335 ovl->get_overlay_info(ovl, &info);
336
337 return snprintf(buf, PAGE_SIZE, "%d\n", info.zorder);
310} 338}
311 339
312static ssize_t overlay_zorder_store(struct omap_overlay *ovl, 340static ssize_t overlay_zorder_store(struct omap_overlay *ovl,
@@ -456,29 +484,18 @@ void dss_init_overlays(struct platform_device *pdev)
456 case 0: 484 case 0:
457 ovl->name = "gfx"; 485 ovl->name = "gfx";
458 ovl->id = OMAP_DSS_GFX; 486 ovl->id = OMAP_DSS_GFX;
459 ovl->info.global_alpha = 255;
460 ovl->info.zorder = 0;
461 break; 487 break;
462 case 1: 488 case 1:
463 ovl->name = "vid1"; 489 ovl->name = "vid1";
464 ovl->id = OMAP_DSS_VIDEO1; 490 ovl->id = OMAP_DSS_VIDEO1;
465 ovl->info.global_alpha = 255;
466 ovl->info.zorder =
467 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 3 : 0;
468 break; 491 break;
469 case 2: 492 case 2:
470 ovl->name = "vid2"; 493 ovl->name = "vid2";
471 ovl->id = OMAP_DSS_VIDEO2; 494 ovl->id = OMAP_DSS_VIDEO2;
472 ovl->info.global_alpha = 255;
473 ovl->info.zorder =
474 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 2 : 0;
475 break; 495 break;
476 case 3: 496 case 3:
477 ovl->name = "vid3"; 497 ovl->name = "vid3";
478 ovl->id = OMAP_DSS_VIDEO3; 498 ovl->id = OMAP_DSS_VIDEO3;
479 ovl->info.global_alpha = 255;
480 ovl->info.zorder =
481 dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 1 : 0;
482 break; 499 break;
483 } 500 }
484 501
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 562b5cc07609..16ba6196f330 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -189,19 +189,19 @@ static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
189 memset(pi, 0, sizeof(*pi)); 189 memset(pi, 0, sizeof(*pi));
190 } else { 190 } else {
191 struct omap_overlay *ovl; 191 struct omap_overlay *ovl;
192 struct omap_overlay_info *ovli; 192 struct omap_overlay_info ovli;
193 193
194 ovl = ofbi->overlays[0]; 194 ovl = ofbi->overlays[0];
195 ovli = &ovl->info; 195 ovl->get_overlay_info(ovl, &ovli);
196 196
197 pi->pos_x = ovli->pos_x; 197 pi->pos_x = ovli.pos_x;
198 pi->pos_y = ovli->pos_y; 198 pi->pos_y = ovli.pos_y;
199 pi->enabled = ovl->is_enabled(ovl); 199 pi->enabled = ovl->is_enabled(ovl);
200 pi->channel_out = 0; /* xxx */ 200 pi->channel_out = 0; /* xxx */
201 pi->mirror = 0; 201 pi->mirror = 0;
202 pi->mem_idx = get_mem_idx(ofbi); 202 pi->mem_idx = get_mem_idx(ofbi);
203 pi->out_width = ovli->out_width; 203 pi->out_width = ovli.out_width;
204 pi->out_height = ovli->out_height; 204 pi->out_height = ovli.out_height;
205 } 205 }
206 206
207 return 0; 207 return 0;
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 91b49b530695..46024ab9dae6 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -970,16 +970,20 @@ int omapfb_apply_changes(struct fb_info *fbi, int init)
970 outh = var->yres; 970 outh = var->yres;
971 } 971 }
972 } else { 972 } else {
973 outw = ovl->info.out_width; 973 struct omap_overlay_info info;
974 outh = ovl->info.out_height; 974 ovl->get_overlay_info(ovl, &info);
975 outw = info.out_width;
976 outh = info.out_height;
975 } 977 }
976 978
977 if (init) { 979 if (init) {
978 posx = 0; 980 posx = 0;
979 posy = 0; 981 posy = 0;
980 } else { 982 } else {
981 posx = ovl->info.pos_x; 983 struct omap_overlay_info info;
982 posy = ovl->info.pos_y; 984 ovl->get_overlay_info(ovl, &info);
985 posx = info.pos_x;
986 posy = info.pos_y;
983 } 987 }
984 988
985 r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh); 989 r = omapfb_setup_overlay(fbi, ovl, posx, posy, outw, outh);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 0d5333f6e4a1..2e2c53f5e7ca 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -383,11 +383,8 @@ struct omap_overlay {
383 383
384 /* dynamic fields */ 384 /* dynamic fields */
385 struct omap_overlay_manager *manager; 385 struct omap_overlay_manager *manager;
386 struct omap_overlay_info info;
387 386
388 bool manager_changed; 387 bool manager_changed;
389 /* if true, info has been changed, but not applied() yet */
390 bool info_dirty;
391 388
392 int (*enable)(struct omap_overlay *ovl); 389 int (*enable)(struct omap_overlay *ovl);
393 int (*disable)(struct omap_overlay *ovl); 390 int (*disable)(struct omap_overlay *ovl);