Hello,

On Wednesday, December 01, 2010 2:37 PM Andy Walls wrote:

> On Tue, 2010-11-30 at 21:57 +0100, Laurent Pinchart wrote:
> > Hi Marek,
> >
> > On Tuesday 30 November 2010 11:39:41 Marek Szyprowski wrote:
> > > On Monday, November 29, 2010 10:51 AM Laurent Pinchart wrote:
> > > > On Friday 19 November 2010 16:55:40 Marek Szyprowski wrote:
> > > > > From: Pawel Osciak <p.osc...@samsung.com>
> > > > >
> > > > > Add an implementation of contiguous virtual memory allocator and
> > > > > handling routines for videobuf2, implemented on top of
> > > > > vmalloc()/vfree() calls.
> > > > >
> > > > > Signed-off-by: Pawel Osciak <p.osc...@samsung.com>
> > > > > Signed-off-by: Kyungmin Park <kyungmin.p...@samsung.com>
> > > > > Signed-off-by: Marek Szyprowski <m.szyprow...@samsung.com>
> > > > > CC: Pawel Osciak <pa...@osciak.com>
> >
> > [snip]
> >
> > > > > +static void *vb2_vmalloc_alloc(const struct vb2_alloc_ctx *alloc_ctx,
> > > > > +                             unsigned long size)
> > > > > +{
> > > > > +     struct vb2_vmalloc_buf *buf;
> > > > > +
> > > > > +     buf = kzalloc(sizeof *buf, GFP_KERNEL);
> > > > > +     if (!buf)
> > > > > +             return NULL;
> > > > > +
> > > > > +     buf->size = size;
> > > > > +     buf->vaddr = vmalloc_user(buf->size);
> > > >
> > > > Some drivers might need vmalloc_32_user instead.
> > >
> > > Which driver might require this? I'm quite surprised.
> 
> I don't think this a driver issue, but a hardware issue.
> 
> Legacy PCI address space is 32 bits.  DMA engines on Legacy PCI cards
> can't access addresses larger than 2^32.  A hardware IOMMU or the
> SWIOTLB software IOMMU in the kernel is needed for these devices to
> write to physical memory addresses above 2^32.

Ok. I see. vmalloc-based allocator is designed for simple drivers that need
to use cpu to copy video data anyway. For drivers that have more requirements,
I plan to provide dma-sg allocator, which will provide much more detailed
control on the way the pages are allocated. Expect new version of videobuf2
in next few days.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to