pipeline: rksip1: Move isRaw up in scope

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.

During that rework it was noticed that the old code actually has a bug
in that it reduces the number of configurations to 1 in case a raw
config is found, but it doesn't reduce the config vector to that raw
config, but the first config.

Change that behavior to check the first config and either remove all
remaining configs if the first is raw or drop all raw configs if the
first is non-raw.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Stefan Klug
2025-11-25 17:28:30 +01:00
parent 13e5c71294
commit fa78167e3a
+17 -18
View File
@@ -551,31 +551,30 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()
status = Adjusted;
/*
* Simultaneous capture of raw and processed streams isn't possible. If
* there is any raw stream, cap the number of streams to one.
* Simultaneous capture of raw and processed streams isn't possible.
* Let the first stream decide on the type.
*/
if (config_.size() > 1) {
for (const auto &cfg : config_) {
if (PixelFormatInfo::info(cfg.pixelFormat).colourEncoding ==
bool isRaw = (PixelFormatInfo::info(config_[0].pixelFormat).colourEncoding ==
PixelFormatInfo::ColourEncodingRAW);
if (isRaw) {
if (config_.size() > 1) {
config_.resize(1);
status = Adjusted;
}
} else {
/* Drop all raw configs. */
for (auto it = config_.begin(); it != config_.end();) {
if (PixelFormatInfo::info(it->pixelFormat).colourEncoding ==
PixelFormatInfo::ColourEncodingRAW) {
config_.resize(1);
it = config_.erase(it);
status = Adjusted;
break;
continue;
}
++it;
}
}
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;
}
bool useDewarper = (pipe->dewarper_ && !isRaw);
/*
* If there are more than one stream in the configuration figure out the