[libcamera-devel,v2,1/7] libcamera: controls: Add sensor test pattern mode
diff mbox series

Message ID 20210421042346.312854-2-hiroh@chromium.org
State Superseded
Headers show
Series
  • Report Android HAL client test pattern modes
Related show

Commit Message

Hirokazu Honda April 21, 2021, 4:23 a.m. UTC
The control is used to report available sensor test pattern modes
and also specify the mode to sensor.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/control_ids.yaml | 59 ++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Comments

Laurent Pinchart April 27, 2021, 3:33 a.m. UTC | #1
Hi Hiro,

Thank you for the patch.

On Wed, Apr 21, 2021 at 01:23:40PM +0900, Hirokazu Honda wrote:
> The control is used to report available sensor test pattern modes
> and also specify the mode to sensor.
> 
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/libcamera/control_ids.yaml | 59 ++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index b4771f9d..5de75eb0 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -608,4 +608,63 @@ controls:
>          detection, additional format conversions etc) count as an additional
>          pipeline stage.
>  
> +  - TestPatternMode:
> +      type: int32_t
> +      draft: true
> +      description: |
> +       Control to select the test pattern mode. Currently identical to
> +       ANDROID_SENSOR_TEST_PATTERN_MODE.

This should be indented by one more space.

> +
> +        Mode of operation for the test pattern mode.

Is this line a leftover ?

> +      enum:
> +        - name: TestPatternModeOff
> +          value: 0
> +          description: |
> +            No test pattern mode is used. The camera device returns from the
> +            image sensor.

I'm not sure to understand the second sentence, is there a word missing
? "returns frames" maybe ?

> +        - name: TestPatternModeSolidColor
> +          value: 1
> +          description: |
> +            Each pixel in [R, G_even, G_odd, B] is replaced by its respective
> +            color channel provided in test pattern mode data.

I still see no pattern mode data support in this series. What am I
missing ?

> +        - name: TestPatternModeColorBars
> +          value: 2
> +          description: |
> +            All pixel data is replaced with an 8-bar color pattern. The vertical
> +            bars (left-to-right) are as follows; white, yellow, cyan, green,
> +            magenta, red, blue and black. Each bar should take up 1/8 of the
> +            sensor pixel array width. When this is not possible, the bar size
> +            should be rounded down to the nearest integer and the pattern can
> +            repeat on the right side. Each bar's height must always take up the
> +            full sensor pixel array height.
> +        - name: TestPatternModeColorBarsFadeToGray
> +          value: 3
> +          description: |
> +            The test pattern is similar to TestPatternModeColorBars,
> +            except that each bar should start at its specified color at the top
> +            and fade to gray at the bottom. Furthermore each bar is further
> +            subdevided into a left and right half. The left half should have a
> +            smooth gradient, and the right half should have a quantized
> +            gradient. In particular, the right half's should consist of blocks
> +            of the same color for 1/16th active sensor pixel array width. The
> +            least significant bits in the quantized gradient should be copied
> +            from the most significant bits of the smooth gradient. The height of
> +            each bar should always be a multiple of 128. When this is not the
> +            case, the pattern should repeat at the bottom of the image.
> +        - name: TestPatternModePn9
> +          value: 4
> +          description: |
> +            All pixel data is replaced by a pseudo-random sequence generated
> +            from a PN9 512-bit sequence (typically implemented in hardware with
> +            a linear feedback shift register). The generator should be reset at
> +            the beginning of each frame, and thus each subsequent raw frame with
> +            this test pattern should be exactly the same as the last.
> +        - name: TestPatternModeCustom1
> +          value: 5
> +          description: |
> +            The first custom test pattern. All custom patterns that are
> +            available only on this camera device are at least this numeric
> +            value. All of the custom test patterns will be static (that is the
> +            raw image must not vary from frame to frame).
> +
>  ...
Hirokazu Honda April 28, 2021, 4:13 a.m. UTC | #2
On Tue, Apr 27, 2021 at 12:33 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Hiro,
>
> Thank you for the patch.
>
> On Wed, Apr 21, 2021 at 01:23:40PM +0900, Hirokazu Honda wrote:
> > The control is used to report available sensor test pattern modes
> > and also specify the mode to sensor.
> >
> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> > ---
> >  src/libcamera/control_ids.yaml | 59 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >
> > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> > index b4771f9d..5de75eb0 100644
> > --- a/src/libcamera/control_ids.yaml
> > +++ b/src/libcamera/control_ids.yaml
> > @@ -608,4 +608,63 @@ controls:
> >          detection, additional format conversions etc) count as an additional
> >          pipeline stage.
> >
> > +  - TestPatternMode:
> > +      type: int32_t
> > +      draft: true
> > +      description: |
> > +       Control to select the test pattern mode. Currently identical to
> > +       ANDROID_SENSOR_TEST_PATTERN_MODE.
>
> This should be indented by one more space.
>
> > +
> > +        Mode of operation for the test pattern mode.
>
> Is this line a leftover ?
>
> > +      enum:
> > +        - name: TestPatternModeOff
> > +          value: 0
> > +          description: |
> > +            No test pattern mode is used. The camera device returns from the
> > +            image sensor.
>
> I'm not sure to understand the second sentence, is there a word missing
> ? "returns frames" maybe ?
>
> > +        - name: TestPatternModeSolidColor
> > +          value: 1
> > +          description: |
> > +            Each pixel in [R, G_even, G_odd, B] is replaced by its respective
> > +            color channel provided in test pattern mode data.
>
> I still see no pattern mode data support in this series. What am I
> missing ?
>

