[libcamera-devel,v5,0/4] libcamera: rkisp1: Fix generateConfiguration
mbox series

Message ID 20230606103336.17782-1-jacopo.mondi@ideasonboard.com
Headers show
Series
  • libcamera: rkisp1: Fix generateConfiguration
Related show

Message

Jacopo Mondi June 6, 2023, 10:33 a.m. UTC
The series started with bug 180:
https://bugs.libcamera.org/show_bug.cgi?id=180

Patch 1 fixes the bug by using main path if a single stream is requested

I have then noticed how the current implementation of
RkISP1Path::generateConfiguration() could produce unusual sizes, such as
1920x1432 in case the sensor's resolution is larger than the maximum supported
1920x1920 output.

Before assigning fixed sizes to StreamConfiguration, Laurent pointed out
that we should maintain pixel square before downscaling. Add 2/4 for that
reason

Finally 4/4 "fixes" generatation of RAW stream formats, by listing all
supported sensor's resolutions, and only report them when the raw stream
is requested (this is debatable).

Tested on Pinephone Pro with imx258 camera.

v4->v5:
- Check for max size width and height separately in 4/4
- Fix the cropping rectangle centering in 2/4
- Add todo notes
- Add reviewed-by notes

v3->v4:
- Drop "Reserve main path for StillCapture" to continue prioritize the
  stream role order when assigning outputs
- Add "Crop on ISP before downscaling" to address Laurent's comment on
  maintaining pixel square

v2->v3:
- Add review tags
- Improve 3/4 as suggested by Paul

v1->v2:
- Enumerate StreamFormats for all the available size and not limited to the
  current output size. This allows to enumerate higher resolutions even if the
  desired role has a smaller resolution.

  In example:
  gst-launch-1.0 libcamerasrc camera-name="/base/i2c\@ff110000/camera\@1a" ! 'video/x-raw,format=NV12,width=4208,height=3120' ! glimagesink

  which used to fail now works correctly

- Enumerate all the RAW sizes the sensor can produce but only if the requested
  role is StreamRole::Raw

Jacopo Mondi (4):
  libcamera: rkisp1: Generate config using main path
  libcamera: rkisp1: Crop on ISP before downscaling
  libcamera: rkisp1: Assign sizes to roles
  libcamera: rkisp1: Fix enumeration of RAW formats

 src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 32 +++++++++-----
 src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 42 ++++++++++++++++---
 src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  1 +
 3 files changed, 59 insertions(+), 16 deletions(-)

--
2.40.1