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
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 { · 410 unmodified lines
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 pointer604 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
604 * pointing to this plane605 * 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 data609 * unless there is a header in front of the data
607 *610 *
@@ -616,6 +619,7 @@ struct v4l2_plane { · 8 unmodified lines
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 { · 18 unmodified lines
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 buffer646 * 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 plane649 * @planes: for multiplanar buffers; userspace pointer to the array of plane
644 * info structs for this buffer650 * info structs for this buffer
645 * @length: size in bytes of the buffer (NOT its payload) for single-plane651 * @length: size in bytes of the buffer (NOT its payload) for single-plane
@@ -666,6 +672,7 @@ struct v4l2_buffer { · 20 unmodified lines
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;

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