aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-08-30 09:53:29 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-07 13:02:08 -0400
commitca444158723f3b92531dc552c154fed108f8bc15 (patch)
tree61133c25493a51d37f729b84db68854976ea2aaf /drivers/video
parentfe6a466283cf1ced93360bd5f5055d6543021a6a (diff)
OMAPFB: clear framebuffers with CPU
Currently vram.c clears the allocated memory automatically using OMAP system DMA. In an effort to reduce OMAP dependencies, we'll do the memory clear with CPU from now on. This patch implements clearing of the framebuffer in omapfb, using cfb_fillrect() to do the actual clear. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index fc671d3d8004..7afdfcf3bac8 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1592,6 +1592,20 @@ static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev)
1592 return 0; 1592 return 0;
1593} 1593}
1594 1594
1595static void omapfb_clear_fb(struct fb_info *fbi)
1596{
1597 const struct fb_fillrect rect = {
1598 .dx = 0,
1599 .dy = 0,
1600 .width = fbi->var.xres_virtual,
1601 .height = fbi->var.yres_virtual,
1602 .color = 0,
1603 .rop = ROP_COPY,
1604 };
1605
1606 cfb_fillrect(fbi, &rect);
1607}
1608
1595int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) 1609int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
1596{ 1610{
1597 struct omapfb_info *ofbi = FB2OFB(fbi); 1611 struct omapfb_info *ofbi = FB2OFB(fbi);
@@ -1661,6 +1675,8 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type)
1661 goto err; 1675 goto err;
1662 } 1676 }
1663 1677
1678 omapfb_clear_fb(fbi);
1679
1664 return 0; 1680 return 0;
1665err: 1681err:
1666 omapfb_free_fbmem(fbi); 1682 omapfb_free_fbmem(fbi);
@@ -1972,6 +1988,16 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
1972 } 1988 }
1973 } 1989 }
1974 1990
1991 for (i = 0; i < fbdev->num_fbs; i++) {
1992 struct fb_info *fbi = fbdev->fbs[i];
1993 struct omapfb_info *ofbi = FB2OFB(fbi);
1994
1995 if (ofbi->region->size == 0)
1996 continue;
1997
1998 omapfb_clear_fb(fbi);
1999 }
2000
1975 /* Enable fb0 */ 2001 /* Enable fb0 */
1976 if (fbdev->num_fbs > 0) { 2002 if (fbdev->num_fbs > 0) {
1977 struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]); 2003 struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]);