[libcamera-devel,v3,2/2] libcamera: pipeline: raspberrypi: Update ControlInfos after sensor format change
diff mbox series

Message ID 20210505135308.1404-3-david.plowman@raspberrypi.com
State Superseded
Headers show
Series
  • Fix CameraSensor::sensorInfo by updating VBLANK ControlInfo
Related show

Commit Message

David Plowman May 5, 2021, 1:53 p.m. UTC
The Raspberry Pi pipeline handler does not update the sensor format
using CameraSensor::setFormat, so it must manually force the update of
the associated ControlInfos.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 2a917455..6288108d 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -608,6 +608,13 @@  int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
 	if (ret)
 		return ret;
 
+	/*
+	 * The control ranges associated with the sensor may need updating
+	 * after a format change.
+	 * \todo Use the CameraSensor::setFormat API instead.
+	 */
+	data->sensor_->updateControlInfo();
+
 	LOG(RPI, Info) << "Sensor: " << camera->id()
 		       << " - Selected mode: " << sensorFormat.toString();