[libcamera-devel] [PATCH v5 5/6] libcamera: pipeline: ipu3: Report available sensor test pattern mode

Hirokazu Honda hiroh at chromium.org
Wed May 19 09:59:40 CEST 2021


PipelineHandlerIPU3 gets available test pattern modes of the
sensor device and reports them to a client.

Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index ade8ffbd..c1d1d937 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -891,6 +891,18 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)
 	ControlInfoMap::Map controls = IPU3Controls;
 	const ControlInfoMap &sensorControls = sensor->controls();
 
+	if (const std::vector<uint8_t> &testPatternModes =
+		    sensor->testPatternModes();
+	    !testPatternModes.empty()) {
+		std::vector<ControlValue> values;
+		values.reserve(testPatternModes.size());
+
+		for (uint8_t pattern : testPatternModes)
+			values.emplace_back(static_cast<int32_t>(pattern));
+
+		controls[&controls::draft::TestPatternMode] = ControlInfo(values);
+	}
+
 	/*
 	 * Compute exposure time limits.
 	 *
-- 
2.31.1.751.gd2f1c929bd-goog



More information about the libcamera-devel mailing list