* pxa_camera: DMA alignment requirement
@ 2008-11-09 17:01 Robert Jarzmik
2008-11-13 10:23 ` Mike Rapoport
0 siblings, 1 reply; 5+ messages in thread
From: Robert Jarzmik @ 2008-11-09 17:01 UTC (permalink / raw)
To: video4linux-list
Hello,
In the pxa camera driver, the 3 DMA channels used are MMU page aligned. Does
somebody remember where that constraint comes from ?
I'm wondering because the planar YUV format generated is something like this for
a 640 * 480 image :
- Y plane => 640 * 480 bytes = 307200 (and this happens to be a multiple of
pagesize : 307200 = 4096 * 75)
- U plane => 640 * 480 / 2 bytes = 153600 (and this is not a multiple of 4096)
- padding to reach next page : 2048 bytes
- V plane => 153600 bytes
- padding to reach next page : 2048 bytes
This means a user space library should be kernel pagesize aware to transform the
output image. I don't really understand the necessity of page aligned DMA
channels. Would someone tell me please ?
--
Robert
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pxa_camera: DMA alignment requirement
2008-11-09 17:01 pxa_camera: DMA alignment requirement Robert Jarzmik
@ 2008-11-13 10:23 ` Mike Rapoport
2008-11-16 1:14 ` Robert Jarzmik
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2008-11-13 10:23 UTC (permalink / raw)
To: Robert Jarzmik; +Cc: video4linux-list
Robert Jarzmik wrote:
> Hello,
>
> In the pxa camera driver, the 3 DMA channels used are MMU page aligned. Does
> somebody remember where that constraint comes from ?
>
> I'm wondering because the planar YUV format generated is something like this for
> a 640 * 480 image :
> - Y plane => 640 * 480 bytes = 307200 (and this happens to be a multiple of
> pagesize : 307200 = 4096 * 75)
> - U plane => 640 * 480 / 2 bytes = 153600 (and this is not a multiple of 4096)
> - padding to reach next page : 2048 bytes
> - V plane => 153600 bytes
> - padding to reach next page : 2048 bytes
>
> This means a user space library should be kernel pagesize aware to transform the
> output image. I don't really understand the necessity of page aligned DMA
> channels. Would someone tell me please ?
As far as I remember, the buffers should be page aligned to allow overlaying of
captured data.
> --
> Robert
>
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list
>
--
Sincerely yours,
Mike.
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pxa_camera: DMA alignment requirement
2008-11-13 10:23 ` Mike Rapoport
@ 2008-11-16 1:14 ` Robert Jarzmik
2008-11-16 7:30 ` Mike Rapoport
0 siblings, 1 reply; 5+ messages in thread
From: Robert Jarzmik @ 2008-11-16 1:14 UTC (permalink / raw)
To: Mike Rapoport; +Cc: video4linux-list
Mike Rapoport <mike@compulab.co.il> writes:
> Robert Jarzmik wrote:
>> Hello,
>>
>> In the pxa camera driver, the 3 DMA channels used are MMU page aligned. Does
>> somebody remember where that constraint comes from ?
>>
>
> As far as I remember, the buffers should be page aligned to allow overlaying of
> captured data.
Ah, so that's it, thanks.
>From what I read on the PXA manual, the only constraint is 16bytes
alignement. Would you also remember who wrote the code, so that I can ask him
where he read about page alignement constraint please ?
Cheers.
--
Robert
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pxa_camera: DMA alignment requirement
2008-11-16 1:14 ` Robert Jarzmik
@ 2008-11-16 7:30 ` Mike Rapoport
2008-11-25 21:18 ` Robert Jarzmik
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2008-11-16 7:30 UTC (permalink / raw)
To: Robert Jarzmik; +Cc: video4linux-list
Robert Jarzmik wrote:
> Mike Rapoport <mike@compulab.co.il> writes:
>
>> Robert Jarzmik wrote:
>>> Hello,
>>>
>>> In the pxa camera driver, the 3 DMA channels used are MMU page aligned. Does
>>> somebody remember where that constraint comes from ?
>>>
>> As far as I remember, the buffers should be page aligned to allow overlaying of
>> captured data.
> Ah, so that's it, thanks.
>
>>From what I read on the PXA manual, the only constraint is 16bytes
> alignement. Would you also remember who wrote the code, so that I can ask him
> where he read about page alignement constraint please ?
Just by coincidence it was me :)
I used pxafb_overlay from [1], and my (mis)understanding of what it does added
the page alignment constrain. Now looking at the overlay code once more, I'm not
sure if it's necessary.
---
[1] http://www.rpsys.net/openzaurus/patches/archive/pxa27x_overlay-r8.patch
> Cheers.
>
> --
> Robert
>
--
Sincerely yours,
Mike.
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pxa_camera: DMA alignment requirement
2008-11-16 7:30 ` Mike Rapoport
@ 2008-11-25 21:18 ` Robert Jarzmik
0 siblings, 0 replies; 5+ messages in thread
From: Robert Jarzmik @ 2008-11-25 21:18 UTC (permalink / raw)
To: Mike Rapoport; +Cc: video4linux-list
Mike Rapoport <mike@compulab.co.il> writes:
>>>From what I read on the PXA manual, the only constraint is 16bytes
>> alignement. Would you also remember who wrote the code, so that I can ask him
>> where he read about page alignement constraint please ?
>
> Just by coincidence it was me :)
> I used pxafb_overlay from [1], and my (mis)understanding of what it does added
> the page alignment constrain. Now looking at the overlay code once more, I'm not
> sure if it's necessary.
>
> ---
> [1] http://www.rpsys.net/openzaurus/patches/archive/pxa27x_overlay-r8.patch
Just for the record, I made a try or two, changing the alignment from page (4096
bytes) into 16 bytes (PAGE_ALIGN -> ALIGN(x,16)). And surprise, I get a lot of
DMA bus errors ...
I'm still investigating, there's something weird in there ...
Cheers.
--
Robert
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-11-26 0:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-09 17:01 pxa_camera: DMA alignment requirement Robert Jarzmik
2008-11-13 10:23 ` Mike Rapoport
2008-11-16 1:14 ` Robert Jarzmik
2008-11-16 7:30 ` Mike Rapoport
2008-11-25 21:18 ` Robert Jarzmik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox