From 1ed284ba487b7e0903e031c4e6604b601ff040a8 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Thu, 17 Jul 2025 14:59:23 +0200 Subject: [PATCH] pipeline: rkisp1: Limit the maximum number of buffers queued in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To keep the regulation of the algorithms as fast as possible and at the same time allow more buffers to be allocated, limit the amount of buffers that get queued into the device to the pipeline depth plus a tiny margin. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Tested-by: Sven Püschel Reviewed-by: Umang Jain --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 675f0a74..acafca1a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -155,6 +155,18 @@ private: Transform combinedTransform_; }; +namespace { + +/* + * Maximum number of requests that shall be queued into the pipeline to keep + * the regulation fast. + * \todo This needs revisiting as soon as buffers got decoupled from requests + * and/or a fast path for controls was implemented. + */ +static constexpr unsigned int kRkISP1MaxQueuedRequests = 4; + +} /* namespace */ + class PipelineHandlerRkISP1 : public PipelineHandler { public: @@ -684,7 +696,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() */ PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager) - : PipelineHandler(manager), hasSelfPath_(true), useDewarper_(false) + : PipelineHandler(manager, kRkISP1MaxQueuedRequests), + hasSelfPath_(true), useDewarper_(false) { }