]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
OMAP: DSS2: Handle manager change in apply
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 16 Aug 2011 09:56:19 +0000 (12:56 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 30 Sep 2011 13:16:19 +0000 (16:16 +0300)
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>
drivers/video/omap2/dss/dispc.c
drivers/video/omap2/dss/dss.h
drivers/video/omap2/dss/manager.c
drivers/video/omap2/dss/overlay.c
include/video/omapdss.h

index 9d9fbeb5362eccf4d98942fa6eb771ddb25785e8..003227c82b3f2c7aaf63021cb458194960e1e381 100644 (file)
@@ -841,7 +841,7 @@ static void _dispc_set_color_mode(enum omap_plane plane,
        REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), m, 4, 1);
 }
 
-void dispc_set_channel_out(enum omap_plane plane,
+static void dispc_set_channel_out(enum omap_plane plane,
                enum omap_channel channel)
 {
        int shift;
@@ -1860,6 +1860,8 @@ int dispc_setup_plane(enum omap_plane plane,
        _dispc_set_pre_mult_alpha(plane, pre_mult_alpha);
        _dispc_setup_global_alpha(plane, global_alpha);
 
+       dispc_set_channel_out(plane, channel);
+
        return 0;
 }
 
index adeff04e964fde3a4bdd3324503920be3d6b9b84..ff7ac35ec28291154decb1b2944abf21f352dbbf 100644 (file)
@@ -399,8 +399,6 @@ void dispc_set_plane_ba0(enum omap_plane plane, u32 paddr);
 void dispc_set_plane_ba1(enum omap_plane plane, u32 paddr);
 void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);
 void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height);
-void dispc_set_channel_out(enum omap_plane plane,
-               enum omap_channel channel_out);
 
 void dispc_enable_gamma_table(bool enable);
 int dispc_setup_plane(enum omap_plane plane,
index 63674b054d35992d46ed52bb579408dc6f171f04..a6a909ae86701097fb14b8340ce6a5452216c585 100644 (file)
@@ -1338,6 +1338,11 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 
                oc = &dss_cache.overlay_cache[ovl->id];
 
+               if (ovl->manager_changed) {
+                       ovl->manager_changed = false;
+                       ovl->info_dirty  = true;
+               }
+
                if (!overlay_enabled(ovl)) {
                        if (oc->enabled) {
                                oc->enabled = false;
index c84380c53c390633d0ec3f7f28ba32f48eb685f4..ab444036146b923a37c0395b256b1525869d036c 100644 (file)
@@ -516,6 +516,7 @@ static int omap_dss_set_manager(struct omap_overlay *ovl,
        }
 
        ovl->manager = mgr;
+       ovl->manager_changed = true;
 
        /* XXX: When there is an overlay on a DSI manual update display, and
         * 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,
         * Userspace workaround for this is to update the LCD after disabling
         * the overlay, but before moving the overlay to TV.
         */
-       dispc_set_channel_out(ovl->id, mgr->id);
 
        return 0;
 }
 
 static int omap_dss_unset_manager(struct omap_overlay *ovl)
 {
-       int r;
-
        if (!ovl->manager) {
                DSSERR("failed to detach overlay: manager not set\n");
                return -EINVAL;
@@ -548,11 +546,8 @@ static int omap_dss_unset_manager(struct omap_overlay *ovl)
                return -EINVAL;
        }
 
-       r = ovl->wait_for_go(ovl);
-       if (r)
-               return r;
-
        ovl->manager = NULL;
+       ovl->manager_changed = true;
 
        return 0;
 }
index c4d1d4ed909fc4a784f0812b946aa3535967a273..ecde53f71bd2680f3df15b65cd911a6074affc99 100644 (file)
@@ -333,6 +333,7 @@ struct omap_overlay {
        struct omap_overlay_manager *manager;
        struct omap_overlay_info info;
 
+       bool manager_changed;
        /* if true, info has been changed, but not applied() yet */
        bool info_dirty;