[libcamera-devel,v5,0/8] libcamera: Add helper for controls that take effect with a delay
mbox series

Message ID 20210116114805.905397-1-niklas.soderlund@ragnatech.se
Headers show
Series
  • libcamera: Add helper for controls that take effect with a delay
Related show

Message

Niklas Söderlund Jan. 16, 2021, 11:47 a.m. UTC
Hello,

This series adds a new helper class to libcamera-core based on the
StaggerdCtrl principle from the Raspberry Pi pipeline handler. The new
helper matches perfectly the RPi implementation and can therefore
replace the pipeline specific implementation. There are slight changes
in the API of the two but noting preventing it to be a drop in
replacement.

The major new addition to the DelayedControls implementation is the
ability to queue controls ahead of time. This allows the concept of
pipeline depth we already have for buffers to be extended to controls.

Patch 1/8 and 2/8 adds the new core helper and its unit test. Patch 3/8
and 4/8 replaces StaggerdCtrl with DelayedControls in the Raspberry Pi
pipeline handler. Patch 5/8 adds an accessors to CameraSensor. And last
6/8 - 8/8 make use of the new helper in the  RkISP1 pipeline to
completely remove another local helper (Timeline).

The RkISP1 IPA feels much snappier after this change but this is
anecdotal and no real measurements have been done as the RkISP1 IPA at
this stage is neither advanced nor tuned.

Niklas Söderlund (8):
  libcamera: delayed_controls: Add helper for controls that apply with a
    delay
  test: delayed_controls: Add test case for DelayedControls
  libcamera: raspberrypi: Switch to DelayedControls
  libcamera: raspberrypi: Remove StaggeredCtrl
  libcamera: camera_sensor: Expose the camera device
  libcamera: pipeline: rkisp1: Use delayed controls
  libcamera: pipeline: rkisp1: Use SOF event to warn about late
    parameters
  libcamera: pipeline: rkisp1: Remove Timeline

 include/libcamera/internal/camera_sensor.h    |   2 +
 include/libcamera/internal/delayed_controls.h |  81 +++++
 include/libcamera/internal/meson.build        |   1 +
 include/libcamera/ipa/raspberrypi.h           |   2 +-
 src/ipa/raspberrypi/raspberrypi.cpp           |   2 +-
 src/libcamera/camera_sensor.cpp               |   7 +
 src/libcamera/delayed_controls.cpp            | 247 +++++++++++++++
 src/libcamera/meson.build                     |   1 +
 .../pipeline/raspberrypi/meson.build          |   1 -
 .../pipeline/raspberrypi/raspberrypi.cpp      |  57 ++--
 .../pipeline/raspberrypi/staggered_ctrl.cpp   | 174 ----------
 .../pipeline/raspberrypi/staggered_ctrl.h     |  96 ------
 src/libcamera/pipeline/rkisp1/meson.build     |   1 -
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 166 +++-------
 src/libcamera/pipeline/rkisp1/timeline.cpp    | 227 -------------
 src/libcamera/pipeline/rkisp1/timeline.h      |  71 -----
 test/delayed_contols.cpp                      | 297 ++++++++++++++++++
 test/meson.build                              |   1 +
 18 files changed, 711 insertions(+), 723 deletions(-)
 create mode 100644 include/libcamera/internal/delayed_controls.h
 create mode 100644 src/libcamera/delayed_controls.cpp
 delete mode 100644 src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp
 delete mode 100644 src/libcamera/pipeline/raspberrypi/staggered_ctrl.h
 delete mode 100644 src/libcamera/pipeline/rkisp1/timeline.cpp
 delete mode 100644 src/libcamera/pipeline/rkisp1/timeline.h
 create mode 100644 test/delayed_contols.cpp