[v2,0/8] rkisp1: Fix aspect ratio and ScalerCrop
mbox series

Message ID 20241125151430.2437285-1-stefan.klug@ideasonboard.com
Headers show
Series
  • rkisp1: Fix aspect ratio and ScalerCrop
Related show

Message

Stefan Klug Nov. 25, 2024, 3:14 p.m. UTC
Hi all,

This series contains fixes for a few issues on the imx8mp that I'd like
to get in before the next release.

Patch 1/8 is a drive by fix

Patch 2/8 Fixes the aspect ratio on the imx8mp. There exists code to
keep the aspect ratio in the rkisp1 pipeline that adjust the input crop
on the resizer stage. On the imx8mp however the resizer hardware is
missing that functionality and cropping needs to be done on the ISP
output. Patch 2 implements that.

Patches 3-8 fix the ScalerCrop control. The existing implementation
implements ScalerCrop in dewarper coordinates (After scaling down).
This is incorrect as ScalerCrop is specified to be in sensor
coordinates. To fix that, patches 3-6 do preparatory changes and patch 6
implements the correct ScalerCrop control. Patch 8 adds
ScalerMaximumCrop for completeness sake.

Note that this solution while being correct on the numbers is still not
ideal, because the aspect ratio preserving crop on the ISP output is
still applied unconditionally. That will get fixed in an upcoming
series, where the full sensor size get's passed to the dewarper and all
cropping/scaling gets handled there.

Best regards,
Stefan

Changes in v2:
- Some smaller fixes from review (see individual changelogs)
- Added [PATCH v2 6/8] libcamera: converter_v4l2_m2m: Improve crop
  bounds support to be able to provide sane default values for
ScalerCrop before configure()

Stefan Klug (8):
  libcamera: rkisp1: Fix scope of dewarper stop() exit action
  libcamera: rkisp1: Keep aspect ratio on imx8mp
  libcamera: geometry: Add Rectangle::transformedBetween()
  pipeline: rkisp1: Split inputCrop and outputCrop
  pipeline: rkisp1: Reorder sensorInfo collection code
  libcamera: converter_v4l2_m2m: Improve crop bounds support
  pipeline: rkisp1: Fix ScalerCrop to be in sensor coordinates
  pipeline: rkisp1: Add ScalerMaximumCrop property

 include/libcamera/geometry.h                  |   3 +
 .../internal/converter/converter_v4l2_m2m.h   |   1 +
 src/libcamera/converter.cpp                   |   3 +
 .../converter/converter_v4l2_m2m.cpp          | 113 +++++++++---------
 src/libcamera/geometry.cpp                    |  37 ++++++
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  99 +++++++++++----
 src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  13 +-
 7 files changed, 182 insertions(+), 87 deletions(-)