Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Ming Qian and committed by
Mauro Carvalho Chehab
7b602069 6d644a63

+4
+4
drivers/media/platform/amphion/vpu_v4l2.c
··· 398 398 return 0; 399 399 } 400 400 401 + if (V4L2_TYPE_IS_OUTPUT(vq->type)) 402 + *buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_out); 403 + else 404 + *buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_cap); 401 405 *plane_count = cur_fmt->num_planes; 402 406 for (i = 0; i < cur_fmt->num_planes; i++) 403 407 psize[i] = cur_fmt->sizeimage[i];