]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
OMAPFB: disable overlays on driver removal
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 9 Jan 2014 11:46:20 +0000 (13:46 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 13 Jan 2014 10:19:56 +0000 (12:19 +0200)
When omapfb module is removed, the driver will turn off all the displays
it manages. However, it leaves the overlays enabled. While the overlays
are obviously disabled as the displays are disabled, it causes issues
when the driver module is loaded again, as at that point the overlays
are still enabled on the hardware level. The result is that even if the
SW thinks overlays are disabled, they are actually enabled.

Fix this by making sure the overlays are disabled at module removal.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/omapfb/omapfb-main.c

index 2ff9f039b7cb9750a9542eb07a61715b69aca7b2..fcb9e932d00cff60b1426a132d150e0348afc37b 100644 (file)
@@ -1833,6 +1833,16 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
        if (fbdev == NULL)
                return;
 
+       for (i = 0; i < fbdev->num_fbs; i++) {
+               struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[i]);
+               int j;
+
+               for (j = 0; j < ofbi->num_overlays; j++) {
+                       struct omap_overlay *ovl = ofbi->overlays[j];
+                       ovl->disable(ovl);
+               }
+       }
+
        for (i = 0; i < fbdev->num_fbs; i++)
                unregister_framebuffer(fbdev->fbs[i]);