[v6,0/5] libcamera: rkisp1: Plumb the ConverterDW100 converter
mbox series

Message ID 20240726114715.226468-1-umang.jain@ideasonboard.com
Headers show
Series
  • libcamera: rkisp1: Plumb the ConverterDW100 converter
Related show

Message

Umang Jain July 26, 2024, 11:47 a.m. UTC
This series intends to support i.MX8MP DW100 dewarper in rkisp1 pipeline
handler. It is modelled as Converter (inherited from V4L2M2MConverter)
and has a helper to support scaler crop control. The converter acts
as a base for now, additional development around dewarping capabilites
and support in simple pipeline-handler [1] can be added on top as
focused tasks.

Patch 1/5 add ability to add features to the Converter interface.
Each Converter can dictate its own features it can support

Patch 2/5 adds crop feature and gets implemented in the V4L2 M2M
converter. 

Patch 3/5 prepares the rkisp1 pipeline handler to register controls
for the camera, outside of the IPA. The ConverterDW100 will let us support
scaler crop - which will be registered as one of the camera controls.

Patch 4/5 adds a ConverterDW100 class inheriting from
converter_v4l2_m2m. This is just a base class for ConverterDW100
with Feature::Crop. Actual dewarp support will extend this class
in future.

Patch 5/5 plumbs the ConverterDW100 in the rkisp1 pipeline handler

Testing:
--------
The series is tested on i.MX8MP and cam utility, by setting scaler crop
control via capture script with IMX283 attached to isp0.

Changes in v6:
- clarify crop expectations - set on input side
- Rename setCrop() to setInputCrop
- Rename getFeatures() to features()
- Rename getCropBounds() to inputCropBounds()
- rename Features::Crop to Features::InputCrop
- Document crop functionality properly
- Improve error paths
- exportsBuffers() between RkISP1Path<>dewarper instead of
  allocateBuffers.

Changes in v5:
- Return -ENOTSUP for base implementation for virtual setCrop() in 2/5
- Return configured size for base implemention for virtual getCropBounds
  in 2/5.
- Fix a bug in getting crop bounds when streams are not configured
- drop getSelection() V4L2VideoDevices additions from v4. we can get
  bounds by setSelection by setting 1x1 and UINT_MAX x UINT_MAX
  rectangles.

changes in v4:
- rework Converter Interface to expose Features
- Add Crop Feature interface in Converter setCrop and setCropBound
- Implement cropping in V4L2M2MConverter for V4L2 M2M based converters
- Introduce useDewarper_ to denote when to use dewarper (simplied code
  reading).
- Trivial typo fixing.

Changes in v3:
- Base on top of [2]
- Model dewarper class as converter, so can be used with Simple
  pipeline-handler/ISI

Changes in v2:
- Fix raw capture configuration, disable dewarper in that case

[1]: Supporting the ConverterDW100 is simple pipeline handler should be
easy, adding the compatibles string and registering the converter with
REGISTER_CONVERTER(). However, for testing the
i.MX8MP -> ISI -> ConverterDW100 (dewarper) requires me to have a YUV
sensor attached, which I have not abled to source it yet. Once I source
it, I will test the ConverterDW100 on simple pipeline handler (I don't
expect any issues there but still..) and prepare a integration patch.
I hope this doesn't act as blocker for the series.


Umang Jain (5):
  libcamera: converter: Add interface for feature flags
  libcamera: converter: Add interface to support cropping capability
  libcamera: rkisp1: Prepare for additional camera controls
  libcamera: converter: Add DW100 converter class
  libcamera: rkisp1: Plumb the ConverterDW100 converter

 include/libcamera/internal/converter.h        |  18 +-
 .../internal/converter/converter_dw100.h      |  24 +++
 .../internal/converter/converter_v4l2_m2m.h   |   8 +-
 .../libcamera/internal/converter/meson.build  |   1 +
 src/libcamera/converter.cpp                   |  74 ++++++-
 src/libcamera/converter/converter_dw100.cpp   |  37 ++++
 .../converter/converter_v4l2_m2m.cpp          |  97 +++++++++-
 src/libcamera/converter/meson.build           |   1 +
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 182 +++++++++++++++++-
 9 files changed, 430 insertions(+), 12 deletions(-)
 create mode 100644 include/libcamera/internal/converter/converter_dw100.h
 create mode 100644 src/libcamera/converter/converter_dw100.cpp