[libcamera-devel,RFC,5/6] libcamera: ipu3: Initialize draft properties

Message ID 20200911162039.61933-6-jacopo@jmondi.org
State Superseded, archived
Delegated to: Jacopo Mondi
Headers show
Series
  • libcamera: Define draft controls and properties
Related show

Commit Message

Jacopo Mondi Sept. 11, 2020, 4:20 p.m. UTC
Initialize three draft properties for the IPU3 platform.

IPU3 reports a maximum of three processing stages: exposure, capture and
ISP processing and does not support noise reduction and color
aberration.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Niklas Söderlund Sept. 13, 2020, 11:39 a.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2020-09-11 18:20:38 +0200, Jacopo Mondi wrote:
> Initialize three draft properties for the IPU3 platform.
> 
> IPU3 reports a maximum of three processing stages: exposure, capture and
> ISP processing and does not support noise reduction and color
> aberration.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 2d881fe28f98..9ce329a83f5d 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -13,6 +13,7 @@
>  
>  #include <libcamera/camera.h>
>  #include <libcamera/formats.h>
> +#include <libcamera/property_ids.h>
>  #include <libcamera/request.h>
>  #include <libcamera/stream.h>
>  
> @@ -776,7 +777,14 @@ int PipelineHandlerIPU3::registerCameras()
>  			continue;
>  
>  		/* Initialize the camera properties. */
> -		data->properties_ = cio2->sensor()->properties();
> +		for (const auto &sensorProperty : cio2->sensor()->properties())
> +			data->properties_.set(sensorProperty.first,
> +					      sensorProperty.second);
> +		data->properties_.set(properties::DraftPipelineMaxDepth, 3);
> +		data->properties_.set(properties::DraftAvailableNoiseReductionModes,
> +				      { static_cast<int32_t>(properties::DRAFT_NOISE_REDUCTION_MODE_OFF) });
> +		data->properties_.set(properties::DraftAvailableColorCorrectionAberrationModes,
> +				      { static_cast<int32_t>(properties::DRAFT_COLOR_CORRECTION_ABERRATION_OFF) });
>  
>  		/**
>  		 * \todo Dynamically assign ImgU and output devices to each
> -- 
> 2.28.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham Oct. 7, 2020, 6:36 p.m. UTC | #2
Hi Jacopo,

On 13/09/2020 12:39, Niklas Söderlund wrote:
> Hi Jacopo,
> 
> Thanks for your work.
> 
> On 2020-09-11 18:20:38 +0200, Jacopo Mondi wrote:
>> Initialize three draft properties for the IPU3 platform.
>>
>> IPU3 reports a maximum of three processing stages: exposure, capture and
>> ISP processing and does not support noise reduction and color
>> aberration.
>>
>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> 
> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> 
>> ---
>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
>> index 2d881fe28f98..9ce329a83f5d 100644
>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
>> @@ -13,6 +13,7 @@
>>  
>>  #include <libcamera/camera.h>
>>  #include <libcamera/formats.h>
>> +#include <libcamera/property_ids.h>
>>  #include <libcamera/request.h>
>>  #include <libcamera/stream.h>
>>  
>> @@ -776,7 +777,14 @@ int PipelineHandlerIPU3::registerCameras()
>>  			continue;
>>  
>>  		/* Initialize the camera properties. */
>> -		data->properties_ = cio2->sensor()->properties();
>> +		for (const auto &sensorProperty : cio2->sensor()->properties())
>> +			data->properties_.set(sensorProperty.first,
>> +					      sensorProperty.second);

Why does this need to change here?

Perhaps that's because of the previous patch... I guess the previous
patch has set data->properties to be initialised with all properties and
their defaults? (I'm still confused if that's needed.) - so this only
updates properties that are in the sensor...




>> +		data->properties_.set(properties::DraftPipelineMaxDepth, 3);
>> +		data->properties_.set(properties::DraftAvailableNoiseReductionModes,
>> +				      { static_cast<int32_t>(properties::DRAFT_NOISE_REDUCTION_MODE_OFF) });

Is the cast necessary here?

