aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/platform/amphion
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2022-03-22 09:28:59 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-05-13 11:02:20 +0200
commit7b602069cdddb59669cef7935c5ab06591945bfe (patch)
treeaf7ef5d7389f7d97d850c42c07b4ada8d732ebdb /drivers/media/platform/amphion
parentmedia: stkwebcam: move stk_camera_read_reg() scratch buffer to struct stk_camera (diff)
downloadwireguard-linux-7b602069cdddb59669cef7935c5ab06591945bfe.tar.xz
wireguard-linux-7b602069cdddb59669cef7935c5ab06591945bfe.zip
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>
Diffstat (limited to 'drivers/media/platform/amphion')
-rw-r--r--drivers/media/platform/amphion/vpu_v4l2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index 801bd08749d9..34ab941460df 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -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];