Linux Kernel
3.7.1
|
#include <videobuf2-core.h>
Data Fields | |
void *(* | alloc )(void *alloc_ctx, unsigned long size) |
void(* | put )(void *buf_priv) |
void *(* | get_userptr )(void *alloc_ctx, unsigned long vaddr, unsigned long size, int write) |
void(* | put_userptr )(void *buf_priv) |
void *(* | vaddr )(void *buf_priv) |
void *(* | cookie )(void *buf_priv) |
unsigned int(* | num_users )(void *buf_priv) |
int(* | mmap )(void *buf_priv, struct vm_area_struct *vma) |
struct vb2_mem_ops - memory handling/memory allocator operations : allocate video memory and, optionally, allocator private data, return NULL on failure or a pointer to allocator private, per-buffer data on success; the returned private structure will then be passed as buf_priv argument to other ops in this structure : 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 : 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 : inform the allocator that a USERPTR buffer will no longer be used : return a kernel virtual address to a given memory buffer associated with the passed private structure or NULL if no such mapping exists : return allocator specific cookie for a given memory buffer associated with the passed private structure or NULL if not available : return the current number of users of a memory buffer; return 1 if the videobuf layer (or actually the driver using it) is the only user : setup a userspace mapping for a given memory buffer under the provided virtual memory region
Required ops for USERPTR types: get_userptr, put_userptr. Required ops for MMAP types: alloc, put, num_users, mmap. Required ops for read/write access types: alloc, put, num_users, vaddr
Definition at line 60 of file videobuf2-core.h.
Definition at line 69 of file videobuf2-core.h.
Definition at line 64 of file videobuf2-core.h.
int(* mmap)(void *buf_priv, struct vm_area_struct *vma) |
Definition at line 73 of file videobuf2-core.h.
Definition at line 71 of file videobuf2-core.h.
Definition at line 62 of file videobuf2-core.h.
Definition at line 66 of file videobuf2-core.h.
Definition at line 68 of file videobuf2-core.h.