[v5,1/3] pipeline: simple: Initialize maxQueuedRequestsDevice to 4
diff mbox series

Message ID 20251012142052.90611-2-robert.mader@collabora.com
State Accepted
Commit d82780801db776038ecbe1c181446f7b4e098dba
Headers show
Series
  • pipeline: simple: Allow buffer counts from 1 to 32
Related show

Commit Message

Robert Mader Oct. 12, 2025, 2:20 p.m. UTC
In order to prepare for the pipeline handler to support higher buffer
counts than 4, limit the number of queued requests to this number as
apps otherwise may exhaust the limit of frame contexts (see
ipa::soft::kMaxFrameContexts => 16).

Suggested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Oct. 13, 2025, 12:32 p.m. UTC | #1
On Sun, Oct 12, 2025 at 04:20:50PM +0200, Robert Mader wrote:
> In order to prepare for the pipeline handler to support higher buffer
> counts than 4, limit the number of queued requests to this number as
> apps otherwise may exhaust the limit of frame contexts (see
> ipa::soft::kMaxFrameContexts => 16).
> 
> Suggested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/libcamera/pipeline/simple/simple.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index c816cffc9..6e8271346 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -417,6 +417,7 @@ protected:
>  	int queueRequestDevice(Camera *camera, Request *request) override;
>  
>  private:
> +	static constexpr unsigned int kMaxQueuedRequestsDevice = 4;

4 seems fairly low, given the 16 frame contexts. All this will need to
be revisited. Stefan is reworking the rkisp1 pipeline handler and IPA
module to better handle requests, I think we can live with 4 requests
for the time being in the simple pipeline handler and later rework it
the same way as rkisp1 (and everything else really). Stefan, does that
sound like a good strategy to you ?

>  	static constexpr unsigned int kNumInternalBuffers = 3;
>  
>  	struct EntityData {
> @@ -1273,7 +1274,8 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
>   */
>  
>  SimplePipelineHandler::SimplePipelineHandler(CameraManager *manager)
> -	: PipelineHandler(manager), converter_(nullptr)
> +	: PipelineHandler(manager, kMaxQueuedRequestsDevice),
> +	  converter_(nullptr)
>  {
>  }
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index c816cffc9..6e8271346 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -417,6 +417,7 @@  protected:
 	int queueRequestDevice(Camera *camera, Request *request) override;
 
 private:
+	static constexpr unsigned int kMaxQueuedRequestsDevice = 4;
 	static constexpr unsigned int kNumInternalBuffers = 3;
 
 	struct EntityData {
@@ -1273,7 +1274,8 @@  CameraConfiguration::Status SimpleCameraConfiguration::validate()
  */
 
 SimplePipelineHandler::SimplePipelineHandler(CameraManager *manager)
-	: PipelineHandler(manager), converter_(nullptr)
+	: PipelineHandler(manager, kMaxQueuedRequestsDevice),
+	  converter_(nullptr)
 {
 }