[libcamera-devel,RFC,2/4] libcamera: ipu3: Disable a sensor test pattern mode at initialization
diff mbox series

Message ID 20210611084228.1830629-3-hiroh@chromium.org
State Superseded
Headers show
Series
  • Support sensor test pattern mode in Android HAL
Related show

Commit Message

Hirokazu Honda June 11, 2021, 8:42 a.m. UTC
Turns off a sensor test pattern mode at the initialization of the
sensor. Without this, the camera sensor is configured with the last
test pattern mode that has been set.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/libcamera/pipeline/ipu3/cio2.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
index 1be2cbcd..8548f749 100644
--- a/src/libcamera/pipeline/ipu3/cio2.cpp
+++ b/src/libcamera/pipeline/ipu3/cio2.cpp
@@ -9,6 +9,7 @@ 
 
 #include <linux/media-bus-format.h>
 
+#include <libcamera/control_ids.h>
 #include <libcamera/formats.h>
 #include <libcamera/geometry.h>
 #include <libcamera/stream.h>
@@ -192,6 +193,13 @@  int CIO2Device::configure(const Size &size, V4L2DeviceFormat *outputFormat)
 
 	LOG(IPU3, Debug) << "CIO2 output format " << outputFormat->toString();
 
+	ret = sensor_->setTestPatternMode(controls::draft::TestPatternModeOff);
+	if (ret) {
+		LOG(IPU3, Error)
+			<< "Failed to reset test pattern mode: " << ret;
+		return ret;
+	}
+
 	return 0;
 }