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 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html