Commit 7b602069 authored by Ming Qian's avatar Ming Qian Committed by Mauro Carvalho Chehab

media: amphion: ensure the buffer count is not less than min_buffer

the output buffer count should >= min_buffer_out
the capture buffer count should >= min_buffer_cap
Signed-off-by: default avatarMing Qian <ming.qian@nxp.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 6d644a63
......@@ -398,6 +398,10 @@ static int vpu_vb2_queue_setup(struct vb2_queue *vq,
return 0;
}
if (V4L2_TYPE_IS_OUTPUT(vq->type))
*buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_out);
else
*buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_cap);
*plane_count = cur_fmt->num_planes;
for (i = 0; i < cur_fmt->num_planes; i++)
psize[i] = cur_fmt->sizeimage[i];
......
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