[libcamera-devel,03/22] ipa: ipu3: Use sensor controls to update frameContext
diff mbox series

Message ID 20211108131350.130665-4-jeanmichel.hautbois@ideasonboard.com
State Superseded
Headers show
Series
  • IPA: IPU3: Introduce per-frame controls
Related show

Commit Message

Jean-Michel Hautbois Nov. 8, 2021, 1:13 p.m. UTC
The pipeline handler populates the new sensrControls ControlList, to
have the effective exposure and gain values for the current frame. This
is done when a statistics buffer is received.

Make those values the frameContext::agc values for the frame when the
EventStatReady event is received.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/ipu3/ipu3.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kieran Bingham Nov. 8, 2021, 1:54 p.m. UTC | #1
Quoting Jean-Michel Hautbois (2021-11-08 13:13:31)
> The pipeline handler populates the new sensrControls ControlList, to

sensorControls

> have the effective exposure and gain values for the current frame. This
> is done when a statistics buffer is received.
> 
> Make those values the frameContext::agc values for the frame when the
> EventStatReady event is received.
> 
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> ---
>  src/ipa/ipu3/ipu3.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
> index bcc3863b..b4e0d49f 100644
> --- a/src/ipa/ipu3/ipu3.cpp
> +++ b/src/ipa/ipu3/ipu3.cpp
> @@ -549,6 +549,10 @@ void IPAIPU3::processEvent(const IPU3Event &event)
>                 const ipu3_uapi_stats_3a *stats =
>                         reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());
>  
> +               /* \todo move those into processControls */

What's preventing this from being done directly?

> +               context_.frameContext.agc.exposure = event.sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();
> +               context_.frameContext.agc.gain = camHelper_->gain(event.sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());
> +
>                 parseStatistics(event.frame, event.frameTimestamp, stats);
>                 break;
>         }
> -- 
> 2.32.0
>

Patch
diff mbox series

diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index bcc3863b..b4e0d49f 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -549,6 +549,10 @@  void IPAIPU3::processEvent(const IPU3Event &event)
 		const ipu3_uapi_stats_3a *stats =
 			reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());
 
+		/* \todo move those into processControls */
+		context_.frameContext.agc.exposure = event.sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();
+		context_.frameContext.agc.gain = camHelper_->gain(event.sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());
+
 		parseStatistics(event.frame, event.frameTimestamp, stats);
 		break;
 	}