[v2,2/2] libcamera: libipa: camera_sensor: Add Sony IMX335 sensor properties
diff mbox series

Message ID 20240426132516.11085-3-umang.jain@ideasonboard.com
State New
Headers show
Series
  • libipa: Add IMX283 and IMx335 sensor helpers
Related show

Commit Message

Umang Jain April 26, 2024, 1:25 p.m. UTC
From: Kieran Bingham <kieran.bingham@ideasonboard.com>

Provide the Sony IMX335 camera sensor properties and registration
with libipa for the gain code helpers.

The test patterns exposed by the IMX335 do not map well to the current
set of test pattern controls supplied by libcamera. These are left
inentionally unimplemented.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/ipa/libipa/camera_sensor_helper.cpp           | 11 +++++++++++
 src/libcamera/sensor/camera_sensor_properties.cpp |  4 ++++
 2 files changed, 15 insertions(+)

Comments

Stefan Klug April 29, 2024, 9:26 a.m. UTC | #1
Hi Umang,

thanks for the patch.

On Fri, Apr 26, 2024 at 06:55:16PM +0530, Umang Jain wrote:
> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Provide the Sony IMX335 camera sensor properties and registration
> with libipa for the gain code helpers.
> 
> The test patterns exposed by the IMX335 do not map well to the current
> set of test pattern controls supplied by libcamera. These are left
> inentionally unimplemented.

s/inentionally/intentionally/

Otherwise looks good to me.
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> 

Cheers,
Stefan

> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp           | 11 +++++++++++
>  src/libcamera/sensor/camera_sensor_properties.cpp |  4 ++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index f70d898f..84d52d10 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -455,6 +455,17 @@ class CameraSensorHelperImx327 : public CameraSensorHelperImx290
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
>  
> +class CameraSensorHelperImx335 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperImx335()
> +	{
> +		gainType_ = AnalogueGainExponential;
> +		gainConstants_.exp = { 1.0, expGainDb(0.3) };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> +
>  class CameraSensorHelperImx477 : public CameraSensorHelper
>  {
>  public:
> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
> index 4eabbbda..895bf967 100644
> --- a/src/libcamera/sensor/camera_sensor_properties.cpp
> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp
> @@ -115,6 +115,10 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>  			.unitCellSize = { 2900, 2900 },
>  			.testPatternModes = {},
>  		} },
> +		{ "imx335", {
> +			.unitCellSize = { 2000, 2000 },
> +			.testPatternModes = {},
> +		} },
>  		{ "imx477", {
>  			.unitCellSize = { 1550, 1550 },
>  			.testPatternModes = {},
> -- 
> 2.44.0
>
Jacopo Mondi May 2, 2024, 3:30 p.m. UTC | #2
Hi Umang

On Fri, Apr 26, 2024 at 06:55:16PM +0530, Umang Jain wrote:
> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> Provide the Sony IMX335 camera sensor properties and registration
> with libipa for the gain code helpers.
>
> The test patterns exposed by the IMX335 do not map well to the current
> set of test pattern controls supplied by libcamera. These are left
> inentionally unimplemented.

intentionally

Do we have dumps of these test patterns (for this and the imx283) as
the datahseet doesn't report them ?


>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
>  src/ipa/libipa/camera_sensor_helper.cpp           | 11 +++++++++++
>  src/libcamera/sensor/camera_sensor_properties.cpp |  4 ++++
>  2 files changed, 15 insertions(+)
>
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index f70d898f..84d52d10 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -455,6 +455,17 @@ class CameraSensorHelperImx327 : public CameraSensorHelperImx290
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
>
> +class CameraSensorHelperImx335 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperImx335()
> +	{
> +		gainType_ = AnalogueGainExponential;
> +		gainConstants_.exp = { 1.0, expGainDb(0.3) };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> +
>  class CameraSensorHelperImx477 : public CameraSensorHelper
>  {
>  public:
> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
> index 4eabbbda..895bf967 100644
> --- a/src/libcamera/sensor/camera_sensor_properties.cpp
> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp
> @@ -115,6 +115,10 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>  			.unitCellSize = { 2900, 2900 },
>  			.testPatternModes = {},
>  		} },
> +		{ "imx335", {
> +			.unitCellSize = { 2000, 2000 },
> +			.testPatternModes = {},
> +		} },
>  		{ "imx477", {
>  			.unitCellSize = { 1550, 1550 },
>  			.testPatternModes = {},
> --
> 2.44.0
>
Laurent Pinchart May 2, 2024, 3:39 p.m. UTC | #3
Hi Umang,

Thank you for the patch.

On Fri, Apr 26, 2024 at 06:55:16PM +0530, Umang Jain wrote:
> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Provide the Sony IMX335 camera sensor properties and registration
> with libipa for the gain code helpers.
> 
> The test patterns exposed by the IMX335 do not map well to the current
> set of test pattern controls supplied by libcamera. These are left
> inentionally unimplemented.

s/inentionally/intentionally/

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

> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/ipa/libipa/camera_sensor_helper.cpp           | 11 +++++++++++
>  src/libcamera/sensor/camera_sensor_properties.cpp |  4 ++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
> index f70d898f..84d52d10 100644
> --- a/src/ipa/libipa/camera_sensor_helper.cpp
> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
> @@ -455,6 +455,17 @@ class CameraSensorHelperImx327 : public CameraSensorHelperImx290
>  };
>  REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
>  
> +class CameraSensorHelperImx335 : public CameraSensorHelper
> +{
> +public:
> +	CameraSensorHelperImx335()
> +	{
> +		gainType_ = AnalogueGainExponential;
> +		gainConstants_.exp = { 1.0, expGainDb(0.3) };
> +	}
> +};
> +REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
> +
>  class CameraSensorHelperImx477 : public CameraSensorHelper
>  {
>  public:
> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
> index 4eabbbda..895bf967 100644
> --- a/src/libcamera/sensor/camera_sensor_properties.cpp
> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp
> @@ -115,6 +115,10 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>  			.unitCellSize = { 2900, 2900 },
>  			.testPatternModes = {},
>  		} },
> +		{ "imx335", {
> +			.unitCellSize = { 2000, 2000 },
> +			.testPatternModes = {},
> +		} },
>  		{ "imx477", {
>  			.unitCellSize = { 1550, 1550 },
>  			.testPatternModes = {},
Umang Jain May 3, 2024, 5:57 a.m. UTC | #4
Hi Jacopo,

On 02/05/24 9:00 pm, Jacopo Mondi wrote:
> Hi Umang
>
> On Fri, Apr 26, 2024 at 06:55:16PM +0530, Umang Jain wrote:
>> From: Kieran Bingham <kieran.bingham@ideasonboard.com>
>>
>> Provide the Sony IMX335 camera sensor properties and registration
>> with libipa for the gain code helpers.
>>
>> The test patterns exposed by the IMX335 do not map well to the current
>> set of test pattern controls supplied by libcamera. These are left
>> inentionally unimplemented.
> intentionally
>
> Do we have dumps of these test patterns (for this and the imx283) as
> the datahseet doesn't report them ?

we do have dumps of them and the latest imx335 driver does exposes them 
correctly.

See:
https://git.linuxtv.org/media_stage.git/commit/?id=37e83782f9dd7bb830ef4714f04fae6605e43221

We need appropriate mapping of libcamera test pattern modes that needs 
to be introduced (for both IMX283 and IMX335).

>
>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
>
> Thanks
>    j
>
>> ---
>>   src/ipa/libipa/camera_sensor_helper.cpp           | 11 +++++++++++
>>   src/libcamera/sensor/camera_sensor_properties.cpp |  4 ++++
>>   2 files changed, 15 insertions(+)
>>
>> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
>> index f70d898f..84d52d10 100644
>> --- a/src/ipa/libipa/camera_sensor_helper.cpp
>> +++ b/src/ipa/libipa/camera_sensor_helper.cpp
>> @@ -455,6 +455,17 @@ class CameraSensorHelperImx327 : public CameraSensorHelperImx290
>>   };
>>   REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
>>
>> +class CameraSensorHelperImx335 : public CameraSensorHelper
>> +{
>> +public:
>> +	CameraSensorHelperImx335()
>> +	{
>> +		gainType_ = AnalogueGainExponential;
>> +		gainConstants_.exp = { 1.0, expGainDb(0.3) };
>> +	}
>> +};
>> +REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
>> +
>>   class CameraSensorHelperImx477 : public CameraSensorHelper
>>   {
>>   public:
>> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
>> index 4eabbbda..895bf967 100644
>> --- a/src/libcamera/sensor/camera_sensor_properties.cpp
>> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp
>> @@ -115,6 +115,10 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>>   			.unitCellSize = { 2900, 2900 },
>>   			.testPatternModes = {},
>>   		} },
>> +		{ "imx335", {
>> +			.unitCellSize = { 2000, 2000 },
>> +			.testPatternModes = {},
>> +		} },
>>   		{ "imx477", {
>>   			.unitCellSize = { 1550, 1550 },
>>   			.testPatternModes = {},
>> --
>> 2.44.0
>>

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index f70d898f..84d52d10 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -455,6 +455,17 @@  class CameraSensorHelperImx327 : public CameraSensorHelperImx290
 };
 REGISTER_CAMERA_SENSOR_HELPER("imx327", CameraSensorHelperImx327)
 
+class CameraSensorHelperImx335 : public CameraSensorHelper
+{
+public:
+	CameraSensorHelperImx335()
+	{
+		gainType_ = AnalogueGainExponential;
+		gainConstants_.exp = { 1.0, expGainDb(0.3) };
+	}
+};
+REGISTER_CAMERA_SENSOR_HELPER("imx335", CameraSensorHelperImx335)
+
 class CameraSensorHelperImx477 : public CameraSensorHelper
 {
 public:
diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
index 4eabbbda..895bf967 100644
--- a/src/libcamera/sensor/camera_sensor_properties.cpp
+++ b/src/libcamera/sensor/camera_sensor_properties.cpp
@@ -115,6 +115,10 @@  const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
 			.unitCellSize = { 2900, 2900 },
 			.testPatternModes = {},
 		} },
+		{ "imx335", {
+			.unitCellSize = { 2000, 2000 },
+			.testPatternModes = {},
+		} },
 		{ "imx477", {
 			.unitCellSize = { 1550, 1550 },
 			.testPatternModes = {},