]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mxc_ipuv3: fix memory alignment of framebuffer
authorEric Nelson <eric.nelson@boundarydevices.com>
Sat, 27 Jul 2013 00:53:45 +0000 (17:53 -0700)
committerStefano Babic <sbabic@denx.de>
Mon, 29 Jul 2013 10:17:32 +0000 (12:17 +0200)
The frame-buffer on i.MX boards needs to be aligned for DMA.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
drivers/video/mxc_ipuv3_fb.c

index ace226cececfa72a1202d24a67e49ed8e7507156..d922d5d099a170fda5d1aac021d1b94fa0a0c414 100644 (file)
@@ -415,8 +415,9 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
                fbi->fix.smem_len = fbi->var.yres_virtual *
                                    fbi->fix.line_length;
        }
-
-       fbi->screen_base = (char *)malloc(fbi->fix.smem_len);
+       fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN);
+       fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN,
+                                           fbi->fix.smem_len);
        fbi->fix.smem_start = (unsigned long)fbi->screen_base;
        if (fbi->screen_base == 0) {
                puts("Unable to allocate framebuffer memory\n");