mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: amphion: ensure the buffer count is not less than min_buffer
@ 2022-03-22  8:28 Ming Qian
  2022-04-27  6:38 ` Hans Verkuil
  0 siblings, 1 reply; 6+ messages in thread
From: Ming Qian @ 2022-03-22  8:28 UTC (permalink / raw)
  To: mchehab, shawnguo
  Cc: hverkuil-cisco, robh+dt, s.hauer, kernel, festevam, linux-imx,
	aisheng.dong, linux-media, linux-kernel, linux-arm-kernel

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>
---
 drivers/media/platform/amphion/vpu_v4l2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index cbf3315605a9..72a0544f4da3 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -355,6 +355,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];
-- 
2.33.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-28  7:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22  8:28 [PATCH] media: amphion: ensure the buffer count is not less than min_buffer Ming Qian
2022-04-27  6:38 ` Hans Verkuil
2022-04-27  7:01   ` [EXT] " Ming Qian
2022-04-27  7:25     ` Hans Verkuil
2022-04-27  9:31       ` Ming Qian
2022-04-28  7:59         ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®