>> +		data->properties_.set(properties::DraftAvailableColorCorrectionAberrationModes,
>> +				      { static_cast<int32_t>(properties::DRAFT_COLOR_CORRECTION_ABERRATION_OFF) });
>>  
>>  		/**
>>  		 * \todo Dynamically assign ImgU and output devices to each
>> -- 
>> 2.28.0
>>
>> _______________________________________________
>> libcamera-devel mailing list
>> libcamera-devel@lists.libcamera.org
>> https://lists.libcamera.org/listinfo/libcamera-devel
>
Jacopo Mondi Oct. 8, 2020, 10:29 a.m. UTC | #3
Hi Kieran,

On Wed, Oct 07, 2020 at 07:36:41PM +0100, Kieran Bingham wrote:
> Hi Jacopo,
>
> On 13/09/2020 12:39, Niklas Söderlund wrote:
> > Hi Jacopo,
> >
> > Thanks for your work.
> >
> > On 2020-09-11 18:20:38 +0200, Jacopo Mondi wrote:
> >> Initialize three draft properties for the IPU3 platform.
> >>
> >> IPU3 reports a maximum of three processing stages: exposure, capture and
> >> ISP processing and does not support noise reduction and color
> >> aberration.
> >>
> >> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
> >
> > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> >
> >> ---
> >>  src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++++-
> >>  1 file changed, 9 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> index 2d881fe28f98..9ce329a83f5d 100644
> >> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> >> @@ -13,6 +13,7 @@
> >>
> >>  #include <libcamera/camera.h>
> >>  #include <libcamera/formats.h>
> >> +#include <libcamera/property_ids.h>
> >>  #include <libcamera/request.h>
> >>  #include <libcamera/stream.h>
> >>
> >> @@ -776,7 +777,14 @@ int PipelineHandlerIPU3::registerCameras()
> >>  			continue;
> >>
> >>  		/* Initialize the camera properties. */
> >> -		data->properties_ = cio2->sensor()->properties();
> >> +		for (const auto &sensorProperty : cio2->sensor()->properties())
> >> +			data->properties_.set(sensorProperty.first,
> >> +					      sensorProperty.second);
>
> Why does this need to change here?
>
> Perhaps that's because of the previous patch... I guess the previous
> patch has set data->properties to be initialised with all properties and
> their defaults? (I'm still confused if that's needed.) - so this only
> updates properties that are in the sensor...

No the previous patch initialized properties_ with an idmap, but the
'content' is empty until you don't add Control and ControlValues to
the list by calling ControlList::set().

On this change: I could have kept the original line, i felt it was
clearer to add sensor controls one by one to the properties list. I
can drop this line and just add the pipeline controls has it's done
here below.

Thanks
  j

>
>
>
>
> >> +		data->properties_.set(properties::DraftPipelineMaxDepth, 3);
> >> +		data->properties_.set(properties::DraftAvailableNoiseReductionModes,
> >> +				      { static_cast<int32_t>(properties::DRAFT_NOISE_REDUCTION_MODE_OFF) });
>
> Is the cast necessary here?
>
> >> +		data->properties_.set(properties::DraftAvailableColorCorrectionAberrationModes,
> >> +				      { static_cast<int32_t>(properties::DRAFT_COLOR_CORRECTION_ABERRATION_OFF) });
> >>
> >>  		/**
> >>  		 * \todo Dynamically assign ImgU and output devices to each
> >> --
> >> 2.28.0
> >>
> >> _______________________________________________
> >> libcamera-devel mailing list
> >> libcamera-devel@lists.libcamera.org
> >> https://lists.libcamera.org/listinfo/libcamera-devel
> >
>
> --
> Regards
> --
> Kieran

Patch

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 2d881fe28f98..9ce329a83f5d 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -13,6 +13,7 @@ 
 
 #include <libcamera/camera.h>
 #include <libcamera/formats.h>
+#include <libcamera/property_ids.h>
 #include <libcamera/request.h>
 #include <libcamera/stream.h>
 
@@ -776,7 +777,14 @@  int PipelineHandlerIPU3::registerCameras()
 			continue;
 
 		/* Initialize the camera properties. */
-		data->properties_ = cio2->sensor()->properties();
+		for (const auto &sensorProperty : cio2->sensor()->properties())
+			data->properties_.set(sensorProperty.first,
+					      sensorProperty.second);
+		data->properties_.set(properties::DraftPipelineMaxDepth, 3);
+		data->properties_.set(properties::DraftAvailableNoiseReductionModes,
+				      { static_cast<int32_t>(properties::DRAFT_NOISE_REDUCTION_MODE_OFF) });
+		data->properties_.set(properties::DraftAvailableColorCorrectionAberrationModes,
+				      { static_cast<int32_t>(properties::DRAFT_COLOR_CORRECTION_ABERRATION_OFF) });
 
 		/**
 		 * \todo Dynamically assign ImgU and output devices to each