* omap3isp buffer alignment
@ 2011-08-11 9:57 Michael Jones
2011-08-11 21:21 ` Sakari Ailus
0 siblings, 1 reply; 3+ messages in thread
From: Michael Jones @ 2011-08-11 9:57 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Linux Media Mailing List
Hi Laurent,
If I understood your discussion with Russell [1] correctly, user pointer
buffers are required to be page-aligned because of the IOMMU API, and
it's desirable to keep the IOMMU driver that way for other subsystems
which may use it. So we're stuck with user buffers needing to be
page-aligned.
There's a check in ispvideo.c:isp_video_buffer_prepare() that the buffer
address is 32-byte aligned. Isn't this superfluous considering the
page-aligned restriction?
-Michael
[1]
http://www.mail-archive.com/linux-omap%40vger.kernel.org/msg50611.html
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: omap3isp buffer alignment
2011-08-11 9:57 omap3isp buffer alignment Michael Jones
@ 2011-08-11 21:21 ` Sakari Ailus
2011-08-12 9:28 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2011-08-11 21:21 UTC (permalink / raw)
To: Michael Jones; +Cc: Laurent Pinchart, Linux Media Mailing List
On Thu, Aug 11, 2011 at 11:57:04AM +0200, Michael Jones wrote:
> Hi Laurent,
>
> If I understood your discussion with Russell [1] correctly, user pointer
> buffers are required to be page-aligned because of the IOMMU API, and
> it's desirable to keep the IOMMU driver that way for other subsystems
> which may use it. So we're stuck with user buffers needing to be
> page-aligned.
My understanding is that this is actually a hardware requirement. You only
can map pages of 4 kiB (at least).
> There's a check in ispvideo.c:isp_video_buffer_prepare() that the buffer
> address is 32-byte aligned. Isn't this superfluous considering the
> page-aligned restriction?
I guess the ISP driver isn't assuming that ispmmu_vmap always give page
aligned mappings --- or that the page size couls theoretically be smaller.
The assumptions might not hold in another implementation of the IOMMU API,
which however will be replaced (hopefully at some point) by the improved DMA
mapping API.
Cheers,
--
Sakari Ailus
sakari.ailus@iki.fi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: omap3isp buffer alignment
2011-08-11 21:21 ` Sakari Ailus
@ 2011-08-12 9:28 ` Laurent Pinchart
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2011-08-12 9:28 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Michael Jones, Linux Media Mailing List
On Thursday 11 August 2011 23:21:45 Sakari Ailus wrote:
> On Thu, Aug 11, 2011 at 11:57:04AM +0200, Michael Jones wrote:
> > Hi Laurent,
> >
> > If I understood your discussion with Russell [1] correctly, user pointer
> > buffers are required to be page-aligned because of the IOMMU API, and
> > it's desirable to keep the IOMMU driver that way for other subsystems
> > which may use it. So we're stuck with user buffers needing to be
> > page-aligned.
>
> My understanding is that this is actually a hardware requirement. You only
> can map pages of 4 kiB (at least).
The IOMMU works on a 4kiB page granularity, but that doesn't require buffers
to be page-aligned. If the buffer start address isn't aligned on a page
boundary the IOMMU can map the whole page, and the driver can then just add an
offset to the virtual address.
> > There's a check in ispvideo.c:isp_video_buffer_prepare() that the buffer
> > address is 32-byte aligned. Isn't this superfluous considering the
> > page-aligned restriction?
>
> I guess the ISP driver isn't assuming that ispmmu_vmap always give page
> aligned mappings --- or that the page size couls theoretically be smaller.
> The assumptions might not hold in another implementation of the IOMMU API,
> which however will be replaced (hopefully at some point) by the improved
> DMA mapping API.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-12 9:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 9:57 omap3isp buffer alignment Michael Jones
2011-08-11 21:21 ` Sakari Ailus
2011-08-12 9:28 ` Laurent Pinchart
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.