From patchwork Sat Jul 27 00:53:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 262366 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DAE612C00D5 for ; Sat, 27 Jul 2013 10:54:10 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0AFD34A019; Sat, 27 Jul 2013 02:54:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sHEyFhnuUhAW; Sat, 27 Jul 2013 02:54:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CCD504A01B; Sat, 27 Jul 2013 02:54:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41A534A01B for ; Sat, 27 Jul 2013 02:54:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xI-naVgUYQ5V for ; Sat, 27 Jul 2013 02:54:00 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.integraonline.com (relay1.integra.net [204.130.255.180]) by theia.denx.de (Postfix) with SMTP id 3CD0E4A019 for ; Sat, 27 Jul 2013 02:53:53 +0200 (CEST) Received: (qmail 17364 invoked from network); 27 Jul 2013 00:53:48 -0000 Received: from unknown (HELO localhost.localdomain) (70.96.116.236) by relay1.integra.net with SMTP; 27 Jul 2013 00:53:48 -0000 From: Eric Nelson To: u-boot@lists.denx.de Date: Fri, 26 Jul 2013 17:53:45 -0700 Message-Id: <1374886425-11512-1-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 Cc: fabio.estevam@freescale.com Subject: [U-Boot] [PATCH v2] mxc_ipuv3: fix memory alignment of framebuffer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The frame-buffer on i.MX boards needs to be aligned for DMA. Signed-off-by: Eric Nelson --- 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(-) 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");