[v2] libcamera: pipeline: simple: Reject multiple processed streams with software ISP
diff mbox series

Message ID 20260925151816.909725-1-alexi.birlinger@nxp.com
State New
Headers show
Series
  • [v2] libcamera: pipeline: simple: Reject multiple processed streams with software ISP
Related show

Commit Message

Alexi Birlinger Sept. 25, 2026, 3:18 p.m. UTC
The software ISP is defined with 2 streams. However, it only supports
a single processed stream, with an optional raw stream.
Return a null configuration early in generateConfiguration() when multiple
processed streams are requested while the software ISP is enabled.

Additionally, adjust validate() to enforce the same restriction, as the user
is allowed to modify the configuration after it has been generated.

Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Alexi Birlinger Sept. 25, 2026, 3:54 p.m. UTC | #1
Hi all,

Forget to add v2 changes, sorry.


Changes in v2:

- Reject multiple processed streams in validate()

On 9/25/26 17:18, Alexi Birlinger wrote:
> The software ISP is defined with 2 streams. However, it only supports
> a single processed stream, with an optional raw stream.
> Return a null configuration early in generateConfiguration() when multiple
> processed streams are requested while the software ISP is enabled.
>
> Additionally, adjust validate() to enforce the same restriction, as the user
> is allowed to modify the configuration after it has been generated.
>
> Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
> ---
>   src/libcamera/pipeline/simple/simple.cpp | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 35c29ceca..27eb728f3 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -1183,6 +1183,13 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
>   		return Invalid;
>   	}
>   
> +	unsigned int processedCount = config_.size() - rawCount;
> +	if (data_->pipe()->swIspEnabled() && processedCount > 1) {
> +		LOG(SimplePipeline, Error)
> +			<< "Software ISP does not support multiple processed streams";
> +		return Invalid;
> +	}
> +
>   	/*
>   	 * Find the best configuration for the pipeline using a heuristic.
>   	 * First select the pixel format based on the raw streams followed by
> @@ -1427,6 +1434,11 @@ SimplePipelineHandler::generateConfiguration(Camera *camera, std::span<const Str
>   			}
>   			rawRequested = true;
>   		} else {
> +			if (swIspEnabled_ && processedRequested) {
> +				LOG(SimplePipeline, Error)
> +					<< "Software ISP can't capture multiple processed streams";
> +				return nullptr;
> +			}
>   			processedRequested = true;
>   		}
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 35c29ceca..27eb728f3 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -1183,6 +1183,13 @@  CameraConfiguration::Status SimpleCameraConfiguration::validate()
 		return Invalid;
 	}
 
+	unsigned int processedCount = config_.size() - rawCount;
+	if (data_->pipe()->swIspEnabled() && processedCount > 1) {
+		LOG(SimplePipeline, Error)
+			<< "Software ISP does not support multiple processed streams";
+		return Invalid;
+	}
+
 	/*
 	 * Find the best configuration for the pipeline using a heuristic.
 	 * First select the pixel format based on the raw streams followed by
@@ -1427,6 +1434,11 @@  SimplePipelineHandler::generateConfiguration(Camera *camera, std::span<const Str
 			}
 			rawRequested = true;
 		} else {
+			if (swIspEnabled_ && processedRequested) {
+				LOG(SimplePipeline, Error)
+					<< "Software ISP can't capture multiple processed streams";
+				return nullptr;
+			}
 			processedRequested = true;
 		}