From patchwork Thu May 12 08:42:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 15895 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 889E3C0F2A for ; Thu, 12 May 2022 08:43:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 468C665660; Thu, 12 May 2022 10:43:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652344986; bh=PX69UFpuMSHjrcirpY5K/3ghK75/te/8KG7hMP5G5BY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=tggs9GEihZAT5F5ZycNw3EgGgCN9uDxdM+Vr35O5MXCReSlFek59UuO2+ZyAPebmh ciaxkFQpwdmGQLBgSk2y3HJk5tePMBxUUzBvAl54OFImcjA9qya9M6wedkbVpplkbL 5BxtJ+BeGl0uEiBiasJi8BYYMsGx7BpwUgZPgMRGI3igok8Jek0/YPjmwXPM+fIq+m JjZsx2EM1BmJJ5lGIdOrZG9NDna+lp65k9IfZ9z/A0D8zl9ulTQRRHnpRoOSKGhQYB 3D+zkk2ZVyoh7YN8f3lu31mqo+sxLAE6dbWbRgR2ELJWZgvKh69Vf43jwB+5dcO2o5 cRcLtRnVGfGFg== Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 41D296565A for ; Thu, 12 May 2022 10:43:04 +0200 (CEST) Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id CCD0D24000A; Thu, 12 May 2022 08:43:01 +0000 (UTC) To: Date: Thu, 12 May 2022 10:42:44 +0200 Message-Id: <20220512084244.1833554-2-foss+libcamera@0leil.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220512084244.1833554-1-foss+libcamera@0leil.net> References: <20220512084244.1833554-1-foss+libcamera@0leil.net> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 2/2] ipa: rkisp1: awb: switch to RGB means mode X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Quentin Schulz via libcamera-devel From: Quentin Schulz Reply-To: Quentin Schulz Cc: libcamera-devel@lists.libcamera.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Quentin Schulz While YCbCr means mode works just fine, it requires a conversion to RGB before computing necessary RGB gains. By using RGB means mode directly, this conversion can be spared. This was tested on a Rockchip PX30-based custom board and on a Theobroma Puma SoM + Haikou devkit and all fitted with an OV5675 sensor, using custom kernels based on upstream Linux kernel (respectively) 5.10 (with most upstream patches for rkisp1 from newer kernels applied) and 5.13. Cc: Quentin Schulz Signed-off-by: Quentin Schulz --- We probably need to triple check the other parameters right after (e.g. the Cr/Cb references, the Y and Cb+Cr min/max values) too. This is basically so people can check whether it works properly on the same hardware they said it didn't work when initially adding support for AWB on RkISP. src/ipa/rkisp1/algorithms/awb.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index df749b9b..5dea5c13 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -91,11 +91,8 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params) /* Configure the measure window for AWB. */ params->meas.awb_meas_config.awb_wnd = context.configuration.awb.measureWindow; - /* - * Measure Y, Cr and Cb means. - * \todo RGB is not working, the kernel seems to not configure it ? - */ - params->meas.awb_meas_config.awb_mode = RKISP1_CIF_ISP_AWB_MODE_YCBCR; + /* Measure RGB means. */ + params->meas.awb_meas_config.awb_mode = RKISP1_CIF_ISP_AWB_MODE_RGB; /* Reference Cr and Cb. */ params->meas.awb_meas_config.awb_ref_cb = 128; params->meas.awb_meas_config.awb_ref_cr = 128;