[v1,10/11] ipa: rkisp1: Add compand feature flag to ipa context
diff mbox series

Message ID 20240703225230.3530-11-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • rkisp1: Support BLS on i.MX8MP
Related show

Commit Message

Laurent Pinchart July 3, 2024, 10:52 p.m. UTC
From: Paul Elder <paul.elder@ideasonboard.com>

Add a compand feature flag to the hardware settings section of the IPA
context, so that we can act accordingly for black level subtraction, and
to pave the way to skipping companding appropriately when support for it
is added.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/rkisp1/ipa_context.h |  1 +
 src/ipa/rkisp1/rkisp1.cpp    | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Jacopo Mondi July 4, 2024, 1:38 p.m. UTC | #1
Hi Laurent

On Thu, Jul 04, 2024 at 01:52:29AM GMT, Laurent Pinchart wrote:
> From: Paul Elder <paul.elder@ideasonboard.com>
>
> Add a compand feature flag to the hardware settings section of the IPA
> context, so that we can act accordingly for black level subtraction, and
> to pave the way to skipping companding appropriately when support for it
> is added.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/ipa/rkisp1/ipa_context.h |  1 +
>  src/ipa/rkisp1/rkisp1.cpp    | 14 +++++++++++++-
>  2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
> index 1d0e9030af1c..f5503ada7d8b 100644
> --- a/src/ipa/rkisp1/ipa_context.h
> +++ b/src/ipa/rkisp1/ipa_context.h
> @@ -31,6 +31,7 @@ struct IPAHwSettings {
>  	unsigned int numHistogramBins;
>  	unsigned int numHistogramWeights;
>  	unsigned int numGammaOutSamples;
> +	bool compand;

not thrilled by a boolean. If other ISP blocks will have to be
supported per-platform this will need to be made a 'feature', like
it's been done on the Linux side.

If you prefer, it could be done on top.
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

>  };
>
>  struct IPASessionConfiguration {
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index 1a89eabf10b4..083d5b08caff 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -93,6 +93,15 @@ const IPAHwSettings ipaHwSettingsV10{
>  	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
>  	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
>  	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
> +	false,
> +};
> +
> +const IPAHwSettings ipaHwSettingsIMX8MP{
> +	RKISP1_CIF_ISP_AE_MEAN_MAX_V10,
> +	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
> +	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
> +	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
> +	true,
>  };
>
>  const IPAHwSettings ipaHwSettingsV12{
> @@ -100,6 +109,7 @@ const IPAHwSettings ipaHwSettingsV12{
>  	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12,
>  	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12,
>  	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12,
> +	false,
>  };
>
>  /* List of controls handled by the RkISP1 IPA */
> @@ -130,9 +140,11 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,
>  	/* \todo Add support for other revisions */
>  	switch (hwRevision) {
>  	case RKISP1_V10:
> -	case RKISP1_V_IMX8MP:
>  		context_.hw = &ipaHwSettingsV10;
>  		break;
> +	case RKISP1_V_IMX8MP:
> +		context_.hw = &ipaHwSettingsIMX8MP;
> +		break;
>  	case RKISP1_V12:
>  		context_.hw = &ipaHwSettingsV12;
>  		break;
> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart July 4, 2024, 1:51 p.m. UTC | #2
On Thu, Jul 04, 2024 at 03:38:00PM +0200, Jacopo Mondi wrote:
> On Thu, Jul 04, 2024 at 01:52:29AM GMT, Laurent Pinchart wrote:
> > From: Paul Elder <paul.elder@ideasonboard.com>
> >
> > Add a compand feature flag to the hardware settings section of the IPA
> > context, so that we can act accordingly for black level subtraction, and
> > to pave the way to skipping companding appropriately when support for it
> > is added.
> >
> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  src/ipa/rkisp1/ipa_context.h |  1 +
> >  src/ipa/rkisp1/rkisp1.cpp    | 14 +++++++++++++-
> >  2 files changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
> > index 1d0e9030af1c..f5503ada7d8b 100644
> > --- a/src/ipa/rkisp1/ipa_context.h
> > +++ b/src/ipa/rkisp1/ipa_context.h
> > @@ -31,6 +31,7 @@ struct IPAHwSettings {
> >  	unsigned int numHistogramBins;
> >  	unsigned int numHistogramWeights;
> >  	unsigned int numGammaOutSamples;
> > +	bool compand;
> 
> not thrilled by a boolean. If other ISP blocks will have to be
> supported per-platform this will need to be made a 'feature', like
> it's been done on the Linux side.
> 
> If you prefer, it could be done on top.
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

I'd prefer doing it on top indeed, when we'll have more visibility.

> >  };
> >
> >  struct IPASessionConfiguration {
> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> > index 1a89eabf10b4..083d5b08caff 100644
> > --- a/src/ipa/rkisp1/rkisp1.cpp
> > +++ b/src/ipa/rkisp1/rkisp1.cpp
> > @@ -93,6 +93,15 @@ const IPAHwSettings ipaHwSettingsV10{
> >  	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
> >  	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
> >  	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
> > +	false,
> > +};
> > +
> > +const IPAHwSettings ipaHwSettingsIMX8MP{
> > +	RKISP1_CIF_ISP_AE_MEAN_MAX_V10,
> > +	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
> > +	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
> > +	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
> > +	true,
> >  };
> >
> >  const IPAHwSettings ipaHwSettingsV12{
> > @@ -100,6 +109,7 @@ const IPAHwSettings ipaHwSettingsV12{
> >  	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12,
> >  	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12,
> >  	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12,
> > +	false,
> >  };
> >
> >  /* List of controls handled by the RkISP1 IPA */
> > @@ -130,9 +140,11 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,
> >  	/* \todo Add support for other revisions */
> >  	switch (hwRevision) {
> >  	case RKISP1_V10:
> > -	case RKISP1_V_IMX8MP:
> >  		context_.hw = &ipaHwSettingsV10;
> >  		break;
> > +	case RKISP1_V_IMX8MP:
> > +		context_.hw = &ipaHwSettingsIMX8MP;
> > +		break;
> >  	case RKISP1_V12:
> >  		context_.hw = &ipaHwSettingsV12;
> >  		break;

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
index 1d0e9030af1c..f5503ada7d8b 100644
--- a/src/ipa/rkisp1/ipa_context.h
+++ b/src/ipa/rkisp1/ipa_context.h
@@ -31,6 +31,7 @@  struct IPAHwSettings {
 	unsigned int numHistogramBins;
 	unsigned int numHistogramWeights;
 	unsigned int numGammaOutSamples;
+	bool compand;
 };
 
 struct IPASessionConfiguration {
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 1a89eabf10b4..083d5b08caff 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -93,6 +93,15 @@  const IPAHwSettings ipaHwSettingsV10{
 	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
 	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
 	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
+	false,
+};
+
+const IPAHwSettings ipaHwSettingsIMX8MP{
+	RKISP1_CIF_ISP_AE_MEAN_MAX_V10,
+	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,
+	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,
+	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,
+	true,
 };
 
 const IPAHwSettings ipaHwSettingsV12{
@@ -100,6 +109,7 @@  const IPAHwSettings ipaHwSettingsV12{
 	RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12,
 	RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12,
 	RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12,
+	false,
 };
 
 /* List of controls handled by the RkISP1 IPA */
@@ -130,9 +140,11 @@  int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,
 	/* \todo Add support for other revisions */
 	switch (hwRevision) {
 	case RKISP1_V10:
-	case RKISP1_V_IMX8MP:
 		context_.hw = &ipaHwSettingsV10;
 		break;
+	case RKISP1_V_IMX8MP:
+		context_.hw = &ipaHwSettingsIMX8MP;
+		break;
 	case RKISP1_V12:
 		context_.hw = &ipaHwSettingsV12;
 		break;