[libcamera-devel,RFC,4/5] libcamera: pipeline: ipu3: Report available test pattern modes
diff mbox series

Message ID 20210409043208.1823330-5-hiroh@chromium.org
State RFC
Headers show
Series
  • Report available test pattern modes
Related show

Commit Message

Hirokazu Honda April 9, 2021, 4:32 a.m. UTC
Add available test pattern modes to controls.

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

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 519cad4f..c6ca87a7 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -995,6 +995,16 @@  int PipelineHandlerIPU3::initControls(IPU3CameraData *data)
 
 	controls[&controls::ScalerCrop] = ControlInfo(minCrop, maxCrop, maxCrop);
 
+	const std::vector<int32_t> &availableTestPatternModes =
+		sensor->availableTestPatternModes();
+	if (!availableTestPatternModes.empty()) {
+		std::vector<ControlValue> controlValues;
+		for (int32_t value : availableTestPatternModes)
+			controlValues.emplace_back(value);
+		controls[&controls::draft::SensorTestPatternMode] =
+			ControlInfo(controlValues);
+	}
+
 	data->controlInfo_ = std::move(controls);
 
 	return 0;