From f452cb18862ec4aaddf66efe9e956d70b969b8e1 Mon Sep 17 00:00:00 2001 From: Jeonghee Kim Date: Fri, 26 Jan 2018 14:25:28 +0900 Subject: [PATCH] [COMMON] media: videobuf2-v4l2: keep the reserved2 field The reserved2 field should be keeped, because this is used for extension interface between user space and kernel space. Change-Id: I9bb33d4ffa599f48b97c1604848ccdc4d0095310 Signed-off-by: Ayoung Sim Signed-off-by: Jeonghee Kim --- drivers/media/v4l2-core/videobuf2-v4l2.c | 3 ++- include/media/videobuf2-v4l2.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c index 0c0669976bdc..dfb8fc4d6ade 100644 --- a/drivers/media/v4l2-core/videobuf2-v4l2.c +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c @@ -203,7 +203,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) b->timestamp = ns_to_timeval(vb->timestamp); b->timecode = vbuf->timecode; b->sequence = vbuf->sequence; - b->reserved2 = 0; + b->reserved2 = vbuf->reserved2; b->reserved = 0; if (q->is_multiplanar) { @@ -320,6 +320,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, } vb->timestamp = 0; vbuf->sequence = 0; + vbuf->reserved2 = b->reserved2; if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) { if (b->memory == VB2_MEMORY_USERPTR) { diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h index 036127c54bbf..64bc7dfaddde 100644 --- a/include/media/videobuf2-v4l2.h +++ b/include/media/videobuf2-v4l2.h @@ -31,6 +31,7 @@ * @field: enum v4l2_field; field order of the image in the buffer * @timecode: frame timecode * @sequence: sequence count of this frame + * @reserved2: reserved field for future extensions * * 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 { __u32 field; struct v4l2_timecode timecode; __u32 sequence; + __u32 reserved2; }; /* -- 2.20.1