[libcamera-devel,v5,9/9] ipa: ipu3: Send lens controls to pipeline handler
diff mbox series

Message ID 20220303234956.1463551-10-djrscally@gmail.com
State Accepted
Headers show
Series
  • Enumerate CameraLens by following sensor's ancillary links
Related show

Commit Message

Daniel Scally March 3, 2022, 11:49 p.m. UTC
Pick up the focus value from the AF algorithm and send lens controls
along in the frame context.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
Changes in v5:

	- None

Changes in v4:

	- Got rid of the focus variable (Laurent)

Changes in v3:

	- Replaced the new focus_ member with a local variable.

 src/ipa/ipu3/ipu3.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Nicolas Dufresne via libcamera-devel March 9, 2022, 3:17 p.m. UTC | #1
Hi !

Thanks for the patch !

On 04/03/2022 00:49, Daniel Scally wrote:
> Pick up the focus value from the AF algorithm and send lens controls
> along in the frame context.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Daniel Scally <djrscally@gmail.com>

Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>

> ---
> Changes in v5:
> 
> 	- None
> 
> Changes in v4:
> 
> 	- Got rid of the focus variable (Laurent)
> 
> Changes in v3:
> 
> 	- Replaced the new focus_ member with a local variable.
> 
>   src/ipa/ipu3/ipu3.cpp | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
> index e539d875..b8c4b30f 100644
> --- a/src/ipa/ipu3/ipu3.cpp
> +++ b/src/ipa/ipu3/ipu3.cpp
> @@ -704,6 +704,11 @@ void IPAIPU3::setControls(unsigned int frame)
>   	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
>   	op.sensorControls = ctrls;
>   
> +	ControlList lensCtrls(lensCtrls_);
> +	lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,
> +		      static_cast<int32_t>(context_.frameContext.af.focus));
> +	op.lensControls = lensCtrls;
> +
>   	queueFrameAction.emit(frame, op);
>   }
>

Patch
diff mbox series

diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index e539d875..b8c4b30f 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -704,6 +704,11 @@  void IPAIPU3::setControls(unsigned int frame)
 	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));
 	op.sensorControls = ctrls;
 
+	ControlList lensCtrls(lensCtrls_);
+	lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,
+		      static_cast<int32_t>(context_.frameContext.af.focus));
+	op.lensControls = lensCtrls;
+
 	queueFrameAction.emit(frame, op);
 }