<div dir="ltr"><div>Hi Laurent,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 26, 2021 at 11:04 PM Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Hiro,<br>
<br>
On Wed, May 26, 2021 at 10:53:29PM +0900, Hirokazu Honda wrote:<br>
> On Wed, May 26, 2021 at 10:10 PM Umang Jain wrote:<br>
> <br>
> > Pass in frame timestamps from IPU3 pipeline handler to IPU3 IPA via<br>
> > IPU3Event. Frame timestamps are helpful to IPA algorithms to<br>
> > convergence, by setting them via IPA stats.<br>
> ><br>
> > Signed-off-by: Umang Jain <<a href="mailto:umang.jain@ideasonboard.com" target="_blank">umang.jain@ideasonboard.com</a>><br>
> > ---<br>
> > include/libcamera/ipa/ipu3.mojom | 1 +<br>
> > src/ipa/ipu3/ipu3.cpp | 4 +++-<br>
> > src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +++--<br>
> > 3 files changed, 7 insertions(+), 3 deletions(-)<br>
> ><br>
> > diff --git a/include/libcamera/ipa/ipu3.mojom<br>
> > b/include/libcamera/ipa/ipu3.mojom<br>
> > index 32c046ad..29b4c805 100644<br>
> > --- a/include/libcamera/ipa/ipu3.mojom<br>
> > +++ b/include/libcamera/ipa/ipu3.mojom<br>
> > @@ -21,6 +21,7 @@ enum IPU3Operations {<br>
> > struct IPU3Event {<br>
> > IPU3Operations op;<br>
> > uint32 frame;<br>
> > + int64 frameTimestamp;<br>
> > uint32 bufferId;<br>
> > libcamera.ControlList controls;<br>
> > };<br>
> > diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp<br>
> > index 769c24d3..581297be 100644<br>
> > --- a/src/ipa/ipu3/ipu3.cpp<br>
> > +++ b/src/ipa/ipu3/ipu3.cpp<br>
> > @@ -53,6 +53,7 @@ private:<br>
> > void processControls(unsigned int frame, const ControlList &controls);<br>
> > void fillParams(unsigned int frame, ipu3_uapi_params *params);<br>
> > void parseStatistics(unsigned int frame,<br>
> > + int64_t frameTimestamp,<br>
> > const ipu3_uapi_stats_3a *stats);<br>
> ><br>
> > void setControls(unsigned int frame);<br>
> > @@ -214,7 +215,7 @@ void IPAIPU3::processEvent(const IPU3Event &event)<br>
> > const ipu3_uapi_stats_3a *stats =<br>
> > reinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());<br>
> ><br>
> > - parseStatistics(event.frame, stats);<br>
> > + parseStatistics(event.frame, event.frameTimestamp, stats);<br>
> > break;<br>
> > }<br>
> > case EventFillParams: {<br>
> > @@ -257,6 +258,7 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)<br>
> > }<br>
> ><br>
> > void IPAIPU3::parseStatistics(unsigned int frame,<br>
> > + [[maybe_unused]] int64_t frameTimestamp,<br>
> > [[maybe_unused]] const ipu3_uapi_stats_3a*stats)<br>
> ><br>
> <br>
> Will the passed frameTimestamp be used in a follow up patch?<br>
<br>
The IPU3 IPA based on the Intel closed-source library<br>
(<a href="https://git.libcamera.org/libcamera/ipu3-ipa.git/" rel="noreferrer" target="_blank">https://git.libcamera.org/libcamera/ipu3-ipa.git/</a>) will use this. I'm<br>
sure the in-tree open-source IPU3 IPA will follow at some point.<br>
<br></blockquote><div><br></div><div>Acked.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> Reviewed-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org" target="_blank">hiroh@chromium.org</a>><br>
> <br>
> > {<br>
> > ControlList ctrls(controls::controls);<br>
> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
> > b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
> > index 750880ed..58923bc7 100644<br>
> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp<br>
> > @@ -1357,6 +1357,8 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)<br>
> > if (!info)<br>
> > return;<br>
> ><br>
> > + Request *request = info->request;<br>
> > +<br>
> > if (buffer->metadata().status == FrameMetadata::FrameCancelled) {<br>
> > info->metadataProcessed = true;<br>
> ><br>
> > @@ -1364,8 +1366,6 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)<br>
> > * tryComplete() will delete info if it completes the IPU3Frame.<br>
> > * In that event, we must have obtained the Request before hand.<br>
> > */<br>
> > - Request *request = info->request;<br>
> > -<br>
> > if (frameInfos_.tryComplete(info))<br>
> > pipe_->completeRequest(request);<br>
> ><br>
> > @@ -1376,6 +1376,7 @@ void IPU3CameraData::statBufferReady(FrameBuffer *buffer)<br>
> > ev.op = ipa::ipu3::EventStatReady;<br>
> > ev.frame = info->id;<br>
> > ev.bufferId = info->statBuffer->cookie();<br>
> > + ev.frameTimestamp = request->metadata().get(controls::SensorTimestamp);<br>
> > ipa_->processEvent(ev);<br>
> > }<br>
> ><br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div></div>