[libcamera-devel] [PATCH v2 05/12] ipa: ipu3: Change the limits of the AWB stats

Jean-Michel Hautbois jeanmichel.hautbois at ideasonboard.com
Thu Sep 30 11:37:08 CEST 2021


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 <jeanmichel.hautbois at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 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 ac98a86b..b3ac96ed 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -136,8 +136,8 @@
  * <linux/intel-ipu3.h> 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;
-- 
2.30.2



More information about the libcamera-devel mailing list