diff mbox series

[v5,2/2] media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAINS control

Message ID 20210810093811.7205-3-david.plowman@raspberrypi.com (mailing list archive)
State New, archived
Headers show
Series New V4L2 control V4L2_CID_NOTIFY_GAINS | expand

Commit Message

David Plowman Aug. 10, 2021, 9:38 a.m. UTC
Add documentation for the V4L2_CID_NOTIFY_GAINS control.

This control is required by sensors that need to know what colour
gains will be applied to pixels by downstream processing (such as by
an ISP), though the sensor does not apply these gains itself.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Laurent Pinchart Aug. 13, 2021, 2:42 a.m. UTC | #1
Hi David,

Thank you for the patch.

On Tue, Aug 10, 2021 at 10:38:11AM +0100, David Plowman wrote:
> Add documentation for the V4L2_CID_NOTIFY_GAINS control.
> 
> This control is required by sensors that need to know what colour
> gains will be applied to pixels by downstream processing (such as by
> an ISP), though the sensor does not apply these gains itself.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  .../media/v4l/ext-ctrls-image-source.rst      | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
> index de43f5c8486d..ba83cc0867d2 100644
> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
> @@ -72,3 +72,23 @@ Image Source Control IDs
>      * - __u32
>        - ``height``
>        - Height of the area.
> +
> +``V4L2_CID_NOTIFY_GAINS (integer array)``
> +    The sensor is notified what gains will be applied to the different
> +    colour channels by subsequent processing (such as by an ISP). The
> +    sensor is merely informed of these values in case it performs
> +    processing that requires them, but it does not apply them itself to
> +    the output pixels.
> +
> +    The use of an array allows this control to be extended to sensors
> +    with, for example, non-Bayer CFAs (colour filter arrays).
> +
> +    Currently it is defined only for Bayer sensors, and is an array
> +    control taking 4 gain values, being the gains for each of the
> +    Bayer channels. The gains are always in the order B, Gb, Gr and R,
> +    irrespective of the exact Bayer order of the sensor itself.

I'd swap the above two paragraphs.

> +
> +    The units for the gain values are linear, with the default value
> +    representing a gain of exactly 1. For example, if this default value
> +    is reported as being (say) 128, then a value of 256 would represent
> +    a gain of exactly 2.

Maybe 1.0 and 2.0 instead of 1 and 2 to show that the gains values
themselves can be fractional ?

With those two minor issues addressed if deemed to be worth it,

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

Patch

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
index de43f5c8486d..ba83cc0867d2 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst
@@ -72,3 +72,23 @@  Image Source Control IDs
     * - __u32
       - ``height``
       - Height of the area.
+
+``V4L2_CID_NOTIFY_GAINS (integer array)``
+    The sensor is notified what gains will be applied to the different
+    colour channels by subsequent processing (such as by an ISP). The
+    sensor is merely informed of these values in case it performs
+    processing that requires them, but it does not apply them itself to
+    the output pixels.
+
+    The use of an array allows this control to be extended to sensors
+    with, for example, non-Bayer CFAs (colour filter arrays).
+
+    Currently it is defined only for Bayer sensors, and is an array
+    control taking 4 gain values, being the gains for each of the
+    Bayer channels. The gains are always in the order B, Gb, Gr and R,
+    irrespective of the exact Bayer order of the sensor itself.
+
+    The units for the gain values are linear, with the default value
+    representing a gain of exactly 1. For example, if this default value
+    is reported as being (say) 128, then a value of 256 would represent
+    a gain of exactly 2.