[v1,0/5] Extra pipeline processing "stages" for Raspberry Pi
mbox series

Message ID 20261203130113.47873-1-david.plowman@raspberrypi.com
Headers show
Series
  • Extra pipeline processing "stages" for Raspberry Pi
Related show

Message

David Plowman Dec. 2, 2026, 4:13 p.m. UTC
Hi everyone

Here's a reworking of my previous patch set for IPAs that can
manipulate pixel values, which should now be regarded as obsolete and
replaced by this new set.

This time, we introduce the notion of additional "pipeline stages",
that are configured by an IPA, and run under the auspices of the
pipeline handler, as discussed in another previous email:
https://lists.libcamera.org/pipermail/libcamera-devel/2026-November/064059.html

There are 5 patches. The first two are things that I will want in
future, so I've included them, but they could also be treated
separately. The next two patches add the infrastructure for "pipeline
stages", and the final patch adds an example stage to demonstrate how
it's done. Specifically:

1. Memory map Unicam buffers on the vc4 platform. We were already
doing this in the PiSP case, so we're just rationalising that.

2. Pass the PixelFormat over to the IPA. I haven't made the
PixelFormat a full mojom type itself just for my use case, though we
could if anyone wanted.

3. Adds the mojom configuration and per-frame structures that the IPA
can use to pass information to the pipeline handler stage.

4. Infrastructure on the pipeline handler side to create the "stages",
and run them asynchronously in a worker thread.

5. Add an example stage. Even once we have real stages, I'm inclined
to leave this in as the canonical example as there is no significant
cost.

Comments always appreciated!

Thanks

David

David Plowman (5):
  pipeline: rpi: vc4: Memory map the Unicam image buffers
  ipa: rpi: Pass raw buffer format to the IPA
  ipa: rpi: Add StageConfig and StageParams to the IPA interface
  pipeline: rpi: Add infrastructure for additional pipeline "stages"
  pipeline: rpi: Add an example additional pipeline "stage"

 include/libcamera/ipa/raspberrypi.mojom       |  42 ++++-
 src/ipa/rpi/common/ipa_base.cpp               |  49 +++++-
 src/ipa/rpi/common/ipa_base.h                 |   6 +
 src/ipa/rpi/controller/camera_mode.h          |   3 +
 src/ipa/rpi/controller/example_stage_status.h |  20 +++
 src/ipa/rpi/controller/meson.build            |   1 +
 src/ipa/rpi/controller/rpi/example_stage.cpp  |  63 ++++++++
 src/ipa/rpi/controller/rpi/example_stage.h    |  33 ++++
 src/libcamera/pipeline/rpi/common/meson.build |   2 +
 .../pipeline/rpi/common/pipeline_base.cpp     |  97 ++++++++++++
 .../pipeline/rpi/common/pipeline_base.h       |  36 +++++
 src/libcamera/pipeline/rpi/common/stage.h     |  75 +++++++++
 .../pipeline/rpi/common/stage_runner.cpp      | 149 ++++++++++++++++++
 .../pipeline/rpi/common/stage_runner.h        |  74 +++++++++
 .../rpi/common/stages/example_stage.cpp       |  66 ++++++++
 .../rpi/common/stages/example_stage.h         |  35 ++++
 src/libcamera/pipeline/rpi/pisp/pisp.cpp      |  41 ++++-
 src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  41 ++++-
 18 files changed, 816 insertions(+), 17 deletions(-)
 create mode 100644 src/ipa/rpi/controller/example_stage_status.h
 create mode 100644 src/ipa/rpi/controller/rpi/example_stage.cpp
 create mode 100644 src/ipa/rpi/controller/rpi/example_stage.h
 create mode 100644 src/libcamera/pipeline/rpi/common/stage.h
 create mode 100644 src/libcamera/pipeline/rpi/common/stage_runner.cpp
 create mode 100644 src/libcamera/pipeline/rpi/common/stage_runner.h
 create mode 100644 src/libcamera/pipeline/rpi/common/stages/example_stage.cpp
 create mode 100644 src/libcamera/pipeline/rpi/common/stages/example_stage.h