On Wed, May 15, 2013 at 4:10 PM, Chetan Nanda <chetannanda@xxxxxxxxx> wrote: > Hi, > > I am new to V4L2 kernel framework. And currently trying to understand V4L2 > kernel sub-system. > In videobuf2 sub-system, before calling 'vb2_queue_init(q)', q's mem_ops is > being initialized (depending on type of buffer) as > > q->mem_ops = &vb2_vmalloc_memops; > or > q->mem_ops = &vb2_dma_contig_memops These are just assigning function pointers to be called when we do memory related operations. > > What is the purpose of these memory operations? > If user space is allocating the buffer (physically contiguous) via some other > kernel driver (hwmem - for android). Even then do we need to set mem_ops = > vb2_dma_contig_memops? I think what you are referring here is the ION/PMEM memory being assigned by the user space in android.If the user space is assinging the memory then VB2_MMAP | VB2_USERPTR will be used and this function pointer mentioned by you earlier would not be same but it would be ION/PMEM related callbacks. Basically in the case of userptr the OEM's have a specific way of handling contigiuos memory and is not covered by the generic VB2 code but managing those contigious memory is covered by VB2. VB2 provides all the callbacks using which you can write your own memory management code. > > > Thanks, > Chetan Nanda > -- > 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 -- 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