[COMMON] media: videobuf2-v4l2: fix bug for multiplane
authorWon Jung <w00.jung@samsung.com>
Thu, 26 May 2016 13:19:35 +0000 (22:19 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:17 +0000 (20:22 +0300)
In __fill_v4l2_buffer, q->is_multiplaner is used
to check whether multiplane is requested.
However, at this point, do not refer the condition
because it is not determined yet.
Therefore, using the macro, V4L2_TYPE_IS_MULTIPLANAR(), and
type, the member value in struct v4l2_buffer, the condition
(multiplane) is checked.

Change-Id: I84ce7a39020de53423ba094dd10fc712deba8d1b
Signed-off-by: Won Jung <w00.jung@samsung.com>
drivers/media/v4l2-core/videobuf2-v4l2.c

index a71df456adf601c960b89c583ef3ce5de52f9898..3c8f619062c80283b794adc4c21b9d61b29c49e4 100644 (file)
@@ -205,7 +205,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
        b->reserved2 = vbuf->reserved2;
        b->reserved = 0;
 
-       if (q->is_multiplanar) {
+       if (V4L2_TYPE_IS_MULTIPLANAR(b->type)) {
                /*
                 * Fill in plane-related data if userspace provided an array
                 * for it. The caller has already verified memory and size.