Is it okay to add it later? I would like to split it in another patch.

> > +        - name: TestPatternModeColorBars
> > +          value: 2
> > +          description: |
> > +            All pixel data is replaced with an 8-bar color pattern. The vertical
> > +            bars (left-to-right) are as follows; white, yellow, cyan, green,
> > +            magenta, red, blue and black. Each bar should take up 1/8 of the
> > +            sensor pixel array width. When this is not possible, the bar size
> > +            should be rounded down to the nearest integer and the pattern can
> > +            repeat on the right side. Each bar's height must always take up the
> > +            full sensor pixel array height.
> > +        - name: TestPatternModeColorBarsFadeToGray
> > +          value: 3
> > +          description: |
> > +            The test pattern is similar to TestPatternModeColorBars,
> > +            except that each bar should start at its specified color at the top
> > +            and fade to gray at the bottom. Furthermore each bar is further
> > +            subdevided into a left and right half. The left half should have a
> > +            smooth gradient, and the right half should have a quantized
> > +            gradient. In particular, the right half's should consist of blocks
> > +            of the same color for 1/16th active sensor pixel array width. The
> > +            least significant bits in the quantized gradient should be copied
> > +            from the most significant bits of the smooth gradient. The height of
> > +            each bar should always be a multiple of 128. When this is not the
> > +            case, the pattern should repeat at the bottom of the image.
> > +        - name: TestPatternModePn9
> > +          value: 4
> > +          description: |
> > +            All pixel data is replaced by a pseudo-random sequence generated
> > +            from a PN9 512-bit sequence (typically implemented in hardware with
> > +            a linear feedback shift register). The generator should be reset at
> > +            the beginning of each frame, and thus each subsequent raw frame with
> > +            this test pattern should be exactly the same as the last.
> > +        - name: TestPatternModeCustom1
> > +          value: 5
> > +          description: |
> > +            The first custom test pattern. All custom patterns that are
> > +            available only on this camera device are at least this numeric
> > +            value. All of the custom test patterns will be static (that is the
> > +            raw image must not vary from frame to frame).
> > +
> >  ...
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index b4771f9d..5de75eb0 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -608,4 +608,63 @@  controls:
         detection, additional format conversions etc) count as an additional
         pipeline stage.
 
+  - TestPatternMode:
+      type: int32_t
+      draft: true
+      description: |
+       Control to select the test pattern mode. Currently identical to
+       ANDROID_SENSOR_TEST_PATTERN_MODE.
+
+        Mode of operation for the test pattern mode.
+      enum:
+        - name: TestPatternModeOff
+          value: 0
+          description: |
+            No test pattern mode is used. The camera device returns from the
+            image sensor.
+        - name: TestPatternModeSolidColor
+          value: 1
+          description: |
+            Each pixel in [R, G_even, G_odd, B] is replaced by its respective
+            color channel provided in test pattern mode data.
+        - name: TestPatternModeColorBars
+          value: 2
+          description: |
+            All pixel data is replaced with an 8-bar color pattern. The vertical
+            bars (left-to-right) are as follows; white, yellow, cyan, green,
+            magenta, red, blue and black. Each bar should take up 1/8 of the
+            sensor pixel array width. When this is not possible, the bar size
+            should be rounded down to the nearest integer and the pattern can
+            repeat on the right side. Each bar's height must always take up the
+            full sensor pixel array height.
+        - name: TestPatternModeColorBarsFadeToGray
+          value: 3
+          description: |
+            The test pattern is similar to TestPatternModeColorBars,
+            except that each bar should start at its specified color at the top
+            and fade to gray at the bottom. Furthermore each bar is further
+            subdevided into a left and right half. The left half should have a
+            smooth gradient, and the right half should have a quantized
+            gradient. In particular, the right half's should consist of blocks
+            of the same color for 1/16th active sensor pixel array width. The
+            least significant bits in the quantized gradient should be copied
+            from the most significant bits of the smooth gradient. The height of
+            each bar should always be a multiple of 128. When this is not the
+            case, the pattern should repeat at the bottom of the image.
+        - name: TestPatternModePn9
+          value: 4
+          description: |
+            All pixel data is replaced by a pseudo-random sequence generated
+            from a PN9 512-bit sequence (typically implemented in hardware with
+            a linear feedback shift register). The generator should be reset at
+            the beginning of each frame, and thus each subsequent raw frame with
+            this test pattern should be exactly the same as the last.
+        - name: TestPatternModeCustom1
+          value: 5
+          description: |
+            The first custom test pattern. All custom patterns that are
+            available only on this camera device are at least this numeric
+            value. All of the custom test patterns will be static (that is the
+            raw image must not vary from frame to frame).
+
 ...