[libcamera-devel] libcamera: camera_sensor: Add IMX519 sensor properties
diff mbox series

Message ID 20221115151816.16078-1-umang.jain@ideasonboard.com
State Accepted
Commit e3b26b4c4eb2582ea778a38545a8ac7801384db2
Headers show
Series
  • [libcamera-devel] libcamera: camera_sensor: Add IMX519 sensor properties
Related show

Commit Message

Umang Jain Nov. 15, 2022, 3:18 p.m. UTC
Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array
and supports four test pattern modes.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jacopo Mondi Nov. 23, 2022, 5:32 p.m. UTC | #1
On Tue, Nov 15, 2022 at 08:48:15PM +0530, Umang Jain via libcamera-devel wrote:
> Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array
> and supports four test pattern modes.
>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>  src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> index e5f27f06..04d80d6d 100644
> --- a/src/libcamera/camera_sensor_properties.cpp
> +++ b/src/libcamera/camera_sensor_properties.cpp
> @@ -102,6 +102,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>  			.unitCellSize = { 1550, 1550 },
>  			.testPatternModes = {},
>  		} },
> +		{ "imx519", {
> +			.unitCellSize = { 1220, 1220 },
> +			.testPatternModes = {
> +				{ controls::draft::TestPatternModeOff, 0 },
> +				{ controls::draft::TestPatternModeColorBars, 1 },
> +				{ controls::draft::TestPatternModeSolidColor, 2 },
> +				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
> +				{ controls::draft::TestPatternModePn9, 4 },
> +			},
> +		} },

I don't have documentation, so it looks reasonable to me :)

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

