History

[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]

Sumit Semwal committed 14 years ago

Commit 051c7781 parent 13230243 files · +26 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/videodev2.h+7−0
@@ -186,6 +186,7 @@ enum v4l2_memory { · 185 unmodified lines
186186 V4L2_MEMORY_MMAP = 1,
187187 V4L2_MEMORY_USERPTR = 2,
188188 V4L2_MEMORY_OVERLAY = 3,
189+ V4L2_MEMORY_DMABUF = 4,
189190 };
190191
191192 /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
@@ -602,6 +603,8 @@ struct v4l2_requestbuffers { · 410 unmodified lines
602603 * should be passed to mmap() called on the video node)
603604 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
604605 * pointing to this plane
606+ * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
607+ * descriptor associated with this plane
605608 * @data_offset: offset in the plane to the start of data; usually 0,
606609 * unless there is a header in front of the data
607610 *
@@ -616,6 +619,7 @@ struct v4l2_plane { · 8 unmodified lines
616619 union {
617620 __u32 mem_offset;
618621 unsigned long userptr;
622+ __s32 fd;
619623 } m;
620624 __u32 data_offset;
621625 __u32 reserved[11];
@@ -640,6 +644,8 @@ struct v4l2_plane { · 18 unmodified lines
640644 * (or a "cookie" that should be passed to mmap() as offset)
641645 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
642646 * 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
643649 * @planes: for multiplanar buffers; userspace pointer to the array of plane
644650 * info structs for this buffer
645651 * @length: size in bytes of the buffer (NOT its payload) for single-plane
@@ -666,6 +672,7 @@ struct v4l2_buffer { · 20 unmodified lines
666672 __u32 offset;
667673 unsigned long userptr;
668674 struct v4l2_plane *planes;
675+ __s32 fd;
669676 } m;
670677 __u32 length;
671678 __u32 reserved2;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t