From patchwork Thu Sep 23 08:16:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 13896 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 9378CBF01C for ; Thu, 23 Sep 2021 08:16:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5FDF96918F; Thu, 23 Sep 2021 10:16:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="L+r1CE+b"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 51F996918D for ; Thu, 23 Sep 2021 10:16:31 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:392e:dcd2:2bf6:d61c]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F0987E52; Thu, 23 Sep 2021 10:16:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1632384991; bh=wKGPOK7nQlkpSfFyjijw69NjerI7exIUa/q6iLWAW/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L+r1CE+bw2pnt1BlxaHshFXFJKXtiBX18HEmc3nukbdvbz7QqXLXIPnb9lNGxXyk5 C6Ax7gVHXOY7yDLNlTXmiftVuFPJE648uvH5Bj9EDySaePm66tBvvoF8qECa1zF/Ni JTvZd99TQTDw5srOtPwzWKeYIgmG57Tr9fTQlVoE= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 23 Sep 2021 10:16:18 +0200 Message-Id: <20210923081625.60276-6-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210923081625.60276-1-jeanmichel.hautbois@ideasonboard.com> References: <20210923081625.60276-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/12] ipa: ipu3: Change the limits of the AWB stats 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Until now, the limits used to calculate the grid based on the Bayer Down Scaler configuration where taken from the kernel documentation [0]. While testing and understanding the format of the ImgU statistics, it appears that the ones defined in CrOs [1] are the correct ones. Use those. [0] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.html?highlight=v4l2_meta_fmt_ipu3_params#intel-ipu3-imgu-uapi-data-types [1] https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/refs/heads/master/hal/intel/include/ia_imaging/awb_public.h Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/ipu3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 30d2a539..b97aff80 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -136,8 +136,8 @@ * struct ipu3_uapi_gamma_corr_lut for further details. */ -static constexpr uint32_t kMaxCellWidthPerSet = 160; -static constexpr uint32_t kMaxCellHeightPerSet = 56; +static constexpr uint32_t kMaxCellWidthPerSet = 80; +static constexpr uint32_t kMaxCellHeightPerSet = 60; namespace libcamera { @@ -300,11 +300,11 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize) /* Set the BDS output size in the IPAConfiguration structure */ context_.configuration.grid.bdsOutputSize = bdsOutputSize; - for (uint32_t widthShift = 3; widthShift <= 7; ++widthShift) { + for (uint32_t widthShift = 3; widthShift <= 6; ++widthShift) { uint32_t width = std::min(kMaxCellWidthPerSet, bdsOutputSize.width >> widthShift); width = width << widthShift; - for (uint32_t heightShift = 3; heightShift <= 7; ++heightShift) { + for (uint32_t heightShift = 3; heightShift <= 6; ++heightShift) { int32_t height = std::min(kMaxCellHeightPerSet, bdsOutputSize.height >> heightShift); height = height << heightShift;