diff options
author | Sumit Semwal <sumit.semwal@ti.com> | 2012-06-14 09:37:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-25 14:10:36 -0500 |
commit | 051c7788bcb92f2e98ef86e86651e0420765b121 (patch) | |
tree | 4ebf8044c62975ff4a0613fcf8ec1aca84910a97 /include/uapi/linux | |
parent | 1323024fd3296537dd34da70fe70b4df12a308ec (diff) |
[media] v4l: Add DMABUF as a memory type
Adds DMABUF memory type to v4l framework. Also adds the related file
descriptor in v4l2_plane and v4l2_buffer.
[original work in the PoC for buffer sharing]
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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/linux')
-rw-r--r-- | include/uapi/linux/videodev2.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 2fff7ff3e05b..91ac83b21c20 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; |