[libcamera-devel,2/3] ipa: rkisp1: Add enable field for LSC algorithm in IPA context
diff mbox series

Message ID 20220804141228.417211-3-fsylvestre@baylibre.com
State Accepted
Headers show
Series
  • Add DPF tuning support for RkISP1
Related show

Commit Message

Florian Sylvestre Aug. 4, 2022, 2:12 p.m. UTC
Add an enable variable in the lsc struct in IPASessionConfiguration which
indicates if the lsc algorithm has been configured. This will allow other
algorithms to retrieve this information.

Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>
---
 src/ipa/rkisp1/algorithms/lsc.cpp | 10 ++++++++++
 src/ipa/rkisp1/algorithms/lsc.h   |  1 +
 src/ipa/rkisp1/ipa_context.cpp    |  9 +++++++++
 src/ipa/rkisp1/ipa_context.h      |  4 ++++
 4 files changed, 24 insertions(+)

Comments

Laurent Pinchart Aug. 4, 2022, 10:30 p.m. UTC | #1
Hi Florian,

Thank you for the patch.

On Thu, Aug 04, 2022 at 04:12:27PM +0200, Florian Sylvestre via libcamera-devel wrote:
> Add an enable variable in the lsc struct in IPASessionConfiguration which
> indicates if the lsc algorithm has been configured. This will allow other
> algorithms to retrieve this information.
> 
> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>
> ---
>  src/ipa/rkisp1/algorithms/lsc.cpp | 10 ++++++++++
>  src/ipa/rkisp1/algorithms/lsc.h   |  1 +
>  src/ipa/rkisp1/ipa_context.cpp    |  9 +++++++++
>  src/ipa/rkisp1/ipa_context.h      |  4 ++++
>  4 files changed, 24 insertions(+)
> 
> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
> index 05c8c0da..da287ac7 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.cpp
> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp
> @@ -119,6 +119,16 @@ int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
>  	return 0;
>  }
>  
> +/**
> + * \copydoc libcamera::ipa::Algorithm::configure
> + */
> +int LensShadingCorrection::configure(IPAContext &context,
> +				     [[maybe_unused]] const IPACameraSensorInfo &configInfo)
> +{
> +	context.configuration.lsc.enabled = initialized_;
> +	return 0;
> +}
> +
>  /**
>   * \copydoc libcamera::ipa::Algorithm::prepare
>   */
> diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h
> index fdb2ec1d..f68602c0 100644
> --- a/src/ipa/rkisp1/algorithms/lsc.h
> +++ b/src/ipa/rkisp1/algorithms/lsc.h
> @@ -20,6 +20,7 @@ public:
>  	~LensShadingCorrection() = default;
>  
>  	int init(IPAContext &context, const YamlObject &tuningData) override;
> +	int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
>  	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
>  
>  private:
> diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp
> index d833b8c7..c90bf992 100644
> --- a/src/ipa/rkisp1/ipa_context.cpp
> +++ b/src/ipa/rkisp1/ipa_context.cpp
> @@ -92,6 +92,15 @@ namespace libcamera::ipa::rkisp1 {
>   * \brief Indicates if AWB is enabled
>   */
>  
> +/**
> + * \var IPASessionConfiguration::lsc
> + * \brief Lens Shading Correction configuration of the IPA
> + *
> + * \var IPASessionConfiguration::lsc.enabled
> + * \brief Indicates if LSC is enabled

Same comment as for patch 1/3.

> + *

Extra blank line.

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

> + */
> +
>  /**
>   * \var IPASessionConfiguration::sensor
>   * \brief Sensor-specific configuration of the IPA
> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
> index 7f7b3e4d..0cd6aadb 100644
> --- a/src/ipa/rkisp1/ipa_context.h
> +++ b/src/ipa/rkisp1/ipa_context.h
> @@ -32,6 +32,10 @@ struct IPASessionConfiguration {
>  		bool enabled;
>  	} awb;
>  
> +	struct {
> +		bool enabled;
> +	} lsc;
> +
>  	struct {
>  		utils::Duration lineDuration;
>  		Size size;

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp
index 05c8c0da..da287ac7 100644
--- a/src/ipa/rkisp1/algorithms/lsc.cpp
+++ b/src/ipa/rkisp1/algorithms/lsc.cpp
@@ -119,6 +119,16 @@  int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,
 	return 0;
 }
 
+/**
+ * \copydoc libcamera::ipa::Algorithm::configure
+ */
+int LensShadingCorrection::configure(IPAContext &context,
+				     [[maybe_unused]] const IPACameraSensorInfo &configInfo)
+{
+	context.configuration.lsc.enabled = initialized_;
+	return 0;
+}
+
 /**
  * \copydoc libcamera::ipa::Algorithm::prepare
  */
diff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h
index fdb2ec1d..f68602c0 100644
--- a/src/ipa/rkisp1/algorithms/lsc.h
+++ b/src/ipa/rkisp1/algorithms/lsc.h
@@ -20,6 +20,7 @@  public:
 	~LensShadingCorrection() = default;
 
 	int init(IPAContext &context, const YamlObject &tuningData) override;
+	int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
 	void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
 
 private:
diff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp
index d833b8c7..c90bf992 100644
--- a/src/ipa/rkisp1/ipa_context.cpp
+++ b/src/ipa/rkisp1/ipa_context.cpp
@@ -92,6 +92,15 @@  namespace libcamera::ipa::rkisp1 {
  * \brief Indicates if AWB is enabled
  */
 
+/**
+ * \var IPASessionConfiguration::lsc
+ * \brief Lens Shading Correction configuration of the IPA
+ *
+ * \var IPASessionConfiguration::lsc.enabled
+ * \brief Indicates if LSC is enabled
+ *
+ */
+
 /**
  * \var IPASessionConfiguration::sensor
  * \brief Sensor-specific configuration of the IPA
diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
index 7f7b3e4d..0cd6aadb 100644
--- a/src/ipa/rkisp1/ipa_context.h
+++ b/src/ipa/rkisp1/ipa_context.h
@@ -32,6 +32,10 @@  struct IPASessionConfiguration {
 		bool enabled;
 	} awb;
 
+	struct {
+		bool enabled;
+	} lsc;
+
 	struct {
 		utils::Duration lineDuration;
 		Size size;