]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: rockchip: rga: fix field in OUTPUT buffers
authorMichael Tretter <m.tretter@pengutronix.de>
Fri, 9 Aug 2024 16:06:30 +0000 (18:06 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 6 Mar 2025 16:28:26 +0000 (17:28 +0100)
Returned buffers shouldn't contain V4L2_FIELD_ANY as field. Set the
field to V4L2_FIELD_NONE, if it isn't set.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/rockchip/rga/rga-buf.c

index 4396348811c8d093981f6f35002834f48c7b3405..730bdf98565a55704cef92345ccf9f486b99b06e 100644 (file)
@@ -119,6 +119,13 @@ static int rga_buf_prepare(struct vb2_buffer *vb)
        if (IS_ERR(f))
                return PTR_ERR(f);
 
+       if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) {
+               if (vbuf->field == V4L2_FIELD_ANY)
+                       vbuf->field = V4L2_FIELD_NONE;
+               if (vbuf->field != V4L2_FIELD_NONE)
+                       return -EINVAL;
+       }
+
        for (i = 0; i < vb->num_planes; i++) {
                vb2_set_plane_payload(vb, i, f->pix.plane_fmt[i].sizeimage);