From 07dc8fde532bde2584e30769f2473d86381bc58d Mon Sep 17 00:00:00 2001 From: Pawel Osciak Date: Sat, 13 Sep 2014 11:45:49 +0900 Subject: [PATCH] CHROMIUM: videodev2.h: rename reserved2 to config_store in v4l2_buffer. When queuing buffers allow for passing the configuration store ID that should be associated with this buffer. Use the 'reserved2' field for this. Signed-off-by: Hans Verkuil BUG=chrome-os-partner:33728 TEST=build Signed-off-by: Pawel Osciak Reviewed-on: https://chromium-review.googlesource.com/232583 Trybot-Ready: Tomasz Figa Tested-by: Tomasz Figa Reviewed-by: Wu-cheng Li Commit-Queue: Tomasz Figa Conflicts: drivers/media/v4l2-core/videobuf2-core.c [rebase44(groeck): fixed conflicts; structural changes to match v4.4] Signed-off-by: Guenter Roeck Conflicts: drivers/media/v4l2-core/v4l2-compat-ioctl32.c Change-Id: Ibb823e9369bec79645e09651b0dda006ed53ecc5 Signed-off-by: Jeffy Chen Signed-off-by: Yakir Yang --- drivers/media/usb/cpia2/cpia2_v4l.c | 2 +- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 ++-- drivers/media/v4l2-core/videobuf2-v4l2.c | 4 +++- include/media/videobuf2-v4l2.h | 2 ++ include/uapi/linux/videodev2.h | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 9caea8344547..0f28d2bf16d5 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -952,7 +952,7 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf) buf->sequence = cam->buffers[buf->index].seq; buf->m.offset = cam->buffers[buf->index].data - cam->frame_buffer; buf->length = cam->frame_size; - buf->reserved2 = 0; + buf->config_store = 0; buf->reserved = 0; memset(&buf->timecode, 0, sizeof(buf->timecode)); diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 019644ff627d..7f6f927cb98e 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -347,7 +347,7 @@ struct v4l2_buffer32 { __s32 fd; } m; __u32 length; - __u32 reserved2; + __u32 config_store; __u32 reserved; }; @@ -508,7 +508,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) || copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) || put_user(kp->sequence, &up->sequence) || - put_user(kp->reserved2, &up->reserved2) || + put_user(kp->config_store, &up->config_store) || put_user(kp->reserved, &up->reserved) || put_user(kp->length, &up->length)) return -EFAULT; diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c index 502984c724ff..15ed2aa2e532 100644 --- a/drivers/media/v4l2-core/videobuf2-v4l2.c +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c @@ -194,7 +194,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) b->timestamp = vbuf->timestamp; b->timecode = vbuf->timecode; b->sequence = vbuf->sequence; - b->reserved2 = 0; + b->config_store = vbuf->config_store; b->reserved = 0; if (q->is_multiplanar) { @@ -414,6 +414,8 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, vbuf->flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK; } + vbuf->config_store = b->config_store; + if (V4L2_TYPE_IS_OUTPUT(b->type)) { /* * For output buffers mask out the timecode flag: diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h index 5abab1e7c7e8..ec1aeabec426 100644 --- a/include/media/videobuf2-v4l2.h +++ b/include/media/videobuf2-v4l2.h @@ -31,6 +31,7 @@ * @timestamp: frame timestamp * @timecode: frame timecode * @sequence: sequence count of this frame + * @config_store: this buffer should use this configuration store * Should contain enough information to be able to cover all the fields * of struct v4l2_buffer at videodev2.h */ @@ -42,6 +43,7 @@ struct vb2_v4l2_buffer { struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; + __u32 config_store; }; /* diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index d507509baed0..dc28e10f9985 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -844,6 +844,7 @@ struct v4l2_plane { * @length: size in bytes of the buffer (NOT its payload) for single-plane * buffers (when type != *_MPLANE); number of elements in the * planes array for multi-plane buffers + * @config_store: this buffer should use this configuration store * * Contains data exchanged by application and driver using one of the Streaming * I/O methods. @@ -867,7 +868,7 @@ struct v4l2_buffer { __s32 fd; } m; __u32 length; - __u32 reserved2; + __u32 config_store; __u32 reserved; }; -- 2.34.1