Re: [PATCH] V4L: soc-camera: Add support for custom host mmap

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

 



On Tue, 8 Mar 2011, Sergio Aguirre wrote:

> Hi Guennadi,
> 
> On 03/08/2011 01:17 AM, Guennadi Liakhovetski wrote:
> > Hi Sergio
> > 
> > On Mon, 7 Mar 2011, Sergio Aguirre wrote:
> > 
> > > This helps redirect mmap calls to custom memory managers which
> > > already have preallocated space to use by the device.
> > > 
> > > Otherwise, device might not support the allocation attempted
> > > generically by videobuf.
> > > 
> > > Signed-off-by: Sergio Aguirre<saaguirre@xxxxxx>
> > > ---
> > >   drivers/media/video/soc_camera.c |    7 ++++++-
> > >   include/media/soc_camera.h       |    2 ++
> > >   2 files changed, 8 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/drivers/media/video/soc_camera.c
> > > b/drivers/media/video/soc_camera.c
> > > index 59dc71d..d361ba0 100644
> > > --- a/drivers/media/video/soc_camera.c
> > > +++ b/drivers/media/video/soc_camera.c

[snip]

> > > +	if (ici->ops->mmap)
> > > +		err = ici->ops->mmap(&icd->vb_vidq, icd, vma);
> > > +	else
> > > +		err = videobuf_mmap_mapper(&icd->vb_vidq, vma);
> > 
> > You're patching an old version of soc-camera. Please use a current one
> > with support for videobuf2. Further, wouldn't it be possible for you to
> > just replace the videobuf mmap_mapper() (videobuf2 q->mem_ops->mmap())
> > method? I am not sure how possible this is, maybe one of videobuf2 experts
> > could help us? BTW, you really should be using the videobuf2 API.

I looked a bit more at videobuf2. Wouldn't it satisfy your needs if you 
just provide an own struct vb2_mem_ops, copy all its fields from your 
required memory allocator, and only replace the .mmap method? Please, try, 
if this would work for you. Then you won't need any changes to 
soc_camera.c

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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