[0/2] Raspberry Pi: Sensor HDR and decompand curve from camera helper
mbox series

Message ID 20261120114233.86270-1-danius@kurokesu.com
Headers show
Series
  • Raspberry Pi: Sensor HDR and decompand curve from camera helper
Related show

Message

Danius Kalvaitis Nov. 20, 2026, 11:42 a.m. UTC
Hello everyone,

It has been about a year since I last tried to get sensor HDR running
natively through PiSP with its decompand block. The decompand series
and its review [1] got my hopes up but no in-tree sensor uses decompand
yet. I understand this is a chicken and egg situation, as it takes a
kernel driver, a camera helper and libcamera support together.

This series is the libcamera part. Some sensors switch HDR through
V4L2_CID_WIDE_DYNAMIC_RANGE without changing mode size or bit depth, so
the IPA cannot tell HDR and linear modes apart. Patch 1 passes that
state on. Patch 2 lets camera helpers return a decompand curve per
mode, as Laurent suggested in [1]. Tuning file curves remain as
fallback.

I have this working with imx585 Clear HDR and ar0822 eHDR. Both depend
on my out-of-tree kernel drivers [2][3] and camera helpers [4], so
there is no in-tree consumer yet.

I would like to get all of it into mainline and would appreciate your
guidance on how best to approach that:

- Is V4L2_CID_WIDE_DYNAMIC_RANGE acceptable as the HDR signal for now?
- Can these two patches go in ahead of a consumer? imx585 support
  recently landed in the generic Starvis 2 helper, which has no Clear
  HDR, so I am not sure where its curve should live.

If hardware would help with review or testing, I can arrange imx585 and
ar0822 modules through my employer.

Thanks,
Danius

[1] https://lists.libcamera.org/pipermail/libcamera-devel/2025-October/053739.html
[2] https://github.com/Kurokesu/imx585-rpi-driver
[3] https://github.com/Kurokesu/ar0822-rpi-driver
[4] https://github.com/Kurokesu/libcamera/tree/v0.8.0+rpt20261104+krks2/src/ipa/rpi/cam_helper

Danius Kalvaitis (2):
  pipeline: rpi: Pass sensor HDR state to the IPA
  ipa: rpi: Get decompand curve from camera helper

 include/libcamera/ipa/raspberrypi.mojom       |  1 +
 src/ipa/rpi/cam_helper/cam_helper.cpp         |  5 ++++
 src/ipa/rpi/cam_helper/cam_helper.h           |  5 ++++
 src/ipa/rpi/cam_helper/meson.build            |  1 +
 src/ipa/rpi/common/ipa_base.cpp               |  2 ++
 src/ipa/rpi/common/meson.build                |  1 +
 src/ipa/rpi/controller/camera_mode.h          |  6 +++++
 src/ipa/rpi/controller/rpi/decompand.cpp      | 27 ++++++++++++-------
 src/ipa/rpi/controller/rpi/decompand.h        |  2 +-
 .../pipeline/rpi/common/pipeline_base.cpp     | 10 +++++++
 10 files changed, 50 insertions(+), 10 deletions(-)