[RFC,0/1] ipa: libipa: awb: Support modules calibrated with gains below 1.0
mbox series

Message ID 20260828140629.128831-1-dmanresa@gmail.com
Headers show
Series
  • ipa: libipa: awb: Support modules calibrated with gains below 1.0
Related show

Message

D. Manresa Aug. 28, 2026, 2:06 p.m. UTC
Hello,

This comes out of bringing the front camera of the Microsoft Surface
Pro 7+ (an OV5693 behind an IPU6, driven by the simple pipeline and the
software ISP) to match the colours the Windows 11 stack produces on the
same hardware.

Microsoft publishes the per-module colour calibration in its public
Surface driver package, as an Intel CPFF/.aiqb container. Decoding the
advanced-colour-matrix records yields, per illuminant, the sensor white
point (and therefore the AWB gains) and the CCMs, which we translated
into a software ISP tuning file. The decoder, the tuning file and the
full write-up live at:

  https://github.com/dmanresa-saes/surface-ipu6-cameras

One obstacle remains in libcamera itself: AwbAlgorithm floors the white
balance gains at 1.0, while the OEM white point for this module needs a
red gain of 0.87 at 2592 K. The single patch here makes the floor
tunable instead of removing it, keeping the 1.0 default so no existing
platform changes behaviour. Sent as RFC because the alternative --
trusting the platform gain range alone and dropping the floor -- is
simpler, and I would value the maintainers' view on which is preferred
before respinning.

For completeness, our production tree carried a second local patch
making the software ISP AGC exposure target tunable (the MSV target
clipped highlights, and the clipped statistics then poisoned the
Bayesian AWB). That change is obsolete on master: since commit
004fea17d ("ipa: softisp: agc: Port to `AgcAlgorithm`") the target is
tunable through the relativeLuminanceTarget property for sensors with a
CameraSensorHelper, and we are migrating our tuning to it, so it is not
part of this series.

The patch was developed with AI assistance (Claude) and verified on
Surface Pro 7+ hardware against Windows 11 renditions of the same
scenes.

Thanks,
D. Manresa

D. Manresa (1):
  ipa: libipa: awb: Allow tuning files to lower the minimum gain

 src/ipa/libipa/awb.cpp |  4 ++++
 src/ipa/libipa/awb.h   | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)