Commit a58fcab9 authored by Ezequiel Garcia's avatar Ezequiel Garcia
Browse files

media: rkvdec: Fix .buf_prepare

The driver should only set the payload on .buf_prepare
if the buffer is CAPTURE type.

Fix it.

Fixes: cd33c830

 ("media: rkvdec: Add the rkvdec driver")
Signed-off-by: Ezequiel Garcia's avatarEzequiel Garcia <ezequiel@collabora.com>
parent c6860e9b
......@@ -456,7 +456,11 @@ static int rkvdec_buf_prepare(struct vb2_buffer *vb)
if (vb2_plane_size(vb, i) < sizeimage)
return -EINVAL;
}
vb2_set_plane_payload(vb, 0, f->fmt.pix_mp.plane_fmt[0].sizeimage);
/* For CAPTURE buffers, bytesused is set by the driver. */
if (V4L2_TYPE_IS_CAPTURE(vq->type))
vb2_set_plane_payload(vb, 0,
f->fmt.pix_mp.plane_fmt[0].sizeimage);
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment