aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 22:22:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 22:22:22 -0500
commitd8c532c40721f7507896d202b8cae3b3642d2b0d (patch)
tree42b1ce76671eb85324281ed93491432f4523f983 /include/uapi
parente777d192ffb9f2929d547a2f8a5f65b7db7a9552 (diff)
parent77c53d0b56264a8fc5844e087ad15fffe20c299d (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - Missing MAINTAINERS entries were added for several drivers - Adds V4L2 support for DMABUF handling, allowing zero-copy buffer sharing between V4L2 devices and GPU - Got rid of all warnings when compiling with W=1 on x86 - Add a new driver for Exynos hardware (s3c-camif) - Several bug fixes, cleanups and driver improvements * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (243 commits) [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check [media] omap3isp: Prepare/unprepare clocks before/after enable/disable [media] omap3isp: preview: Add support for 8-bit formats at the sink pad [media] omap3isp: Replace printk with dev_* [media] omap3isp: Find source pad from external entity [media] omap3isp: Configure CSI-2 phy based on platform data [media] omap3isp: Add PHY routing configuration [media] omap3isp: Add CSI configuration registers from control block to ISP resources [media] omap3isp: Remove unneeded module memory address definitions [media] omap3isp: Use monotonic timestamps for statistics buffers [media] uvcvideo: Fix control value clamping for unsigned integer controls [media] uvcvideo: Mark first output terminal as default video node [media] uvcvideo: Add VIDIOC_[GS]_PRIORITY support [media] uvcvideo: Return -ENOTTY for unsupported ioctls [media] uvcvideo: Set device_caps in VIDIOC_QUERYCAP [media] uvcvideo: Don't fail when an unsupported format is requested [media] uvcvideo: Return -EACCES when trying to access a read/write-only control [media] uvcvideo: Set error_idx properly for extended controls API failures [media] rtl28xxu: add NOXON DAB/DAB+ USB dongle rev 2 [media] fc2580: write some registers conditionally ...
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/videodev2.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 57bfa59cda74..3cf3e946e331 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -186,6 +186,7 @@ enum v4l2_memory {
186 V4L2_MEMORY_MMAP = 1, 186 V4L2_MEMORY_MMAP = 1,
187 V4L2_MEMORY_USERPTR = 2, 187 V4L2_MEMORY_USERPTR = 2,
188 V4L2_MEMORY_OVERLAY = 3, 188 V4L2_MEMORY_OVERLAY = 3,
189 V4L2_MEMORY_DMABUF = 4,
189}; 190};
190 191
191/* see also http://vektor.theorem.ca/graphics/ycbcr/ */ 192/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
@@ -602,6 +603,8 @@ struct v4l2_requestbuffers {
602 * should be passed to mmap() called on the video node) 603 * should be passed to mmap() called on the video node)
603 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer 604 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
604 * pointing to this plane 605 * pointing to this plane
606 * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
607 * descriptor associated with this plane
605 * @data_offset: offset in the plane to the start of data; usually 0, 608 * @data_offset: offset in the plane to the start of data; usually 0,
606 * unless there is a header in front of the data 609 * unless there is a header in front of the data
607 * 610 *
@@ -616,6 +619,7 @@ struct v4l2_plane {
616 union { 619 union {
617 __u32 mem_offset; 620 __u32 mem_offset;
618 unsigned long userptr; 621 unsigned long userptr;
622 __s32 fd;
619 } m; 623 } m;
620 __u32 data_offset; 624 __u32 data_offset;
621 __u32 reserved[11]; 625 __u32 reserved[11];
@@ -640,6 +644,8 @@ struct v4l2_plane {
640 * (or a "cookie" that should be passed to mmap() as offset) 644 * (or a "cookie" that should be passed to mmap() as offset)
641 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; 645 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
642 * a userspace pointer pointing to this buffer 646 * a userspace pointer pointing to this buffer
647 * @fd: for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
648 * a userspace file descriptor associated with this buffer
643 * @planes: for multiplanar buffers; userspace pointer to the array of plane 649 * @planes: for multiplanar buffers; userspace pointer to the array of plane
644 * info structs for this buffer 650 * info structs for this buffer
645 * @length: size in bytes of the buffer (NOT its payload) for single-plane 651 * @length: size in bytes of the buffer (NOT its payload) for single-plane
@@ -666,6 +672,7 @@ struct v4l2_buffer {
666 __u32 offset; 672 __u32 offset;
667 unsigned long userptr; 673 unsigned long userptr;
668 struct v4l2_plane *planes; 674 struct v4l2_plane *planes;
675 __s32 fd;
669 } m; 676 } m;
670 __u32 length; 677 __u32 length;
671 __u32 reserved2; 678 __u32 reserved2;
@@ -687,6 +694,33 @@ struct v4l2_buffer {
687#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 694#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
688#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 695#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
689 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
690/* 724/*
691 * 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
692 */ 726 */
@@ -737,7 +771,7 @@ struct v4l2_window {
737struct v4l2_captureparm { 771struct v4l2_captureparm {
738 __u32 capability; /* Supported modes */ 772 __u32 capability; /* Supported modes */
739 __u32 capturemode; /* Current mode */ 773 __u32 capturemode; /* Current mode */
740 struct v4l2_fract timeperframe; /* Time per frame in .1us units */ 774 struct v4l2_fract timeperframe; /* Time per frame in seconds */
741 __u32 extendedmode; /* Driver-specific extensions */ 775 __u32 extendedmode; /* Driver-specific extensions */
742 __u32 readbuffers; /* # of buffers for read */ 776 __u32 readbuffers; /* # of buffers for read */
743 __u32 reserved[4]; 777 __u32 reserved[4];
@@ -1888,6 +1922,7 @@ struct v4l2_create_buffers {
1888#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) 1922#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1889#define VIDIOC_OVERLAY _IOW('V', 14, int) 1923#define VIDIOC_OVERLAY _IOW('V', 14, int)
1890#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)
1891#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) 1926#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1892#define VIDIOC_STREAMON _IOW('V', 18, int) 1927#define VIDIOC_STREAMON _IOW('V', 18, int)
1893#define VIDIOC_STREAMOFF _IOW('V', 19, int) 1928#define VIDIOC_STREAMOFF _IOW('V', 19, int)