#include <linux/device.h>
#include <linux/err.h>
#include <linux/freezer.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fh.h>
#include <media/videobuf2-v4l2.h>
static int debug;
module_param(debug, int, 0644);
#define dprintk(q, level, fmt, arg...) …
#define V4L2_BUFFER_MASK_FLAGS …
#define V4L2_BUFFER_OUT_FLAGS …
static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer *b)
{ … }
static int __verify_planes_array_core(struct vb2_buffer *vb, const void *pb)
{ … }
static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b)
{ … }
static void __init_vb2_v4l2_buffer(struct vb2_buffer *vb)
{ … }
static void __copy_timestamp(struct vb2_buffer *vb, const void *pb)
{
const struct v4l2_buffer *b = pb;
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
struct vb2_queue *q = vb->vb2_queue;
if (q->is_output) {
if (q->copy_timestamp)
vb->timestamp = v4l2_buffer_get_timestamp(b);
vbuf->flags |= b->flags & V4L2_BUF_FLAG_TIMECODE;
if (b->flags & V4L2_BUF_FLAG_TIMECODE)
vbuf->timecode = b->timecode;
}
};
static void vb2_warn_zero_bytesused(struct vb2_buffer *vb)
{ … }
static int vb2_fill_vb2_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b)
{ … }
static void set_buffer_cache_hints(struct vb2_queue *q,
struct vb2_buffer *vb,
struct v4l2_buffer *b)
{ … }
static int vb2_queue_or_prepare_buf(struct vb2_queue *q, struct media_device *mdev,
struct vb2_buffer *vb, struct v4l2_buffer *b,
bool is_prepare, struct media_request **p_req)
{ … }
static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
{ … }
static int __fill_vb2_buffer(struct vb2_buffer *vb, struct vb2_plane *planes)
{ … }
static const struct vb2_buf_ops v4l2_buf_ops = …;
struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, u64 timestamp)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b)
{ … }
EXPORT_SYMBOL(…);
static void vb2_set_flags_and_caps(struct vb2_queue *q, u32 memory,
u32 *flags, u32 *caps, u32 *max_num_bufs)
{ … }
int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_prepare_buf(struct vb2_queue *q, struct media_device *mdev,
struct v4l2_buffer *b)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
struct v4l2_buffer *b)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_queue_init_name(struct vb2_queue *q, const char *name)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_queue_init(struct vb2_queue *q)
{ … }
EXPORT_SYMBOL_GPL(…);
void vb2_queue_release(struct vb2_queue *q)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_queue_change_type(struct vb2_queue *q, unsigned int type)
{ … }
EXPORT_SYMBOL_GPL(…);
__poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_remove_bufs(struct file *file, void *priv,
struct v4l2_remove_buffers *d)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_create_bufs(struct file *file, void *priv,
struct v4l2_create_buffers *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_prepare_buf(struct file *file, void *priv,
struct v4l2_buffer *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_qbuf(struct file *file, void *priv, struct v4l2_buffer *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_ioctl_expbuf(struct file *file, void *priv, struct v4l2_exportbuffer *p)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma)
{ … }
EXPORT_SYMBOL_GPL(…);
int _vb2_fop_release(struct file *file, struct mutex *lock)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_fop_release(struct file *file)
{ … }
EXPORT_SYMBOL_GPL(…);
ssize_t vb2_fop_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
EXPORT_SYMBOL_GPL(…);
ssize_t vb2_fop_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
EXPORT_SYMBOL_GPL(…);
__poll_t vb2_fop_poll(struct file *file, poll_table *wait)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifndef CONFIG_MMU
unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct video_device *vdev = video_devdata(file);
return vb2_get_unmapped_area(vdev->queue, addr, len, pgoff, flags);
}
EXPORT_SYMBOL_GPL(vb2_fop_get_unmapped_area);
#endif
void vb2_video_unregister_device(struct video_device *vdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void vb2_ops_wait_prepare(struct vb2_queue *vq)
{ … }
EXPORT_SYMBOL_GPL(…);
void vb2_ops_wait_finish(struct vb2_queue *vq)
{ … }
EXPORT_SYMBOL_GPL(…);
int vb2_request_validate(struct media_request *req)
{ … }
EXPORT_SYMBOL_GPL(…);
void vb2_request_queue(struct media_request *req)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;