[libcamera-devel,00/15] libcamera: ipu3: Rework streams configuration
mbox series

Message ID 20200701123036.51922-1-jacopo@jmondi.org
Headers show
Series
  • libcamera: ipu3: Rework streams configuration
Related show

Message

Jacopo Mondi July 1, 2020, 12:30 p.m. UTC
I started this series with the final goal of integrating in the IPU3 pipeline
handler with the calculation of the IF, BDS and GDC rectangle, which are at
the moment defaulted to the ImgU frame input sizes.

Before attempting to calculate the sizes required for the pipeline
components, I realized the IPU3 stream configuration had to be mostly reworked.

The IPU3 pipeline handler stream configuration has been the first one that has
been developed in libcamera, and it has not been updated since. This series
rework that part, paving the way for the pipeline sizes calculation, which is
yet implemented, but will be provided on-top.

The series starts with a simple rename of an internal map of formats, then it
reworks the generateConfiguration() operation in order to remove stream
assignment from it. Following two minor patches, it then implements support for
reporting the available stream formats associated to the stream configurations
generated by the pipeline handler in [5/15].

Then validate() gets re-worked, as the current version has some arbitrary
assumptions, and still requires streams to be assigned to configurations, which
shall instead happen at configure() time.

After reworking validation and a few more clean-up patches, the series moves to
rework configure() to perform stream assignment and more strict checks on the
supported stream combinations. As after [8/15] Streams are handled in
configure() only, the streams_ vector and the camera_ shared pointer can be
removed from IPU3CameraConfiguration in [9/15] and [10/15].

From [11/15] onward, the pipeline handler gets prepared to calculate the IF,
BDS and GDC sizes, by instrumenting the ImgUDevice::configure() function
with all the parameter it needs to perform the computation. A few more
clean up patches close the series.

Most notable improvements are:
- Support more stream combinations: before this series, asking for
  two viewfinder streams, a viewfinder and a video stream or two video
  streams was not allowed.

- Report StreamFormats for each generated StreamConfiguration

- Make sure no more than one raw and two non-raw streams are requested

- Assign streams to video nodes in a way that reduces the risk of cropping the
  field of view

- Pave the way for integrating pipeline sizes configuration in
  ImgUDevice::configure()

Thanks
   j

Jacopo Mondi (15):
  libcamera: ipu3: Rename mbusCodesToInfo
  libcamera: ipu3: Remove streams from generateConfiguration
  libcamera: ipu3: cio2: Report format and sizes
  libcamera: ipu3: Do not overwrite StreamConfiguration
  libcamera: ipu3: Report StreamFormats
  libcamera: ipu3: Rework stream validation
  libcamera: ipu3: Refuse unsupported configuration
  libcamera: ipu3: Assign streams at configure() time
  libcamera: ipu3: Remove streams from IPU3CameraConfiguration
  libcamera: ipu3: Remove camera_ from IPU3CameraConfiguration
  libcamera: geometry: Add isNull() function to Rectangle class
  libcamera: ipu3: add ImgUDevice::Pipe
  libcamera: ipu3: Collect ImgU pipe configuration
  libcamera: ipu3: Rename ImgUDevice::configureInput()
  libcamera: ipu3: Pass cio2 fourcc to ImgUDevice::configure()

 include/libcamera/geometry.h         |   1 +
 src/libcamera/geometry.cpp           |   6 +
 src/libcamera/pipeline/ipu3/cio2.cpp |  61 +++-
 src/libcamera/pipeline/ipu3/cio2.h   |   7 +
 src/libcamera/pipeline/ipu3/imgu.cpp |  45 ++-
 src/libcamera/pipeline/ipu3/imgu.h   |   9 +-
 src/libcamera/pipeline/ipu3/ipu3.cpp | 409 +++++++++++++--------------
 7 files changed, 306 insertions(+), 232 deletions(-)

--
2.27.0