Skip to content

Commit 1e7bd96

Browse files
tretterhverkuil
authored andcommitted
media: rockchip: rga: fix field in OUTPUT buffers
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 9c1cde7 commit 1e7bd96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/media/platform/rockchip/rga/rga-buf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ static int rga_buf_prepare(struct vb2_buffer *vb)
119119
if (IS_ERR(f))
120120
return PTR_ERR(f);
121121

122+
if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) {
123+
if (vbuf->field == V4L2_FIELD_ANY)
124+
vbuf->field = V4L2_FIELD_NONE;
125+
if (vbuf->field != V4L2_FIELD_NONE)
126+
return -EINVAL;
127+
}
128+
122129
for (i = 0; i < vb->num_planes; i++) {
123130
vb2_set_plane_payload(vb, i, f->pix.plane_fmt[i].sizeimage);
124131

0 commit comments

Comments
 (0)