[0/2] ipa: libipa: add sensor helpers for GC08A8/S5KJNS and make the AGC target tunable
mbox series

Message ID 20261017153829.442320-1-xiaqinghuan@mail.ustc.edu.cn
Headers show
Series
  • ipa: libipa: add sensor helpers for GC08A8/S5KJNS and make the AGC target tunable
Related show

Message

Qianhui Xu Oct. 17, 2026, 3:38 p.m. UTC
This small series comes from bringing up the two cameras of the Lenovo
Legion Y700 Gen4 (TB322FC, SM8750) with the simple pipeline handler and the
software ISP.

The first patch describes the analogue gain encoding and the black level of
the two sensors (Samsung S5KJNS at the back, GalaxyCore GC08A8 at the front)
so that the software ISP works with real gain multipliers instead of raw
register codes, and the AGC/tuning does not need the sensor drivers to
change their V4L2 control semantics.

The second patch makes the AGC exposure target a tuning parameter. The
current fixed target of half the histogram range is quite bright for an
output that is gamma encoded with the default gamma of 2.2 (about 73% of
the full code range), which washes out the image and clips highlights; a
platform can now pick a lower target without touching the IPA sources.

Both changes were tested on the device with libcamera 0.7.1, rebuilt from
this tree (aarch64, musl), against the simple pipeline handler:

- Configure log confirms the AGC uses gain ranges in real multipliers
  (1-64 for s5kjns, 1-16 for gc08a8) instead of raw codes.
- With exposureTarget 0.22 the same scene gives a mean around 160 instead
  of the washed-out 210 obtained with the default target, and the AGC
  settles inside the target hysteresis band.



Qianhui Xu (2):
  ipa: libipa: add camera sensor helpers for GC08A8 and S5KJNS
  ipa: simple: agc: make the exposure target tunable

 src/ipa/libipa/camera_sensor_helper.cpp | 32 +++++++++++++++++++++++++
 src/ipa/simple/algorithms/agc.cpp       | 24 +++++++++++++++----
 src/ipa/simple/algorithms/agc.h         |  4 ++++
 3 files changed, 55 insertions(+), 5 deletions(-)