[libcamera-devel,v2,00/20] libcamera: ipu3: Rework configuration
mbox series

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

Message

Jacopo Mondi July 9, 2020, 8:41 a.m. UTC
Hello,
   this second version combines what was sent in v1 to just rework the
stream validation process with the computation of the ImgU configuration
parameters.

The series steers things in the opposite direction compared to v1 when it
comes to stream assignment. V1 moved stream assignment to configure(), we
here retain it in validateion AND remove it from configure(), by using
StreamConfiguration::setStream() to remove the custom array of Streams that
was used to keep the association in place.

In order to be able to use setStream() at validate() time, the Camera class has
been changed to not zero the streams array between calls to the pipeline handler
validate() and configure() functions. The intent of that sequence was to make
sure streams where populated after configure(), the restriction that that has
to happen at configure and not validate is now lifted, and what we only care
about is that -after- validate+configure we have streams correctly populated.

When reworking validation all the assumptions about how streams have to be
assigned have been reworked, allowing multiple YUV outputs and not restricting
the usage of the main output to streams which are full-size only.

The ImgU outputs are now always (at least) 32 pixels in size smaller than
the input frame. This is not a requirement stated anywhere in the documentation,
but inspecting the xml configuration file for ChromeOS and the results from
the pipe configuration tool[1] it seems best results are obtained by giving the
IF and BDS components at least 32 pixels to scale/crop.

Speaking of pipe configuration, IF, and BDS, this series introduces in the
IPU3 pipeline handler dynamic calculation of the pipeline intermediate
components sizes, by importing the procedures implemented in the pipeline
configuration script provided by Intel:

[1] https://github.com/intel/intel-ipu3-pipecfg

The tool has been first ported as a standalone C++ application, its computation
verified against the python script results, and then integrated in the IPU3
pipeline handler.

The computed results match the python script ones for all the cases I have
tested (all the stream combination modes, and configurations with explicit
sizes).

Unfortunately, the parameters computed by the python tool differs from the ones
reported in the ChromeOS .xml configuration files. A github issue has been
opened asking for directions, but as of now, we can only assume the script
is correct.

As now we calculate the proper pipeline configuration, restrictions on the
maximum available sizes have been removed as well.

Jacopo Mondi (20):
  libcamera: ipu3: Rename mbusCodesToInfo
  libcamera: ipu3: Remove streams from generateConfiguration
  libcamera: ipu3: Make sure the config is valid
  libcamera: ipu3: cio2: Report format and sizes
  libcamera: ipu3: Do not overwrite StreamConfiguration
  libcamera: ipu3: Report StreamFormats
  libcamera: ipu3: Remove initialization of Size
  libcamera: ipu3: Validate the stream combination
  libcamera: camera: Zero streams before validate()
  libcamera: ipu3: Adjust and assign streams in validate()
  libcamera: ipu3: Adjust full frame picture to 32 pixels
  libcamera: ipu3: Always use the maximum frame size
  libcamera: ipu3: Store CameraData as mutable in CameraConfiguration
  libcamera: ipu3: Remove streams from IPU3CameraConfiguration
  libcamera: ipu3: Remove camera_ from IPU3CameraConfiguration
  libcamera: geometry: Add isNull() function to Rectangle class
  libcamera: ipu3: imgu: Calculate ImgU pipe configuration
  libcamera: ipu3: Calculate ImgU pipe configuration
  lbcamera: ipu3: Configure ImgU with the computed parameters
  libcamera: ipu3: imgu: Rename configureInput()

 include/libcamera/geometry.h         |   1 +
 src/libcamera/camera.cpp             |   4 +-
 src/libcamera/geometry.cpp           |   6 +
 src/libcamera/pipeline/ipu3/cio2.cpp |  58 +++-
 src/libcamera/pipeline/ipu3/cio2.h   |   5 +
 src/libcamera/pipeline/ipu3/imgu.    |   0
 src/libcamera/pipeline/ipu3/imgu.cpp | 401 +++++++++++++++++++++++++--
 src/libcamera/pipeline/ipu3/imgu.h   |  22 +-
 src/libcamera/pipeline/ipu3/ipu3.cpp | 389 ++++++++++++--------------
 9 files changed, 648 insertions(+), 238 deletions(-)
 create mode 100644 src/libcamera/pipeline/ipu3/imgu.

--
2.27.0