ipa: rpi: Disable on-sensor auto-exposure where available
diff mbox series

Message ID 20261029-disable_sensor_agc-v1-1-b3706d4e88b4@foss.st.com
State New
Headers show
Series
  • ipa: rpi: Disable on-sensor auto-exposure where available
Related show

Commit Message

Benjamin Mugnier Oct. 29, 2026, 12:37 p.m. UTC
Some sensor device drivers (e.g, VD66GY and VD56G3) have sensor auto-
exposure enabled by default. This interferes with the AGC algorithm
running in the IPA.

By default, disable the sensor auto-exposure on startup so that the IPA
can control the sensor shutter time and gain.

This is an alternative take on Naushir Patuck proposition. It was
brought by Kieran Bingham and Barnabás Pőcze that some pipeline handlers
(i.e the simple pipeline) lacks agc, and therefore should keep the
sensor agc when available.

This patch moves the decision from the core to the ipa, starting with
rpi. It only disables sensor agc for rpi ipa if ipa agc is running, and
keeps it if it doesn't.

Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
---
 src/ipa/rpi/common/ipa_base.cpp | 6 ++++++
 1 file changed, 6 insertions(+)


---
base-commit: 6e19ca0fa7aa75aa965511072f43b5e50dec1904
change-id: 20261029-disable_sensor_agc-47af75105f8d

Best regards,
--  
Benjamin Mugnier <benjamin.mugnier@foss.st.com>

Patch
diff mbox series

diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index c284834440c8..cd4e684d8423 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -208,6 +208,12 @@  int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa
 		}
 	}
 
+	/* Disable sensor agc not to interfere with agc algorithm */
+	RPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(
+		controller_.getAlgorithm("agc"));
+	if (agc)
+		ctrl.set(V4L2_CID_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL);
+
 	/* Setup a metadata ControlList to output metadata. */
 	libcameraMetadata_ = ControlList(controls::controls);