* [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
@ 2013-07-26 0:35 Eric Nelson
2013-07-26 4:27 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Eric Nelson @ 2013-07-26 0:35 UTC (permalink / raw)
To: u-boot
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);
fbi->fix.smem_start = (unsigned long)fbi->screen_base;
if (fbi->screen_base == 0) {
puts("Unable to allocate framebuffer memory\n");
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
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
2013-07-26 14:35 ` Eric Nelson
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-07-26 4:27 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 5+ messages in thread* [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
2013-07-26 4:27 ` Marek Vasut
@ 2013-07-26 14:35 ` Eric Nelson
2013-07-26 19:38 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Eric Nelson @ 2013-07-26 14:35 UTC (permalink / raw)
To: u-boot
Hi Marek,
On 07/25/2013 09:27 PM, Marek Vasut wrote:
> 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.
>
Did you really run across a display whose size wasn't a multiple of
32, or is this rounding just in muscle-memory for you?
Regards,
Eric
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
2013-07-26 14:35 ` Eric Nelson
@ 2013-07-26 19:38 ` Marek Vasut
2013-07-27 0:56 ` Eric Nelson
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-07-26 19:38 UTC (permalink / raw)
To: u-boot
Dear Eric Nelson,
> Hi Marek,
>
> On 07/25/2013 09:27 PM, Marek Vasut wrote:
> > 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.
>
> Did you really run across a display whose size wasn't a multiple of
> 32, or is this rounding just in muscle-memory for you?
Palm devices with PXA27x (PalmT5, PalmLD, PalmTX) had 484x324 LCDs ;-)
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] video: mxc_ipuv3: fix memory alignment of framebuffer
2013-07-26 19:38 ` Marek Vasut
@ 2013-07-27 0:56 ` Eric Nelson
0 siblings, 0 replies; 5+ messages in thread
From: Eric Nelson @ 2013-07-27 0:56 UTC (permalink / raw)
To: u-boot
On 07/26/2013 12:38 PM, Marek Vasut wrote:
> Dear Eric Nelson,
>
>>>> - 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.
>>
>> Did you really run across a display whose size wasn't a multiple of
>> 32, or is this rounding just in muscle-memory for you?
>
> Palm devices with PXA27x (PalmT5, PalmLD, PalmTX) had 484x324 LCDs ;-)
>
With as much cache-enablement as you've done lately, I have a feeling
you round up at the grocery store or pub ;)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-27 0:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-07-26 14:35 ` Eric Nelson
2013-07-26 19:38 ` Marek Vasut
2013-07-27 0:56 ` Eric Nelson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox