From patchwork Fri Jun 17 08:45:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 84170 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1o27c8-007NOc-7g; Fri, 17 Jun 2022 08:46:01 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381359AbiFQIp5 (ORCPT + 1 other); Fri, 17 Jun 2022 04:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381413AbiFQIpj (ORCPT ); Fri, 17 Jun 2022 04:45:39 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3716A04B for ; Fri, 17 Jun 2022 01:45:28 -0700 (PDT) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:28e5:dce:57ec:634e]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 222652A5; Fri, 17 Jun 2022 10:45:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655455527; bh=8fGsXJySfx/20YC9EMkhXuZx3a5LAzX5aBaucimZ4O4=; h=From:To:Cc:Subject:Date:From; b=FkLEWcn7W7/rKihafHx5k7MykmYd1qckMTQLNKQfjF4MoN1/G5FHRcTJjlPAY26GF K83F5YFwsm8cMJKuuoi9xvcvilsF445W+DMlqG2MOjUJHzHDwxgv9VjO5K+abGaC1e knoO74kJgMlI5ZwUJBrmDHRondp6Yohe+krFcvhk= From: Jean-Michel Hautbois To: linux-media@vger.kernel.org Cc: sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, laurent.pinchart@ideasonboard.com, Jean-Michel Hautbois Subject: [PATCH] media: staging: ipu3-imgu: Fix BNR wb gain documentation Date: Fri, 17 Jun 2022 10:45:19 +0200 Message-Id: <20220617084519.32129-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no 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 Reviewed-by: Kieran Bingham --- 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]. + * 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;