提交 697a6d23 编写于 作者: K Katsuya Matsubara 提交者: Mauro Carvalho Chehab

[media] sh_veu: fix the buffer size calculation

The 'bytesperline' value only indicates the stride of the Y plane
if the color format is planar, such as NV12. When calculating
the total plane size, the size of CbCr plane must also be considered.
Signed-off-by: NKatsuya Matsubara <matsu@igel.co.jp>
Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 6abb3cf2
......@@ -905,11 +905,11 @@ static int sh_veu_queue_setup(struct vb2_queue *vq,
if (ftmp.fmt.pix.width != pix->width ||
ftmp.fmt.pix.height != pix->height)
return -EINVAL;
size = pix->bytesperline ? pix->bytesperline * pix->height :
pix->width * pix->height * fmt->depth >> 3;
size = pix->bytesperline ? pix->bytesperline * pix->height * fmt->depth / fmt->ydepth :
pix->width * pix->height * fmt->depth / fmt->ydepth;
} else {
vfmt = sh_veu_get_vfmt(veu, vq->type);
size = vfmt->bytesperline * vfmt->frame.height;
size = vfmt->bytesperline * vfmt->frame.height * vfmt->fmt->depth / vfmt->fmt->ydepth;
}
if (count < 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册