[libcamera-devel] [PATCH v2 02/11] ipa: rkisp1: Pass IPASettings at init call

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Nov 23 11:42:36 CET 2021


Hi Jean-Michel,

Thank you for the patch.

On Tue, Nov 23, 2021 at 10:14:42AM +0100, Jean-Michel Hautbois wrote:
> When the IPA is initialized, it will need to know the sensor model
> used in order to properly call CameraSensorHelper for the analogue gain.
> Modify the init definition in the pipeline handler and in the IPA as
> well as the mojo interface to pass the IPASettings.
> 
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
> ---
>  include/libcamera/ipa/rkisp1.mojom       | 4 +++-
>  src/ipa/rkisp1/rkisp1.cpp                | 5 +++--
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +-
>  3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom
> index cae757ea..a6991d4f 100644
> --- a/include/libcamera/ipa/rkisp1.mojom
> +++ b/include/libcamera/ipa/rkisp1.mojom
> @@ -29,7 +29,9 @@ struct RkISP1Action {
>  };
>  
>  interface IPARkISP1Interface {
> -	init(uint32 hwRevision) => (int32 ret);
> +	init(libcamera.IPASettings settings,
> +	     uint32 hwRevision)

It may make sense to add the hw revision to IPASettings later. For now,

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

> +		=> (int32 ret);
>  	start() => (int32 ret);
>  	stop();
>  
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index bf2c13b6..7ecbf8ae 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -34,7 +34,7 @@ namespace ipa::rkisp1 {
>  class IPARkISP1 : public IPARkISP1Interface
>  {
>  public:
> -	int init(unsigned int hwRevision) override;
> +	int init(const IPASettings &settings, unsigned int hwRevision) override;
>  	int start() override;
>  	void stop() override {}
>  
> @@ -75,7 +75,8 @@ private:
>  	unsigned int hwHistogramWeightGridsSize_;
>  };
>  
> -int IPARkISP1::init(unsigned int hwRevision)
> +int IPARkISP1::init([[maybe_unused]] const IPASettings &settings,
> +		    unsigned int hwRevision)
>  {
>  	/* \todo Add support for other revisions */
>  	switch (hwRevision) {
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 98008862..6cdc4c03 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -319,7 +319,7 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)
>  	ipa_->queueFrameAction.connect(this,
>  				       &RkISP1CameraData::queueFrameAction);
>  
> -	int ret = ipa_->init(hwRevision);
> +	int ret = ipa_->init(IPASettings{ "", sensor_->model() }, hwRevision);
>  	if (ret < 0) {
>  		LOG(RkISP1, Error) << "IPA initialization failure";
>  		return ret;

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list