[libcamera-devel,v4,5/6] libcamera: pipeline: ipu3: Report available sensor test pattern mode
diff mbox series

Message ID 20210506075449.1761752-6-hiroh@chromium.org
State Superseded
Headers show
Series
  • [libcamera-devel,v4,1/6] libcamera: controls: Add sensor test pattern mode
Related show

Commit Message

Hirokazu Honda May 6, 2021, 7:54 a.m. UTC
PipelineHandlerIPU3 gets available test pattern modes of the
sensor device and reports them to a client.

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

Comments

Jacopo Mondi May 18, 2021, 12:27 p.m. UTC | #1
Hi Hiro,

On Thu, May 06, 2021 at 04:54:48PM +0900, Hirokazu Honda wrote:
> PipelineHandlerIPU3 gets available test pattern modes of the
> sensor device and reports them to a client.
>
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 73306cea..b4d4b97d 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -891,6 +891,16 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)
>  	ControlInfoMap::Map controls = IPU3Controls;
>  	const ControlInfoMap &sensorControls = sensor->controls();
>
> +	if (!sensorInfo.testPatternModes.empty()) {

Once this is retrieved through an ad-hoc method from CameraSensor
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

> +		std::vector<ControlValue> values;
> +		values.reserve(sensorInfo.testPatternModes.size());
> +
> +		for (int32_t pattern : sensorInfo.testPatternModes)
> +			values.emplace_back(pattern);
> +
> +		controls[&controls::draft::TestPatternMode] = ControlInfo(values);
> +	}
> +
>  	/*
>  	 * Compute exposure time limits.
>  	 *
> --
> 2.31.1.607.g51e8a6a459-goog
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

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