diff mbox series

media: staging: ipu3-imgu: Fix BNR wb gain documentation

Message ID 20220617084519.32129-1-jeanmichel.hautbois@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: staging: ipu3-imgu: Fix BNR wb gain documentation | expand

Commit Message

Jean-Michel Hautbois June 17, 2022, 8:45 a.m. UTC
The documentation states that the BNR factor is a multiplier coded as
u3.13 and with a range of (0, 8). This is not correct, as the isp is
adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }.

It means that a gain of 1.0 should be coded as 0.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 drivers/staging/media/ipu3/include/uapi/intel-ipu3.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Kieran Bingham June 18, 2022, 3:11 p.m. UTC | #1
Hi JM,

Quoting Jean-Michel Hautbois (2022-06-17 09:45:19)
> The documentation states that the BNR factor is a multiplier coded as
> u3.13 and with a range of (0, 8). This is not correct, as the isp is
> adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }.
> 
> It means that a gain of 1.0 should be coded as 0.
> 
> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> ---
>  drivers/staging/media/ipu3/include/uapi/intel-ipu3.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h b/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
> index dbdd015ce220..caa358e0bae4 100644
> --- a/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
> +++ b/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
> @@ -626,8 +626,11 @@ struct ipu3_uapi_stats_3a {
>   * @b: white balance gain for B channel.
>   * @gb:        white balance gain for Gb channel.
>   *
> - * Precision u3.13, range [0, 8). White balance correction is done by applying
> - * a multiplicative gain to each color channels prior to BNR.
> + * For BNR parameters WB gain factor for the three channels [Ggr, Ggb, Gb, Gr].

As with the equivalent change on the libcamera IPA side, there are 4
channels, and the text could be updated to match I think.

With that done:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> + * Their precision is U3.13 and the range is (0, 8) and the actual gain is
> + * Gx + 1, it is typically Gx = 1.
> + *
> + * Pout = {Pin * (1 + Gx)}.
>   */
>  struct ipu3_uapi_bnr_static_config_wb_gains_config {
>         __u16 gr;
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h b/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
index dbdd015ce220..caa358e0bae4 100644
--- a/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
+++ b/drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
@@ -626,8 +626,11 @@  struct ipu3_uapi_stats_3a {
  * @b:	white balance gain for B channel.
  * @gb:	white balance gain for Gb channel.
  *
- * Precision u3.13, range [0, 8). White balance correction is done by applying
- * a multiplicative gain to each color channels prior to BNR.
+ * For BNR parameters WB gain factor for the three channels [Ggr, Ggb, Gb, Gr].
+ * Their precision is U3.13 and the range is (0, 8) and the actual gain is
+ * Gx + 1, it is typically Gx = 1.
+ *
+ * Pout = {Pin * (1 + Gx)}.
  */
 struct ipu3_uapi_bnr_static_config_wb_gains_config {
 	__u16 gr;