[libcamera-devel,v1,2/3] pipeline: ipa: rpi: Return lens controls from ipa->configure()
diff mbox series

Message ID 20230601095630.25443-3-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Default lens behaviour
Related show

Commit Message

Naushir Patuck June 1, 2023, 9:56 a.m. UTC
In addition to sensor controls, return lens controls from
IpaBase::configure() back to the pipeline handler. If there are lens
controls present in the ControlList, action them in the pipeline handler
as part of the configure routine.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 include/libcamera/ipa/raspberrypi.mojom             | 3 ++-
 src/ipa/rpi/common/ipa_base.cpp                     | 2 +-
 src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 6 ++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart June 2, 2023, 6:33 a.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Thu, Jun 01, 2023 at 10:56:29AM +0100, Naushir Patuck via libcamera-devel wrote:
> In addition to sensor controls, return lens controls from
> IpaBase::configure() back to the pipeline handler. If there are lens
> controls present in the ControlList, action them in the pipeline handler
> as part of the configure routine.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

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

> ---
>  include/libcamera/ipa/raspberrypi.mojom             | 3 ++-
>  src/ipa/rpi/common/ipa_base.cpp                     | 2 +-
>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 6 ++++--
>  3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom
> index ba786e647ca1..4f20792e4679 100644
> --- a/include/libcamera/ipa/raspberrypi.mojom
> +++ b/include/libcamera/ipa/raspberrypi.mojom
> @@ -46,7 +46,8 @@ struct ConfigParams {
>  struct ConfigResult {
>  	float modeSensitivity;
>  	libcamera.ControlInfoMap controlInfo;
> -	libcamera.ControlList controls;
> +	libcamera.ControlList sensorControls;
> +	libcamera.ControlList lensControls;
>  };
>  
>  struct StartResult {
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> index db7a0eb3a1ca..599ad146a863 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -201,7 +201,7 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa
>  		applyAGC(&agcStatus, ctrls);
>  	}
>  
> -	result->controls = std::move(ctrls);
> +	result->sensorControls = std::move(ctrls);
>  
>  	/*
>  	 * Apply the correct limits to the exposure, gain and frame duration controls
> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> index 3bb5ec531e4f..2ab0b971149a 100644
> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
> @@ -1192,8 +1192,10 @@ int CameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::Config
>  		return -EPIPE;
>  	}
>  
> -	if (!result->controls.empty())
> -		setSensorControls(result->controls);
> +	if (!result->sensorControls.empty())
> +		setSensorControls(result->sensorControls);
> +	if (!result->lensControls.empty())
> +		setLensControls(result->lensControls);
>  
>  	return 0;
>  }

Patch
diff mbox series

diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom
index ba786e647ca1..4f20792e4679 100644
--- a/include/libcamera/ipa/raspberrypi.mojom
+++ b/include/libcamera/ipa/raspberrypi.mojom
@@ -46,7 +46,8 @@  struct ConfigParams {
 struct ConfigResult {
 	float modeSensitivity;
 	libcamera.ControlInfoMap controlInfo;
-	libcamera.ControlList controls;
+	libcamera.ControlList sensorControls;
+	libcamera.ControlList lensControls;
 };
 
 struct StartResult {
diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index db7a0eb3a1ca..599ad146a863 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -201,7 +201,7 @@  int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa
 		applyAGC(&agcStatus, ctrls);
 	}
 
-	result->controls = std::move(ctrls);
+	result->sensorControls = std::move(ctrls);
 
 	/*
 	 * Apply the correct limits to the exposure, gain and frame duration controls
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 3bb5ec531e4f..2ab0b971149a 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -1192,8 +1192,10 @@  int CameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::Config
 		return -EPIPE;
 	}
 
-	if (!result->controls.empty())
-		setSensorControls(result->controls);
+	if (!result->sensorControls.empty())
+		setSensorControls(result->sensorControls);
+	if (!result->lensControls.empty())
+		setLensControls(result->lensControls);
 
 	return 0;
 }