[libcamera-devel] [PATCH 2/3] ipa: ipu3: Mark the beginning and end of a frame

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Apr 21 12:46:06 CEST 2022


Quoting Umang Jain (2022-03-10 20:51:29)
> From: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> 
> Introduce the skeleton for two functions which will be used to
> instantiate a frame context, and do everything needed when a frame is
> received. Do the same for the other end, once the algorithms have run
> and updated the frame context to later deallocate the corresponding
> frame context.
> 
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  src/ipa/ipu3/ipu3.cpp | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
> index 81788b9a..3d5c5706 100644
> --- a/src/ipa/ipu3/ipu3.cpp
> +++ b/src/ipa/ipu3/ipu3.cpp
> @@ -163,6 +163,14 @@ private:
>         void setControls(unsigned int frame);
>         void calculateBdsGrid(const Size &bdsOutputSize);
>  
> +       /*
> +        * Internal events that mark the beginning of processing a new frame
> +        * to the point that it has successfully completed processing its
> +        * statistics.
> +        */
> +       void frameStarted(const uint32_t frame);
> +       void frameCompleted(const uint32_t frame);
> +
>         std::map<unsigned int, MappedFrameBuffer> buffers_;
>  
>         ControlInfoMap ctrls_;
> @@ -491,6 +499,14 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)
>         }
>  }
>  
> +void IPAIPU3::frameStarted([[maybe_unused]] const uint32_t frame)
> +{
> +}
> +
> +void IPAIPU3::frameCompleted([[maybe_unused]] const uint32_t frame)
> +{
> +}
> +
>  /**
>   * \brief Prepare the ISP to process the Request
>   * \param[in] frame The frame number
> @@ -549,6 +565,8 @@ void IPAIPU3::processControls(const uint32_t frame,
>                               [[maybe_unused]] const ControlList &controls)

Aha, I was a bit confused, but I think this is now called queueRequest()

It will be interesting to see how we tie up a request that is queued to
the frame index that it will capture from. I think it works out in the
end, as long as we ensure that requests are queued before we start the
camera ...

(and now I can't recall, do we support starting the camera without
requests queued?...)


>  {
>         /* \todo Start processing for 'frame' based on 'controls'. */
> +
> +       frameStarted(frame);
>  }
>  
>  /**
> @@ -620,6 +638,8 @@ void IPAIPU3::parseStatistics(unsigned int frame,
>          */
>  
>         statsBufferReady.emit(frame, ctrls);
> +
> +       frameCompleted(frame);
>  }
>  
>  /**
> -- 
> 2.31.0
>


More information about the libcamera-devel mailing list