aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-common.h5
-rw-r--r--include/media/v4l2-ioctl.h17
-rw-r--r--include/media/v4l2-mem2mem.h8
-rw-r--r--include/media/videobuf2-v4l2.h9
-rw-r--r--include/uapi/linux/videodev2.h47
5 files changed, 86 insertions, 0 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index aac8b7b6e691..b10d8655cee7 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -264,4 +264,9 @@ const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
void v4l2_get_timestamp(struct timeval *tv);
+int v4l2_buffer_to_ext_buffer(const struct v4l2_buffer *b,
+ struct v4l2_ext_buffer *e);
+void v4l2_ext_buffer_to_buffer(const struct v4l2_ext_buffer *e,
+ struct v4l2_buffer *b);
+
#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index bd5312118013..4944a421074c 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -159,6 +159,14 @@ struct v4l2_fh;
* :ref:`VIDIOC_CREATE_BUFS <vidioc_create_bufs>` ioctl
* @vidioc_prepare_buf: pointer to the function that implements
* :ref:`VIDIOC_PREPARE_BUF <vidioc_prepare_buf>` ioctl
+ * @vidioc_ext_querybuf: pointer to the function that implements
+ * :ref:`VIDIOC_EXT_QUERYBUF <vidioc_querybuf>` ioctl
+ * @vidioc_ext_qbuf: pointer to the function that implements
+ * :ref:`VIDIOC_EXT_QBUF <vidioc_qbuf>` ioctl
+ * @vidioc_ext_dqbuf: pointer to the function that implements
+ * :ref:`VIDIOC_EXT_DQBUF <vidioc_qbuf>` ioctl
+ * @vidioc_ext_prepare_buf: pointer to the function that implements
+ * :ref:`VIDIOC_EXT_PREPARE_BUF <vidioc_prepare_buf>` ioctl
* @vidioc_overlay: pointer to the function that implements
* :ref:`VIDIOC_OVERLAY <vidioc_overlay>` ioctl
* @vidioc_g_fbuf: pointer to the function that implements
@@ -419,6 +427,15 @@ struct v4l2_ioctl_ops {
int (*vidioc_prepare_buf)(struct file *file, void *fh,
struct v4l2_buffer *b);
+ int (*vidioc_ext_querybuf)(struct file *file, void *fh,
+ struct v4l2_ext_buffer *b);
+ int (*vidioc_ext_qbuf)(struct file *file, void *fh,
+ struct v4l2_ext_buffer *b);
+ int (*vidioc_ext_dqbuf)(struct file *file, void *fh,
+ struct v4l2_ext_buffer *b);
+ int (*vidioc_ext_prepare_buf)(struct file *file, void *fh,
+ struct v4l2_ext_buffer *b);
+
int (*vidioc_overlay)(struct file *file, void *fh, unsigned int i);
int (*vidioc_g_fbuf)(struct file *file, void *fh,
struct v4l2_framebuffer *a);
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index e157d5c9b224..bff83873aa1a 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -588,14 +588,22 @@ int v4l2_m2m_ioctl_create_bufs(struct file *file, void *fh,
struct v4l2_create_buffers *create);
int v4l2_m2m_ioctl_querybuf(struct file *file, void *fh,
struct v4l2_buffer *buf);
+int v4l2_m2m_ioctl_ext_querybuf(struct file *file, void *fh,
+ struct v4l2_ext_buffer *buf);
int v4l2_m2m_ioctl_expbuf(struct file *file, void *fh,
struct v4l2_exportbuffer *eb);
int v4l2_m2m_ioctl_qbuf(struct file *file, void *fh,
struct v4l2_buffer *buf);
+int v4l2_m2m_ioctl_ext_qbuf(struct file *file, void *fh,
+ struct v4l2_ext_buffer *buf);
int v4l2_m2m_ioctl_dqbuf(struct file *file, void *fh,
struct v4l2_buffer *buf);
+int v4l2_m2m_ioctl_ext_dqbuf(struct file *file, void *fh,
+ struct v4l2_ext_buffer *buf);
int v4l2_m2m_ioctl_prepare_buf(struct file *file, void *fh,
struct v4l2_buffer *buf);
+int v4l2_m2m_ioctl_ext_prepare_buf(struct file *file, void *fh,
+ struct v4l2_ext_buffer *buf);
int v4l2_m2m_ioctl_streamon(struct file *file, void *fh,
enum v4l2_buf_type type);
int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh,
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 036127c54bbf..e9ea84c65406 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -51,6 +51,7 @@ struct vb2_v4l2_buffer {
container_of(vb, struct vb2_v4l2_buffer, vb2_buf)
int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
+int vb2_ext_querybuf(struct vb2_queue *q, struct v4l2_ext_buffer *b);
/**
* vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies
@@ -90,6 +91,7 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create);
* from vidioc_prepare_buf handler in driver.
*/
int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b);
+int vb2_ext_prepare_buf(struct vb2_queue *q, struct v4l2_ext_buffer *b);
/**
* vb2_qbuf() - Queue a buffer from userspace
@@ -111,6 +113,7 @@ int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b);
* from VIDIOC_QBUF() handler in driver.
*/
int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b);
+int vb2_ext_qbuf(struct vb2_queue *q, struct v4l2_ext_buffer *b);
/**
* vb2_expbuf() - Export a buffer as a file descriptor
@@ -147,6 +150,7 @@ int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb);
* from VIDIOC_DQBUF() handler in driver.
*/
int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking);
+int vb2_ext_dqbuf(struct vb2_queue *q, struct v4l2_ext_buffer *b, bool nonblocking);
/**
* vb2_streamon - start streaming
@@ -245,9 +249,14 @@ int vb2_ioctl_create_bufs(struct file *file, void *priv,
struct v4l2_create_buffers *p);
int vb2_ioctl_prepare_buf(struct file *file, void *priv,
struct v4l2_buffer *p);
+int vb2_ioctl_ext_prepare_buf(struct file *file, void *priv,
+ struct v4l2_ext_buffer *p);
int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p);
+int vb2_ioctl_ext_querybuf(struct file *file, void *priv, struct v4l2_ext_buffer *p);
int vb2_ioctl_qbuf(struct file *file, void *priv, struct v4l2_buffer *p);
+int vb2_ioctl_ext_qbuf(struct file *file, void *priv, struct v4l2_ext_buffer *p);
int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p);
+int vb2_ioctl_ext_dqbuf(struct file *file, void *priv, struct v4l2_ext_buffer *p);
int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i);
int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i);
int vb2_ioctl_expbuf(struct file *file, void *priv,
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 185d6a0acc06..908eeaa66c7a 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -875,6 +875,18 @@ struct v4l2_plane {
__u32 reserved[11];
};
+struct v4l2_ext_plane {
+ __u32 bytesused;
+ __u32 length;
+ union {
+ __u32 mem_offset;
+ __u64 userptr;
+ __s32 fd;
+ } m;
+ __u32 data_offset;
+ __u32 reserved[11];
+};
+
/**
* struct v4l2_buffer - video buffer info
* @index: id number of the buffer
@@ -928,6 +940,36 @@ struct v4l2_buffer {
__u32 reserved;
};
+/**
+ * struct v4l2_ext_buffer - video buffer info
+ * @index: id number of the buffer
+ * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
+ * multiplanar buffers);
+ * @flags: buffer informational flags
+ * @field: enum v4l2_field; field order of the image in the buffer
+ * @timestamp: frame timestamp
+ * @sequence: sequence count of this frame
+ * @memory: enum v4l2_memory; the method, in which the actual video data is
+ * passed
+ * @planes: per-plane buffer information
+ * @num_planes: number of plane buffers
+ *
+ * Contains data exchanged by application and driver using one of the Streaming
+ * I/O methods.
+ */
+struct v4l2_ext_buffer {
+ __u32 index;
+ __u32 type;
+ __u32 flags;
+ __u32 field;
+ __u64 timestamp;
+ __u32 sequence;
+ __u32 memory;
+ struct v4l2_ext_plane planes[VIDEO_MAX_PLANES];
+ __u32 num_planes;
+ __u32 reserved[11];
+};
+
/* Flags for 'flags' field */
/* Buffer is mapped (flag) */
#define V4L2_BUF_FLAG_MAPPED 0x00000001
@@ -2397,6 +2439,11 @@ struct v4l2_create_buffers {
#define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
+#define VIDIOC_EXT_QUERYBUF _IOWR('V', 104, struct v4l2_ext_buffer)
+#define VIDIOC_EXT_QBUF _IOWR('V', 105, struct v4l2_ext_buffer)
+#define VIDIOC_EXT_DQBUF _IOWR('V', 106, struct v4l2_ext_buffer)
+#define VIDIOC_EXT_PREPARE_BUF _IOWR('V', 107, struct v4l2_ext_buffer)
+
/* Reminder: when adding new ioctls please add support for them to
drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */

Privacy Policy