[v4,0/9] software-isp: Align metering and report the configured crop
mbox series

Message ID 20261029132631.370507-1-halfline@gmail.com
Headers show
Series
  • software-isp: Align metering and report the configured crop
Related show

Message

Ray Strode Oct. 29, 2026, 1:26 p.m. UTC
Hi,

Here's an updated version of the software ISP crop series, rebased on
current master (6e19ca0f).

It makes GPU statistics follow the sensor region visible in the output,
keeping exposure and white balance metering aligned with the image. The
simple pipeline also reports the configured CPU or GPU crop through
ScalerCropMaximum and ScalerCrop request metadata.

The series depends on Martin's GPU crop-centering patch [1] and the
accompanying getSelection() API patch.

I've implemented the optional-result approach from the earlier
getSelection() discussion as a separate patch. Success with an empty
optional means no rectangle was reported for the current configuration.

Following Stefan's feedback, the crop coordinates are relative to the
physical pixel array. The first patch corrects the ScalerCrop and
ScalerCropMaximum documentation to match.

[1] https://patchwork.libcamera.org/patch/28178/

--Ray

Ray Strode (9):
  libcamera: Document ScalerCrop in physical pixel-array coordinates
  software-isp: Align statistics with the visible sensor crop
  tests: Validate the visible sensor crop
  software-isp: Expose the configured image crop
  tests: Check the configured CPU image crop
  software-isp: Map input crops to native sensor coordinates
  tests: Validate native sensor crop coordinates
  pipeline: simple: Report the software ISP's maximum crop
  pipeline: simple: Include the software ISP crop in request metadata

.../internal/software_isp/debayer_geometry.h       |  48 ++++++++++
 .../libcamera/internal/software_isp/meson.build    |   1 +
 .../libcamera/internal/software_isp/software_isp.h |   1 +
 src/libcamera/control_ids_core.yaml                |   7 +-
 src/libcamera/pipeline/simple/simple.cpp           |  95 +++++++++++++++++-
 src/libcamera/property_ids_core.yaml               |   4 +-
 src/libcamera/software_isp/debayer.cpp             |  11 +++
 src/libcamera/software_isp/debayer.h               |   1 +
 src/libcamera/software_isp/debayer_cpu.h           |   4 +
 src/libcamera/software_isp/debayer_egl.cpp         |  15 +--
 src/libcamera/software_isp/debayer_egl.h           |   3 +-
 src/libcamera/software_isp/software_isp.cpp        |  14 +++
 test/debayer-geometry.cpp                          | 106 +++++++++++++++++++++
 test/meson.build                                   |   2 +
 test/software_isp/debayer-crop.cpp                 | 102 ++++++++++++++++++++
 test/software_isp/meson.build                      |  20 ++++
 16 files changed, 414 insertions(+), 20 deletions(-)

Comments

Kieran Bingham Oct. 29, 2026, 1:33 p.m. UTC | #1
Hi Ray

Quoting Ray Strode (2026-10-29 13:26:22)
> Hi,
> 
> Here's an updated version of the software ISP crop series, rebased on
> current master (6e19ca0f).
> 

I don't know if this is specific to my client or circumstances, but when
you post new versions as a reply to the existing version - the thread is
already marked as superceeded, so it means I don't process new versions.

--
Kieran

> It makes GPU statistics follow the sensor region visible in the output,
> keeping exposure and white balance metering aligned with the image. The
> simple pipeline also reports the configured CPU or GPU crop through
> ScalerCropMaximum and ScalerCrop request metadata.
> 
> The series depends on Martin's GPU crop-centering patch [1] and the
> accompanying getSelection() API patch.
> 
> I've implemented the optional-result approach from the earlier
> getSelection() discussion as a separate patch. Success with an empty
> optional means no rectangle was reported for the current configuration.
> 
> Following Stefan's feedback, the crop coordinates are relative to the
> physical pixel array. The first patch corrects the ScalerCrop and
> ScalerCropMaximum documentation to match.
> 
> [1] https://patchwork.libcamera.org/patch/28178/
> 
> --Ray
> 
> Ray Strode (9):
>   libcamera: Document ScalerCrop in physical pixel-array coordinates
>   software-isp: Align statistics with the visible sensor crop
>   tests: Validate the visible sensor crop
>   software-isp: Expose the configured image crop
>   tests: Check the configured CPU image crop
>   software-isp: Map input crops to native sensor coordinates
>   tests: Validate native sensor crop coordinates
>   pipeline: simple: Report the software ISP's maximum crop
>   pipeline: simple: Include the software ISP crop in request metadata
> 
> .../internal/software_isp/debayer_geometry.h       |  48 ++++++++++
>  .../libcamera/internal/software_isp/meson.build    |   1 +
>  .../libcamera/internal/software_isp/software_isp.h |   1 +
>  src/libcamera/control_ids_core.yaml                |   7 +-
>  src/libcamera/pipeline/simple/simple.cpp           |  95 +++++++++++++++++-
>  src/libcamera/property_ids_core.yaml               |   4 +-
>  src/libcamera/software_isp/debayer.cpp             |  11 +++
>  src/libcamera/software_isp/debayer.h               |   1 +
>  src/libcamera/software_isp/debayer_cpu.h           |   4 +
>  src/libcamera/software_isp/debayer_egl.cpp         |  15 +--
>  src/libcamera/software_isp/debayer_egl.h           |   3 +-
>  src/libcamera/software_isp/software_isp.cpp        |  14 +++
>  test/debayer-geometry.cpp                          | 106 +++++++++++++++++++++
>  test/meson.build                                   |   2 +
>  test/software_isp/debayer-crop.cpp                 | 102 ++++++++++++++++++++
>  test/software_isp/meson.build                      |  20 ++++
>  16 files changed, 414 insertions(+), 20 deletions(-)
Ray Strode Oct. 29, 2026, 2:17 p.m. UTC | #2
Hi,

On Thu, Oct 29, 2026 at 9:33 AM Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
> I don't know if this is specific to my client or circumstances, but when
> you post new versions as a reply to the existing version - the thread is
> already marked as superceeded, so it means I don't process new versions.

Okay, i'll post a v5 as a new thread, that will give me a chance to do
another pass over the
commit messages anyway.

--Ray