[v2,24/35] pipeline: rksip1: Move isRaw up in scope
diff mbox series

Message ID 20251023144841.403689-25-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Full dewarper support on imx8mp
Related show

Commit Message

Stefan Klug Oct. 23, 2025, 2:48 p.m. UTC
In raw mode the number of configurations is actively limited to 1. It is
therefore safe to move isRaw up one level to simplify the code and
prepare for later use.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 0b31b8077c8d..35cb54c812bc 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -559,28 +559,22 @@  CameraConfiguration::Status RkISP1CameraConfiguration::validate()
 	 * Simultaneous capture of raw and processed streams isn't possible. If
 	 * there is any raw stream, cap the number of streams to one.
 	 */
+	bool isRaw = false;
 	if (config_.size() > 1) {
 		for (const auto &cfg : config_) {
 			if (PixelFormatInfo::info(cfg.pixelFormat).colourEncoding ==
 			    PixelFormatInfo::ColourEncodingRAW) {
 				config_.resize(1);
 				status = Adjusted;
+				isRaw = true;
 				break;
 			}
 		}
 	}
 
 	bool useDewarper = false;
-	if (pipe->dewarper_) {
-		/*
-		 * Platforms with dewarper support, such as i.MX8MP, support
-		 * only a single stream. We can inspect config_[0] only here.
-		 */
-		bool isRaw = PixelFormatInfo::info(config_[0].pixelFormat).colourEncoding ==
-			     PixelFormatInfo::ColourEncodingRAW;
-		if (!isRaw)
-			useDewarper = true;
-	}
+	if (pipe->dewarper_ && !isRaw)
+		useDewarper = true;
 
 	/*
 	 * If there are more than one stream in the configuration figure out the