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 <[email protected]>
> > >
> > > 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 <[email protected]>
> > > Signed-off-by: Kyungmin Park <[email protected]>
> > > Signed-off-by: Marek Szyprowski <[email protected]>
> > > CC: Pawel Osciak <[email protected]>
[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 thought that
> vmalloced memory buffers are used only by the drivers that need to copy
> video data with CPU anyway.
The OMAP3 ISP driver uses vmalloc_32_user to allocate memory for the MMAP
method and then maps it to the device address space through the IOMMU. I'm not
sure that's the best solution, but that's how it works now.
--
Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html