]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/video/omap2/omapfb/omapfb-main.c
Merge tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6
[mirror_ubuntu-zesty-kernel.git] / drivers / video / omap2 / omapfb / omapfb-main.c
index 15373f4aee1976435b5f6d94d48b1f824ab718a2..16db1589bd9180a01920078f156b3650971b2311 100644 (file)
@@ -1593,6 +1593,20 @@ static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev)
        return 0;
 }
 
+static void omapfb_clear_fb(struct fb_info *fbi)
+{
+       const struct fb_fillrect rect = {
+               .dx = 0,
+               .dy = 0,
+               .width = fbi->var.xres_virtual,
+               .height = fbi->var.yres_virtual,
+               .color = 0,
+               .rop = ROP_COPY,
+       };
+
+       cfb_fillrect(fbi, &rect);
+}
+
 int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
 {
        struct omapfb_info *ofbi = FB2OFB(fbi);
@@ -1662,6 +1676,8 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
                        goto err;
        }
 
+       omapfb_clear_fb(fbi);
+
        return 0;
 err:
        omapfb_free_fbmem(fbi);
@@ -1946,6 +1962,16 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
                }
        }
 
+       for (i = 0; i < fbdev->num_fbs; i++) {
+               struct fb_info *fbi = fbdev->fbs[i];
+               struct omapfb_info *ofbi = FB2OFB(fbi);
+
+               if (ofbi->region->size == 0)
+                       continue;
+
+               omapfb_clear_fb(fbi);
+       }
+
        DBG("fb_infos initialized\n");
 
        for (i = 0; i < fbdev->num_fbs; i++) {
@@ -2354,6 +2380,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
        struct omap_overlay *ovl;
        struct omap_dss_device *def_display;
        struct omap_dss_device *dssdev;
+       struct omap_dss_device *ovl_device;
 
        DBG("omapfb_probe\n");
 
@@ -2427,8 +2454,9 @@ static int __init omapfb_probe(struct platform_device *pdev)
        /* gfx overlay should be the default one. find a display
         * connected to that, and use it as default display */
        ovl = omap_dss_get_overlay(0);
-       if (ovl->manager && ovl->manager->device) {
-               def_display = ovl->manager->device;
+       ovl_device = ovl->get_device(ovl);
+       if (ovl_device) {
+               def_display = ovl_device;
        } else {
                dev_warn(&pdev->dev, "cannot find default display\n");
                def_display = NULL;