Skip to contentSkip to conversation

mxc_ipuv3: fix memory alignment of framebuffer

PATCH New Eric Nelson 2 participants 2 messages Jul 27, 2013 – Jul 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mxc_ipuv3: fix memory alignment of framebuffer

The frame-buffer on i.MX boards needs to be aligned for DMA.

---
Changes in v2: Also round smem_len up to ARCH_DMA_MINALIGN

 drivers/video/mxc_ipuv3_fb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/video/mxc_ipuv3_fb.c +3 -2
index ace226c..d922d5d 100644
@@ -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");
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 mxc_ipuv3: fix memory alignment of framebuffer

Quoted 4 lines · Eric Nelson

The frame-buffer on i.MX boards needs to be aligned for DMA.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================