Hi Hans, On Thu, Nov 18, 2010 at 01:17, Hans Verkuil <hverkuil@xxxxxxxxx> wrote: > Hi Marek! > > Some comments below... > > On Wednesday, November 17, 2010 09:39:28 Marek Szyprowski wrote: >> From: Pawel Osciak <p.osciak@xxxxxxxxxxx> >> +/** >> + * struct vb2_mem_ops - memory handling/memory allocator operations >> + * @alloc: allocate video memory and, optionally, allocator private data, >> + * return NULL on failure or a pointer to allocator private, >> + * per-buffer data on success, NULL on failure; the returned >> + * private structure will then be passed as buf_priv argument >> + * to other ops in this structure >> + * @put: inform the allocator that the buffer will no longer be used; >> + * usually will result in the allocator freeing the buffer (if >> + * no other users of this buffer are present); the buf_priv >> + * argument is the allocator private per-buffer structure >> + * previously returned from the alloc callback >> + * @get_userptr: acquire userspace memory for a hardware operation; used for >> + * USERPTR memory types; vaddr is the address passed to the >> + * videobuf layer when queuing a video buffer of USERPTR type; >> + * should return an allocator private per-buffer structure >> + * associated with the buffer on success, NULL on failure; >> + * the returned private structure will then be passed as buf_priv >> + * argument to other ops in this structure >> + * @put_userptr: inform the allocator that a USERPTR buffer will no longer >> + * be used > > 'get' and 'put' imply reference counting. However, I don't believe that's the > case for USERPTR. If I am right, then I would like to see different names for > these callbacks. Actually, they are intended for reference counting. The idea is to allow using the same memory for creating pipelines. Please take a look at the second patch in the series, generic implementations of get() and put() are in there. -- Best regards, Pawel Osciak -- 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