Re: [PATCH 3/7] v4l: videobuf2: add vmalloc allocator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.osciak@xxxxxxxxxxx>
> > > 
> > > 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.osciak@xxxxxxxxxxx>
> > > Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> > > Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
> > > CC: Pawel Osciak <pawel@xxxxxxxxxx>

[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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux