public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3] media: rkisp1: Remove min_queued_buffers
@ 2024-10-29  8:21 Jacopo Mondi
  2024-10-29 11:29 ` Laurent Pinchart
  2025-02-20 14:22 ` Jacopo Mondi
  0 siblings, 2 replies; 11+ messages in thread
From: Jacopo Mondi @ 2024-10-29  8:21 UTC (permalink / raw)
  To: Dafna Hirschfeld, Laurent Pinchart, Hans Verkuil,
	open list:ROCKCHIP ISP V1 DRIVER
  Cc: Jacopo Mondi, Mauro Carvalho Chehab, Heiko Stuebner,
	open list:ROCKCHIP ISP V1 DRIVER, Adam Pigg

There apparently is no reason to require 3 queued buffers for RkISP1,
as the driver operates with a scratch buffer where data can be
directed to if there's no available buffer provided by userspace.

Reduce the number of required buffers to 0 by removing the
initialization of min_queued_buffers, to allow applications to operate
by queueing capture buffers on-demand.

Tested with libcamera, by operating with a single capture request. The
same request (and the associated capture buffer) gets recycled once
completed. This of course causes a frame rate drop but doesn't hinder
operations.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
v2->v3:
- Remove min_queued_buffers initialization

v1->v2:
The first version of this patch set min_queued_buffers to 1, but setting it
to 0 doesn't compromise operations and it's even better as it allows application
to queue buffers to the capture devices on-demand. If a buffer is not provided
to the DMA engines, image data gets directed to the driver's internal scratch
buffer.
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index 2bddb4fa8a5c..2f0c610e74b9 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -35,8 +35,6 @@
 #define RKISP1_SP_DEV_NAME	RKISP1_DRIVER_NAME "_selfpath"
 #define RKISP1_MP_DEV_NAME	RKISP1_DRIVER_NAME "_mainpath"

-#define RKISP1_MIN_BUFFERS_NEEDED 3
-
 enum rkisp1_plane {
 	RKISP1_PLANE_Y	= 0,
 	RKISP1_PLANE_CB	= 1,
@@ -1563,7 +1561,6 @@ static int rkisp1_register_capture(struct rkisp1_capture *cap)
 	q->ops = &rkisp1_vb2_ops;
 	q->mem_ops = &vb2_dma_contig_memops;
 	q->buf_struct_size = sizeof(struct rkisp1_buffer);
-	q->min_queued_buffers = RKISP1_MIN_BUFFERS_NEEDED;
 	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
 	q->lock = &node->vlock;
 	q->dev = cap->rkisp1->dev;
--
2.47.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2025-02-20 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29  8:21 [PATCH v3] media: rkisp1: Remove min_queued_buffers Jacopo Mondi
2024-10-29 11:29 ` Laurent Pinchart
2024-10-29 11:50   ` Hans Verkuil
2025-02-20 14:22 ` Jacopo Mondi
2025-02-20 14:50   ` Laurent Pinchart
2025-02-20 15:33   ` Hans Verkuil
2025-02-20 16:38     ` Laurent Pinchart
2025-02-20 15:39   ` Hans Verkuil
2025-02-20 16:27     ` Jacopo Mondi
2025-02-20 17:01       ` Hans Verkuil
2025-02-20 16:34     ` Laurent Pinchart

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