[1/3] ipa: rkisp1: Add debug log for the sensor controls being set
diff mbox series

Message ID 20250228125600.3241397-2-stefan.klug@ideasonboard.com
State Accepted
Headers show
Series
  • rkisp1: Reduce oscillations on startup
Related show

Commit Message

Stefan Klug Feb. 28, 2025, 12:55 p.m. UTC
In the algorithms a lot of information get's logged in debug log level,
but there is no place where the values sent to the sensor get logged.
Add such a log message.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/rkisp1/rkisp1.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kieran Bingham March 4, 2025, 9:13 p.m. UTC | #1
Quoting Stefan Klug (2025-02-28 12:55:53)
> In the algorithms a lot of information get's logged in debug log level,
> but there is no place where the values sent to the sensor get logged.
> Add such a log message.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/ipa/rkisp1/rkisp1.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index 7547d2f274f4..5f1583e8219b 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -455,6 +455,11 @@ void IPARkISP1::setControls(unsigned int frame)
>         uint32_t gain = context_.camHelper->gainCode(frameContext.agc.gain);
>         uint32_t vblank = frameContext.agc.vblank;
>  
> +       LOG(IPARkISP1, Debug) << "Set controls frame " << frame
> +                             << ": exposure " << exposure
> +                             << ", gain " << frameContext.agc.gain
> +                             << ", vblank " << vblank;
> +
>         ControlList ctrls(sensorControls_);
>         ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure));
>         ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain));
> -- 
> 2.43.0
>
Laurent Pinchart March 26, 2025, noon UTC | #2
Hi Stefan,

Thank you for the patch.

On Fri, Feb 28, 2025 at 01:55:53PM +0100, Stefan Klug wrote:
> In the algorithms a lot of information get's logged in debug log level,
> but there is no place where the values sent to the sensor get logged.
> Add such a log message.
> 
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>  src/ipa/rkisp1/rkisp1.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index 7547d2f274f4..5f1583e8219b 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -455,6 +455,11 @@ void IPARkISP1::setControls(unsigned int frame)
>  	uint32_t gain = context_.camHelper->gainCode(frameContext.agc.gain);
>  	uint32_t vblank = frameContext.agc.vblank;
>  
> +	LOG(IPARkISP1, Debug) << "Set controls frame " << frame

Maybe s/frame/for frame/

> +			      << ": exposure " << exposure
> +			      << ", gain " << frameContext.agc.gain
> +			      << ", vblank " << vblank;

Our usual coding style would be

	LOG(IPARkISP1, Debug)
		<< "Set controls for frame " << frame << ": exposure " << exposure
		<< ", gain " << frameContext.agc.gain << ", vblank " << vblank;

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
>  	ControlList ctrls(sensorControls_);
>  	ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure));
>  	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain));
Stefan Klug March 26, 2025, 12:44 p.m. UTC | #3
Hi Laurent,

Thank you for the review. 

On Wed, Mar 26, 2025 at 02:00:08PM +0200, Laurent Pinchart wrote:
> Hi Stefan,
> 
> Thank you for the patch.
> 
> On Fri, Feb 28, 2025 at 01:55:53PM +0100, Stefan Klug wrote:
> > In the algorithms a lot of information get's logged in debug log level,
> > but there is no place where the values sent to the sensor get logged.
> > Add such a log message.
> > 
> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> > ---
> >  src/ipa/rkisp1/rkisp1.cpp | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> > index 7547d2f274f4..5f1583e8219b 100644
> > --- a/src/ipa/rkisp1/rkisp1.cpp
> > +++ b/src/ipa/rkisp1/rkisp1.cpp
> > @@ -455,6 +455,11 @@ void IPARkISP1::setControls(unsigned int frame)
> >  	uint32_t gain = context_.camHelper->gainCode(frameContext.agc.gain);
> >  	uint32_t vblank = frameContext.agc.vblank;
> >  
> > +	LOG(IPARkISP1, Debug) << "Set controls frame " << frame
> 
> Maybe s/frame/for frame/
> 
> > +			      << ": exposure " << exposure
> > +			      << ", gain " << frameContext.agc.gain
> > +			      << ", vblank " << vblank;
> 
> Our usual coding style would be
> 
> 	LOG(IPARkISP1, Debug)
> 		<< "Set controls for frame " << frame << ": exposure " << exposure
> 		<< ", gain " << frameContext.agc.gain << ", vblank " << vblank;

Oh I wasn't aware of that. I'll apply the fixes when merging.

Cheers,
Stefan

> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > +
> >  	ControlList ctrls(sensorControls_);
> >  	ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure));
> >  	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain));
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 7547d2f274f4..5f1583e8219b 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -455,6 +455,11 @@  void IPARkISP1::setControls(unsigned int frame)
 	uint32_t gain = context_.camHelper->gainCode(frameContext.agc.gain);
 	uint32_t vblank = frameContext.agc.vblank;
 
+	LOG(IPARkISP1, Debug) << "Set controls frame " << frame
+			      << ": exposure " << exposure
+			      << ", gain " << frameContext.agc.gain
+			      << ", vblank " << vblank;
+
 	ControlList ctrls(sensorControls_);
 	ctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure));
 	ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain));