b/drivers/media/video/v4l2-ioctl.c
@@ -1145,6 +1145,16 @@ static long __video_do_ioctl(struct file *file,
dbgbuf(cmd, vfd, p);
break;
}
+ case VIDIOC_EXPBUF:
+ {
+ unsigned int *p = arg;
+
+ if (!ops->vidioc_expbuf)
+ break;
+
+ ret = ops->vidioc_expbuf(file, fh, *p);
+ break;
+ }
case VIDIOC_DQBUF:
{
struct v4l2_buffer *p = arg;
@@ -185,6 +185,7 @@ enum v4l2_memory {
V4L2_MEMORY_MMAP = 1,
V4L2_MEMORY_USERPTR = 2,
V4L2_MEMORY_OVERLAY = 3,
+ V4L2_MEMORY_SHRBUF = 4,
};
/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
@@ -564,6 +565,8 @@ struct v4l2_requestbuffers {
* should be passed to mmap() called on the video node)
* @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace
pointer
* pointing to this plane
+ * @fd: when memory is V4L2_MEMORY_SHRBUF, a userspace file
+ * descriptor associated with this plane
* @data_offset: offset in the plane to the start of data; usually 0,
* unless there is a header in front of the data
*
@@ -578,6 +581,7 @@ struct v4l2_plane {
union {
__u32 mem_offset;
unsigned long userptr;
+ int fd;
} m;
__u32 data_offset;
__u32 reserved[11];
@@ -600,6 +604,8 @@ struct v4l2_plane {
* (or a "cookie" that should be passed to mmap() as offset)
* @userptr: for non-multiplanar buffers with memory ==
V4L2_MEMORY_USERPTR;
* a userspace pointer pointing to this buffer
+ * @fd: for non-multiplanar buffers with memory ==
V4L2_MEMORY_SHRBUF;
+ * a userspace file descriptor associated with this buffer
* @planes: for multiplanar buffers; userspace pointer to the array
of plane
* info structs for this buffer
* @length: size in bytes of the buffer (NOT its payload) for
single-plane
@@ -626,6 +632,7 @@ struct v4l2_buffer {
__u32 offset;
unsigned long userptr;
struct v4l2_plane *planes;
+ int fd;
} m;
__u32 length;
__u32 input;
@@ -1868,6 +1875,7 @@ struct v4l2_dbg_chip_ident {
#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
#define VIDIOC_OVERLAY _IOW('V', 14, int)
#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
+#define VIDIOC_EXPBUF _IOWR('V', 16, unsigned int)
#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
#define VIDIOC_STREAMON _IOW('V', 18, int)
#define VIDIOC_STREAMOFF _IOW('V', 19, int)
@@ -121,6 +121,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_querybuf)(struct file *file, void *fh, struct
v4l2_buffer *b);
int (*vidioc_qbuf) (struct file *file, void *fh, struct
v4l2_buffer *b);
int (*vidioc_dqbuf) (struct file *file, void *fh, struct
v4l2_buffer *b);
+ int (*vidioc_expbuf) (struct file *file, void *fh, unsigned int