summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2013-07-26 17:53:45 -0700
committerLiu Ying <Ying.Liu@freescale.com>2013-11-22 17:28:29 +0800
commit2fc792aa210e802a6ca59f923b71eb02f3f43717 (patch)
treedc8d7a0a41e0d7197bfdbb50f902f8e089d44d77
parent7d765929153595578db47d5d21ff66e9cd5bc5c6 (diff)
downloadu-boot-imx-2fc792aa210e802a6ca59f923b71eb02f3f43717.zip
u-boot-imx-2fc792aa210e802a6ca59f923b71eb02f3f43717.tar.gz
u-boot-imx-2fc792aa210e802a6ca59f923b71eb02f3f43717.tar.bz2
mxc_ipuv3: fix memory alignment of framebuffer
The frame-buffer on i.MX boards needs to be aligned for DMA. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> (cherry picked from commit 4acb4d391f005c0c72f7b84041b3884e4260a5a4) Signed-off-by: Jason Liu <r64343@freescale.com> (cherry picked from commit 1e73790043576a43e45ef3899845cfa71b7ccd5c)
-rw-r--r--drivers/video/mxc_ipuv3_fb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
index ace226c..d922d5d 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc_ipuv3_fb.c
@@ -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");