>  		{ "ov2740", {
>  			.unitCellSize = { 1400, 1400 },
>  			.testPatternModes = {
> --
> 2.37.3
>
Laurent Pinchart Nov. 23, 2022, 5:58 p.m. UTC | #2
On Wed, Nov 23, 2022 at 06:32:20PM +0100, Jacopo Mondi via libcamera-devel wrote:
> On Tue, Nov 15, 2022 at 08:48:15PM +0530, Umang Jain via libcamera-devel wrote:
> > Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array

It's the pixel size, not the pixel array.

> > and supports four test pattern modes.
> >
> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> > ---
> >  src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> > index e5f27f06..04d80d6d 100644
> > --- a/src/libcamera/camera_sensor_properties.cpp
> > +++ b/src/libcamera/camera_sensor_properties.cpp
> > @@ -102,6 +102,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
> >  			.unitCellSize = { 1550, 1550 },
> >  			.testPatternModes = {},
> >  		} },
> > +		{ "imx519", {
> > +			.unitCellSize = { 1220, 1220 },
> > +			.testPatternModes = {
> > +				{ controls::draft::TestPatternModeOff, 0 },
> > +				{ controls::draft::TestPatternModeColorBars, 1 },
> > +				{ controls::draft::TestPatternModeSolidColor, 2 },
> > +				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
> > +				{ controls::draft::TestPatternModePn9, 4 },
> > +			},
> > +		} },
> 
> I don't have documentation, so it looks reasonable to me :)
> 
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Umang, do you have access to that camera module ? If so, have you been
able to compare the test patterns with the CCS specification ? If so,
with the commit message update,

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

> >  		{ "ov2740", {
> >  			.unitCellSize = { 1400, 1400 },
> >  			.testPatternModes = {
Umang Jain Nov. 30, 2022, 5:45 p.m. UTC | #3
Hi Laurent,

On 11/24/22 1:58 AM, Laurent Pinchart wrote:
> On Wed, Nov 23, 2022 at 06:32:20PM +0100, Jacopo Mondi via libcamera-devel wrote:
>> On Tue, Nov 15, 2022 at 08:48:15PM +0530, Umang Jain via libcamera-devel wrote:
>>> Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array
> It's the pixel size, not the pixel array.
ack
>
>>> and supports four test pattern modes.
>>>
>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>>> ---
>>>   src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
>>>   1 file changed, 10 insertions(+)
>>>
>>> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
>>> index e5f27f06..04d80d6d 100644
>>> --- a/src/libcamera/camera_sensor_properties.cpp
>>> +++ b/src/libcamera/camera_sensor_properties.cpp
>>> @@ -102,6 +102,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>>>   			.unitCellSize = { 1550, 1550 },
>>>   			.testPatternModes = {},
>>>   		} },
>>> +		{ "imx519", {
>>> +			.unitCellSize = { 1220, 1220 },
>>> +			.testPatternModes = {
>>> +				{ controls::draft::TestPatternModeOff, 0 },
>>> +				{ controls::draft::TestPatternModeColorBars, 1 },
>>> +				{ controls::draft::TestPatternModeSolidColor, 2 },
>>> +				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
>>> +				{ controls::draft::TestPatternModePn9, 4 },
>>> +			},
>>> +		} },
>> I don't have documentation, so it looks reasonable to me :)
>>
>> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> Umang, do you have access to that camera module ? If so, have you been
> able to compare the test patterns with the CCS specification ? If so,
> with the commit message update,

So there are couple of things off with test patterns I obtained.

- The CCS specification say [1] for Solid Color and [2] for 100% Color 
Bars. IMX519 got these indexes swapped while reporting via v4l2-ctl atleast
- There is no 'ColorBars' and 'ColorBarsFadeToGray' patterns in my 
testing  which comply with CCS's patterns atleast.

What I obttained is the following:

[0]: (disabled)
[1]: Two color bars only Aqua and Yellow (Does this count as color bars?)
[2]: Solid Color (white)
[3]: Same as [1]
[4]: PN9 seems fine

If you need visual samples let me know, I'll send it to you.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
>>>   		{ "ov2740", {
>>>   			.unitCellSize = { 1400, 1400 },
>>>   			.testPatternModes = {
Umang Jain Dec. 1, 2022, 4:30 a.m. UTC | #4
Hi Laurent,

On 12/1/22 1:45 AM, Umang Jain via libcamera-devel wrote:
> Hi Laurent,
>
> On 11/24/22 1:58 AM, Laurent Pinchart wrote:
>> On Wed, Nov 23, 2022 at 06:32:20PM +0100, Jacopo Mondi via 
>> libcamera-devel wrote:
>>> On Tue, Nov 15, 2022 at 08:48:15PM +0530, Umang Jain via 
>>> libcamera-devel wrote:
>>>> Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array
>> It's the pixel size, not the pixel array.
> ack
>>
>>>> and supports four test pattern modes.
>>>>
>>>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
>>>> ---
>>>>   src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
>>>>   1 file changed, 10 insertions(+)
>>>>
>>>> diff --git a/src/libcamera/camera_sensor_properties.cpp 
>>>> b/src/libcamera/camera_sensor_properties.cpp
>>>> index e5f27f06..04d80d6d 100644
>>>> --- a/src/libcamera/camera_sensor_properties.cpp
>>>> +++ b/src/libcamera/camera_sensor_properties.cpp
>>>> @@ -102,6 +102,16 @@ const CameraSensorProperties 
>>>> *CameraSensorProperties::get(const std::string &sen
>>>>               .unitCellSize = { 1550, 1550 },
>>>>               .testPatternModes = {},
>>>>           } },
>>>> +        { "imx519", {
>>>> +            .unitCellSize = { 1220, 1220 },
>>>> +            .testPatternModes = {
>>>> +                { controls::draft::TestPatternModeOff, 0 },
>>>> +                { controls::draft::TestPatternModeColorBars, 1 },
>>>> +                { controls::draft::TestPatternModeSolidColor, 2 },
>>>> +                { 
>>>> controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
>>>> +                { controls::draft::TestPatternModePn9, 4 },
>>>> +            },
>>>> +        } },
>>> I don't have documentation, so it looks reasonable to me :)
>>>
>>> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
>> Umang, do you have access to that camera module ? If so, have you been
>> able to compare the test patterns with the CCS specification ? If so,
>> with the commit message update,
>
> So there are couple of things off with test patterns I obtained.
>
> - The CCS specification say [1] for Solid Color and [2] for 100% Color 
> Bars. IMX519 got these indexes swapped while reporting via v4l2-ctl 
> atleast
> - There is no 'ColorBars' and 'ColorBarsFadeToGray' patterns in my 
> testing  which comply with CCS's patterns atleast.
>
> What I obttained is the following:
>
> [0]: (disabled)
> [1]: Two color bars only Aqua and Yellow (Does this count as color bars?)
> [2]: Solid Color (white)
> [3]: Same as [1]
> [4]: PN9 seems fine
>
> If you need visual samples let me know, I'll send it to you.

Let me just provide it to here while I have sensor attached to my RPi.


Test patterns reported by `v4l2-ctl <dev>  --list-ctrls`

```
Image Processing Controls

                    test_pattern 0x009f0903 (menu)   : min=0 max=4 
default=0 value=0
                 0: Disabled
                 1: Color Bars
                 2: Solid Color
                 3: Grey Color Bars
                 4: PN9
```

Samples available at
https://drive.google.com/drive/folders/1XVVNttu2utey66QfXwPcMJc1OY4LZDgf
```

I think we need report this finding on the driver patches as well ? [1]

[1] https://lore.kernel.org/linux-media/20221116091855.00007ebd@arducam.com/

>>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>>>>           { "ov2740", {
>>>>               .unitCellSize = { 1400, 1400 },
>>>>               .testPatternModes = {
>
Laurent Pinchart Dec. 1, 2022, 7:35 a.m. UTC | #5
Hi Umang,

On Thu, Dec 01, 2022 at 01:45:35AM +0800, Umang Jain wrote:
> On 11/24/22 1:58 AM, Laurent Pinchart wrote:
> > On Wed, Nov 23, 2022 at 06:32:20PM +0100, Jacopo Mondi via libcamera-devel wrote:
> >> On Tue, Nov 15, 2022 at 08:48:15PM +0530, Umang Jain via libcamera-devel wrote:
> >>> Add an entry for Arducam IMX519 sensor which has 1220x1220 pixel array
> >
> > It's the pixel size, not the pixel array.
>
> ack
>
> >>> and supports four test pattern modes.
> >>>
> >>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> >>> ---
> >>>   src/libcamera/camera_sensor_properties.cpp | 10 ++++++++++
> >>>   1 file changed, 10 insertions(+)
> >>>
> >>> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> >>> index e5f27f06..04d80d6d 100644
> >>> --- a/src/libcamera/camera_sensor_properties.cpp
> >>> +++ b/src/libcamera/camera_sensor_properties.cpp
> >>> @@ -102,6 +102,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
> >>>   			.unitCellSize = { 1550, 1550 },
> >>>   			.testPatternModes = {},
> >>>   		} },
> >>> +		{ "imx519", {
> >>> +			.unitCellSize = { 1220, 1220 },
> >>> +			.testPatternModes = {
> >>> +				{ controls::draft::TestPatternModeOff, 0 },
> >>> +				{ controls::draft::TestPatternModeColorBars, 1 },
> >>> +				{ controls::draft::TestPatternModeSolidColor, 2 },
> >>> +				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
> >>> +				{ controls::draft::TestPatternModePn9, 4 },
> >>> +			},
> >>> +		} },
> >>
> >> I don't have documentation, so it looks reasonable to me :)
> >>
> >> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> >
> > Umang, do you have access to that camera module ? If so, have you been
> > able to compare the test patterns with the CCS specification ? If so,
> > with the commit message update,
> 
> So there are couple of things off with test patterns I obtained.
> 
> - The CCS specification say [1] for Solid Color and [2] for 100% Color 
> Bars. IMX519 got these indexes swapped while reporting via v4l2-ctl atleast

That's not an issue as such. The V4L2 test pattern control values are
driver-specific. The whole point of testPatternModes is to handle the
mapping between the V4L2 test pattern values for a particular driver and
the libcamera test pattern control values.

> - There is no 'ColorBars' and 'ColorBarsFadeToGray' patterns in my 
> testing  which comply with CCS's patterns atleast.

Then we shouldn't report those two in testPatternModes.

> What I obttained is the following:
> 
> [0]: (disabled)
> [1]: Two color bars only Aqua and Yellow (Does this count as color bars?)

That's a weird one. It may also be that the sensor is misconfigured by
the driver.

> [2]: Solid Color (white)
> [3]: Same as [1]
> [4]: PN9 seems fine
> 
> If you need visual samples let me know, I'll send it to you.
> 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> >>>   		{ "ov2740", {
> >>>   			.unitCellSize = { 1400, 1400 },
> >>>   			.testPatternModes = {

Patch
diff mbox series

diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
index e5f27f06..04d80d6d 100644
--- a/src/libcamera/camera_sensor_properties.cpp
+++ b/src/libcamera/camera_sensor_properties.cpp
@@ -102,6 +102,16 @@  const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
 			.unitCellSize = { 1550, 1550 },
 			.testPatternModes = {},
 		} },
+		{ "imx519", {
+			.unitCellSize = { 1220, 1220 },
+			.testPatternModes = {
+				{ controls::draft::TestPatternModeOff, 0 },
+				{ controls::draft::TestPatternModeColorBars, 1 },
+				{ controls::draft::TestPatternModeSolidColor, 2 },
+				{ controls::draft::TestPatternModeColorBarsFadeToGray, 3 },
+				{ controls::draft::TestPatternModePn9, 4 },
+			},
+		} },
 		{ "ov2740", {
 			.unitCellSize = { 1400, 1400 },
 			.testPatternModes = {