OMAP: DSS2: Don't allow moving managers away from enabled displays
authorDaniel Morsing <daniel.morsing@gmail.com>
Wed, 3 Aug 2011 20:10:51 +0000 (22:10 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 14 Sep 2011 15:08:23 +0000 (18:08 +0300)
If a manager is moved while attached to an enabled display, the DSS
system will be left in an inconsistent state. This will eventually cause
a kernel oops when the enabled display is disabled.

Fix this by not allowing the user to move a manager away from an enabled
display.

Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/manager.c

index 13d72d5c714b10f5aa41e074b0640769989b93b5..63674b054d35992d46ed52bb579408dc6f171f04 100644 (file)
@@ -586,6 +586,13 @@ static int omap_dss_unset_device(struct omap_overlay_manager *mgr)
                return -EINVAL;
        }
 
+       /*
+        * Don't allow currently enabled displays to have the overlay manager
+        * pulled out from underneath them
+        */
+       if (mgr->device->state != OMAP_DSS_DISPLAY_DISABLED)
+               return -EINVAL;
+
        mgr->device->manager = NULL;
        mgr->device = NULL;
        mgr->device_changed = true;