ipa: ipu3: Change the limits of the AWB stats

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@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jean-Michel Hautbois 2021-09-22 23:55:50 +02:00
parent e7860ce808
commit 65e7d11f6c

View file

@ -136,8 +136,8 @@
* <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details. * <linux/intel-ipu3.h> struct ipu3_uapi_gamma_corr_lut for further details.
*/ */
static constexpr uint32_t kMaxCellWidthPerSet = 160; static constexpr uint32_t kMaxCellWidthPerSet = 80;
static constexpr uint32_t kMaxCellHeightPerSet = 56; static constexpr uint32_t kMaxCellHeightPerSet = 60;
namespace libcamera { namespace libcamera {
@ -300,11 +300,11 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)
/* Set the BDS output size in the IPAConfiguration structure */ /* Set the BDS output size in the IPAConfiguration structure */
context_.configuration.grid.bdsOutputSize = bdsOutputSize; 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, uint32_t width = std::min(kMaxCellWidthPerSet,
bdsOutputSize.width >> widthShift); bdsOutputSize.width >> widthShift);
width = 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, int32_t height = std::min(kMaxCellHeightPerSet,
bdsOutputSize.height >> heightShift); bdsOutputSize.height >> heightShift);
height = height << heightShift; height = height << heightShift;