aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorTomasz Stanislawski <t.stanislaws@samsung.com>2012-06-14 10:32:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-25 14:20:47 -0500
commitb799d09a157da71566e8013a62073435550cab6d (patch)
tree54222407a12429a93ca5c2bff69c7b96bea493f0 /include/uapi
parentc60520fa50cd86d64bc8ebb34300ddc4ca91393d (diff)
[media] v4l: add buffer exporting via dmabuf
This patch adds extension to V4L2 api. A new ioctl VIDIOC_EXPBUF is added. The ioctl is used to export an mmap buffer as a DMABUF file descriptor. Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/videodev2.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 91ac83b21c20..3cf3e946e331 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -694,6 +694,33 @@ struct v4l2_buffer {
694#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 694#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
695#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 695#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
696 696
697/**
698 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
699 *
700 * @index: id number of the buffer
701 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
702 * multiplanar buffers);
703 * @plane: index of the plane to be exported, 0 for single plane queues
704 * @flags: flags for newly created file, currently only O_CLOEXEC is
705 * supported, refer to manual of open syscall for more details
706 * @fd: file descriptor associated with DMABUF (set by driver)
707 *
708 * Contains data used for exporting a video buffer as DMABUF file descriptor.
709 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF
710 * (identical to the cookie used to mmap() the buffer to userspace). All
711 * reserved fields must be set to zero. The field reserved0 is expected to
712 * become a structure 'type' allowing an alternative layout of the structure
713 * content. Therefore this field should not be used for any other extensions.
714 */
715struct v4l2_exportbuffer {
716 __u32 type; /* enum v4l2_buf_type */
717 __u32 index;
718 __u32 plane;
719 __u32 flags;
720 __s32 fd;
721 __u32 reserved[11];
722};
723
697/* 724/*
698 * O V E R L A Y P R E V I E W 725 * O V E R L A Y P R E V I E W
699 */ 726 */
@@ -1895,6 +1922,7 @@ struct v4l2_create_buffers {
1895#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) 1922#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1896#define VIDIOC_OVERLAY _IOW('V', 14, int) 1923#define VIDIOC_OVERLAY _IOW('V', 14, int)
1897#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) 1924#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
1925#define VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer)
1898#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) 1926#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1899#define VIDIOC_STREAMON _IOW('V', 18, int) 1927#define VIDIOC_STREAMON _IOW('V', 18, int)
1900#define VIDIOC_STREAMOFF _IOW('V', 19, int) 1928#define VIDIOC_STREAMOFF _IOW('V', 19, int)