All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
Date: Fri, 26 Jul 2013 06:27:10 +0200	[thread overview]
Message-ID: <201307260627.10732.marex@denx.de> (raw)
In-Reply-To: <1374798926-18743-1-git-send-email-eric.nelson@boundarydevices.com>

Dear Eric Nelson,

> 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
> index ace226c..ad95831 100644
> --- a/drivers/video/mxc_ipuv3_fb.c
> +++ b/drivers/video/mxc_ipuv3_fb.c
> @@ -416,7 +416,8 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
>  				    fbi->fix.line_length;
>  	}
> 
> -	fbi->screen_base = (char *)malloc(fbi->fix.smem_len);
> +	fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN,
> +					    fbi->fix.smem_len);

You might want to round-up the length too, like I did in the MXS driver.

>  	fbi->fix.smem_start = (unsigned long)fbi->screen_base;
>  	if (fbi->screen_base == 0) {
>  		puts("Unable to allocate framebuffer memory\n");

Best regards,
Marek Vasut

  reply	other threads:[~2013-07-26  4:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26  0:35 [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer Eric Nelson
2013-07-26  4:27 ` Marek Vasut [this message]
2013-07-26 14:35   ` Eric Nelson
2013-07-26 19:38     ` Marek Vasut
2013-07-27  0:56       ` Eric Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201307260627.10732.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.