aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-08-16 05:56:19 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:19 -0400
commit8fa8031c542986746ed4dfbd1eb52358bc86000b (patch)
treec8d0190c274a9e4d86468936ce3e196746987237 /drivers/video
parent5e7850917fc213882d4e409634c526a8ff310e1e (diff)
OMAP: DSS2: Handle manager change in apply
Currently when changing the manager of an overlay, set_manager() directly calls dispc to set the overlay's destination. Change this to be more in line with other overlay configurations, and this will also remove the need to have dispc clocks enabled when calling set_manager(). A new field is added to overlay struct, "manager_changed". This is similar to "display_changed" field in manager struct, and is used to inform apply that the manager has changed and thus write to the registers is needed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c4
-rw-r--r--drivers/video/omap2/dss/dss.h2
-rw-r--r--drivers/video/omap2/dss/manager.c5
-rw-r--r--drivers/video/omap2/dss/overlay.c9
4 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 9d9fbeb5362e..003227c82b3f 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -841,7 +841,7 @@ static void _dispc_set_color_mode(enum omap_plane plane,
841 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1); 841 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1);
842} 842}
843 843
844void dispc_set_channel_out(enum omap_plane plane, 844static void dispc_set_channel_out(enum omap_plane plane,
845 enum omap_channel channel) 845 enum omap_channel channel)
846{ 846{
847 int shift; 847 int shift;
@@ -1860,6 +1860,8 @@ int dispc_setup_plane(enum omap_plane plane,
1860 _dispc_set_pre_mult_alpha(plane, pre_mult_alpha); 1860 _dispc_set_pre_mult_alpha(plane, pre_mult_alpha);
1861 _dispc_setup_global_alpha(plane, global_alpha); 1861 _dispc_setup_global_alpha(plane, global_alpha);
1862 1862
1863 dispc_set_channel_out(plane, channel);
1864
1863 return 0; 1865 return 0;
1864} 1866}
1865 1867
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index adeff04e964f..ff7ac35ec282 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -399,8 +399,6 @@ void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
399void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr); 399void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
400void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y); 400void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
401void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height); 401void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
402void dispc_set_channel_out(enum omap_plane plane,
403 enum omap_channel channel_out);
404 402
405void dispc_enable_gamma_table(bool enable); 403void dispc_enable_gamma_table(bool enable);
406int dispc_setup_plane(enum omap_plane plane, 404int dispc_setup_plane(enum omap_plane plane,
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 63674b054d35..a6a909ae8670 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -1338,6 +1338,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
1338 1338
1339 oc = &dss_cache.overlay_cache[ovl->id]; 1339 oc = &dss_cache.overlay_cache[ovl->id];
1340 1340
1341 if (ovl->manager_changed) {
1342 ovl->manager_changed = false;
1343 ovl->info_dirty = true;
1344 }
1345
1341 if (!overlay_enabled(ovl)) { 1346 if (!overlay_enabled(ovl)) {
1342 if (oc->enabled) { 1347 if (oc->enabled) {
1343 oc->enabled = false; 1348 oc->enabled = false;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index c84380c53c39..ab444036146b 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -516,6 +516,7 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
516 } 516 }
517 517
518 ovl->manager = mgr; 518 ovl->manager = mgr;
519 ovl->manager_changed = true;
519 520
520 /* XXX: When there is an overlay on a DSI manual update display, and 521 /* XXX: When there is an overlay on a DSI manual update display, and
521 * the overlay is first disabled, then moved to tv, and enabled, we 522 * the overlay is first disabled, then moved to tv, and enabled, we
@@ -529,15 +530,12 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
529 * Userspace workaround for this is to update the LCD after disabling 530 * Userspace workaround for this is to update the LCD after disabling
530 * the overlay, but before moving the overlay to TV. 531 * the overlay, but before moving the overlay to TV.
531 */ 532 */
532 dispc_set_channel_out(ovl->id, mgr->id);
533 533
534 return 0; 534 return 0;
535} 535}
536 536
537static int omap_dss_unset_manager(struct omap_overlay *ovl) 537static int omap_dss_unset_manager(struct omap_overlay *ovl)
538{ 538{
539 int r;
540
541 if (!ovl->manager) { 539 if (!ovl->manager) {
542 DSSERR("failed to detach overlay: manager not set\n"); 540 DSSERR("failed to detach overlay: manager not set\n");
543 return -EINVAL; 541 return -EINVAL;
@@ -548,11 +546,8 @@ static int omap_dss_unset_manager(struct omap_overlay *ovl)
548 return -EINVAL; 546 return -EINVAL;
549 } 547 }
550 548
551 r = ovl->wait_for_go(ovl);
552 if (r)
553 return r;
554
555 ovl->manager = NULL; 549 ovl->manager = NULL;
550 ovl->manager_changed = true;
556 551
557 return 0; 552 return 0;
558} 553}