[libcamera-devel] [PATCH v3 12/14] ipa: ipu3: Cache line duration at configure call

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Nov 12 14:18:50 CET 2021


Quoting Jean-Michel Hautbois (2021-11-11 13:58:57)
> 
> 
> On 11/11/2021 14:21, Kieran Bingham wrote:
> > Quoting Jean-Michel Hautbois (2021-11-11 11:06:03)
> >> We use the line duration several times in the IPAIPU3. Instead of
> >> recalculating it each time, cache the value as a utils::Duration. When
> >> the value is needed in double, cast it to a std::micro value.
> > 
> > The value isn't needed in a double. It's needed to calculate the
> > exposure in microseconds... It's just that it returns a double. It could
> > be an int for all the calculation cares...
> 
> OK, I made the message:
> s/the value is needed in double, cast it/the value is needed, cast it/

I'll check in v4...

> >> As sensorInfo is no longer used in updateSessionConfiguration remove the
> >> reference to it.
> >>
> >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> >> ---
> >> +       int64_t frameDuration = (defVBlank_ + sensorInfo_.outputSize.height) * lineDuration_.get<std::micro>();
> > 
> > Perhaps could make that
> >       int64_t frameDuration = (defVBlank_ + sensorInfo_.outputSize.height)
> >                             * lineDuration_.get<std::micro>();
> > 
> > to shorten the line, but that's optional.
> 
> And checkstyle is not happy... ;-)

Unfortuantely, checkstyle is still fallable. We have to decide for
ourselves in some cases.

If we could tell clang-format "Prefer less than 80, but it's acceptable
to go to 120 in some/extreme cases" and it to know what those extreme
cases were - then maybe it would do different... but it's just not so
easy :-(

Anyway, it's optional for me ;-)

> > 
> > With the commit message update:
> > 
> > 
> > Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > 
> >>          ctrls.set(controls::FrameDuration, frameDuration);
> >>   
> >>          ctrls.set(controls::ColourTemperature, context_.frameContext.awb.temperatureK);
> >> -- 
> >> 2.32.0
> >>


More information about the libcamera-devel mailing list