Commit 360565fc authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid: fix typo in plane size checks

The plane size check was hardcoded to plane 0 instead of using the plane
index.

This failed when using the NV61M format which has a larger plane size for
the second plane compared to the first plane.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9832e0e0
...@@ -188,9 +188,9 @@ static int vid_cap_buf_prepare(struct vb2_buffer *vb) ...@@ -188,9 +188,9 @@ static int vid_cap_buf_prepare(struct vb2_buffer *vb)
size = tpg_g_bytesperline(&dev->tpg, p) * dev->fmt_cap_rect.height + size = tpg_g_bytesperline(&dev->tpg, p) * dev->fmt_cap_rect.height +
dev->fmt_cap->data_offset[p]; dev->fmt_cap->data_offset[p];
if (vb2_plane_size(vb, 0) < size) { if (vb2_plane_size(vb, p) < size) {
dprintk(dev, 1, "%s data will not fit into plane %u (%lu < %lu)\n", dprintk(dev, 1, "%s data will not fit into plane %u (%lu < %lu)\n",
__func__, p, vb2_plane_size(vb, 0), size); __func__, p, vb2_plane_size(vb, p), size);
return -EINVAL; return -EINVAL;
} }
......
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