[COMMON] media: videobuf2-v4l2: keep the reserved2 field
authorJeonghee Kim <jhhhh.kim@samsung.com>
Fri, 26 Jan 2018 05:25:28 +0000 (14:25 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:17 +0000 (20:22 +0300)
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 <a.sim@samsung.com>
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/v4l2-core/videobuf2-v4l2.c
include/media/videobuf2-v4l2.h

index 69ca8debb711aad1f73b3516b34cdfff8fd852d4..a71df456adf601c960b89c583ef3ce5de52f9898 100644 (file)
@@ -202,7 +202,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) {
@@ -319,6 +319,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) {
index 036127c54bbf2d051fd99d08758da389b4722c11..64bc7dfaddde41465df11cd89a0b97bb88be2427 100644 (file)
@@ -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;
 };
 
 /*