[WIP,RFC,20/26] pipeline: rpi: Use CameraSensor::isMono() helper
diff mbox series

Message ID 20261023-b4-raw-model-v1-20-eadb9948901b@ideasonboard.com
State New
Headers show
Series
  • Support the new common raw sensor model
Related show

Commit Message

Jai Luthra Oct. 23, 2026, 10:58 a.m. UTC
With the raw sensor model in place, the media bus codes may no longer
indicate the bayer order or if the pixel data is monochrome.

Rely on the newly introduced CameraSensor::isMono() helper instead.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 7ea48f62cc3d..435f460bbf8c 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -71,14 +71,6 @@  mbusCodeToPixelFormat(unsigned int code, BayerFormat::Packing packingReq)
 	return pix;
 }
 
-bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)
-{
-	unsigned int mbusCode = sensor->mbusCodes()[0];
-	const BayerFormat &bayer = BayerFormat::fromMbusCode(mbusCode);
-
-	return bayer.cfa.order == ColorFilterArray::Order::MONO;
-}
-
 const std::vector<ColorSpace> validColorSpaces = {
 	ColorSpace::Sycc,
 	ColorSpace::Smpte170m,
@@ -1190,7 +1182,7 @@  int CameraData::loadIPA(ipa::RPi::InitResult *result)
 
 	/* The configuration (tuning file) is made from the sensor name. */
 	std::string model = sensor_->model();
-	if (isMonoSensor(sensor_))
+	if (sensor_->isMono())
 		model += "_mono";
 	std::string configurationFile = ipa_->configurationFile(model + ".json");