From patchwork Wed Feb 20 13:17:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 588 Return-Path: Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E2D36600FF for ; Wed, 20 Feb 2019 14:17:39 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 618F240010; Wed, 20 Feb 2019 13:17:39 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 20 Feb 2019 14:17:52 +0100 Message-Id: <20190220131757.14004-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] libcamera: IPU3: create CIO2 and IMGU devices X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 13:17:40 -0000 Hello, sending out this first part of the IPU3 pipeline rework to fully support capturing from the imgu unit. The series breaks out from the original ipu3.cpp file two new classes that represents CIO2 units (one per each camera) and the two IMGU units. The current implementation configures the cio2 and imgu media graph in the configuration ready for image capture, with support for configurable capture sizes. On top of this, buffer sharing between CIO2 and IMGU will be implemented. Thanks j -------------------------------------------------------------------------------- media graphs dumps for capture operations on ov5670 sensor through IMGU0 unit. root@libcamera:/home/cam/capture# ./media-ctl -p -d /dev/media0 Media controller API version 5.0.0 Media device information ------------------------ driver ipu3-cio2 model Intel IPU3 CIO2 serial bus info PCI:0000:00:14.3 hw revision 0x0 driver version 5.0.0 Device topology - entity 1: ipu3-csi2 0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SGRBG10_1X10/1936x1096 field:none] <- "ov13858 2-0010":0 [ENABLED] pad1: Source [fmt:SGRBG10_1X10/1936x1096 field:none] -> "ipu3-cio2 0":0 [ENABLED,IMMUTABLE] - entity 4: ipu3-cio2 0 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "ipu3-csi2 0":1 [ENABLED,IMMUTABLE] - entity 10: ipu3-csi2 1 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:SGRBG10_1X10/2592x1944 field:none] <- "ov5670 4-0036":0 [ENABLED] pad1: Source [fmt:SGRBG10_1X10/2592x1944 field:none] -> "ipu3-cio2 1":0 [ENABLED,IMMUTABLE] - entity 13: ipu3-cio2 1 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video1 pad0: Sink <- "ipu3-csi2 1":1 [ENABLED,IMMUTABLE] - entity 19: ipu3-csi2 2 (2 pads, 1 link) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2 pad0: Sink [fmt:SGRBG10_1X10/1936x1096 field:none] pad1: Source [fmt:SGRBG10_1X10/1936x1096 field:none] -> "ipu3-cio2 2":0 [ENABLED,IMMUTABLE] - entity 22: ipu3-cio2 2 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video2 pad0: Sink <- "ipu3-csi2 2":1 [ENABLED,IMMUTABLE] - entity 28: ipu3-csi2 3 (2 pads, 1 link) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev3 pad0: Sink [fmt:SGRBG10_1X10/1936x1096 field:none] pad1: Source [fmt:SGRBG10_1X10/1936x1096 field:none] -> "ipu3-cio2 3":0 [ENABLED,IMMUTABLE] - entity 31: ipu3-cio2 3 (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video3 pad0: Sink <- "ipu3-csi2 3":1 [ENABLED,IMMUTABLE] - entity 37: ov13858 2-0010 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev4 pad0: Source [fmt:SGRBG10_1X10/4224x3136 field:none] -> "ipu3-csi2 0":0 [ENABLED] - entity 39: ov5670 4-0036 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev5 pad0: Source [fmt:SGRBG10_1X10/2592x1944 field:none] -> "ipu3-csi2 1":0 [ENABLED] root@libcamera:/home/cam/capture# ./media-ctl -p -d /dev/media1 Media controller API version 5.0.0 Media device information ------------------------ driver ipu3-imgu model ipu3-imgu serial bus info PCI:0000:00:05.0 hw revision 0x80862015 driver version 5.0.0 Device topology - entity 1: ipu3-imgu 0 (5 pads, 5 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev6 pad0: Sink [fmt:FIXED/2560x1920 crop:(0,0)/2592x1944 compose:(0,0)/2592x1944] <- "ipu3-imgu 0 input":0 [ENABLED] pad1: Sink [fmt:FIXED/1920x1080 field:none colorspace:raw] <- "ipu3-imgu 0 parameters":0 [] pad2: Source [fmt:FIXED/2560x1920] -> "ipu3-imgu 0 output":0 [ENABLED] pad3: Source [fmt:FIXED/1280x960] -> "ipu3-imgu 0 viewfinder":0 [ENABLED] pad4: Source [fmt:FIXED/2560x1920] -> "ipu3-imgu 0 3a stat":0 [ENABLED] - entity 7: ipu3-imgu 0 input (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video4 pad0: Source -> "ipu3-imgu 0":0 [ENABLED] - entity 13: ipu3-imgu 0 parameters (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video5 pad0: Source -> "ipu3-imgu 0":1 [] - entity 19: ipu3-imgu 0 output (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video20 pad0: Sink <- "ipu3-imgu 0":2 [ENABLED] - entity 25: ipu3-imgu 0 viewfinder (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video21 pad0: Sink <- "ipu3-imgu 0":3 [ENABLED] - entity 31: ipu3-imgu 0 3a stat (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video22 pad0: Sink <- "ipu3-imgu 0":4 [ENABLED] - entity 37: ipu3-imgu 1 (5 pads, 5 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev7 pad0: Sink [fmt:FIXED/1920x1080 field:none colorspace:raw crop:(0,0)/1920x1080 compose:(0,0)/1920x1080] <- "ipu3-imgu 1 input":0 [ENABLED] pad1: Sink [fmt:FIXED/1920x1080 field:none colorspace:raw] <- "ipu3-imgu 1 parameters":0 [] pad2: Source [fmt:FIXED/1920x1080 field:none colorspace:raw] -> "ipu3-imgu 1 output":0 [ENABLED] pad3: Source [fmt:FIXED/1920x1080 field:none colorspace:raw] -> "ipu3-imgu 1 viewfinder":0 [ENABLED] pad4: Source [fmt:FIXED/1920x1080 field:none colorspace:raw] -> "ipu3-imgu 1 3a stat":0 [ENABLED] - entity 43: ipu3-imgu 1 input (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video23 pad0: Source -> "ipu3-imgu 1":0 [ENABLED] - entity 49: ipu3-imgu 1 parameters (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video24 pad0: Source -> "ipu3-imgu 1":1 [] - entity 55: ipu3-imgu 1 output (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video25 pad0: Sink <- "ipu3-imgu 1":2 [ENABLED] - entity 61: ipu3-imgu 1 viewfinder (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video26 pad0: Sink <- "ipu3-imgu 1":3 [ENABLED] - entity 67: ipu3-imgu 1 3a stat (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video27 pad0: Sink <- "ipu3-imgu 1":4 [ENABLED] Jacopo Mondi (5): libcamera: v4l2_subdevice: Make crop/compose rectangle a reference libcamera: ipu3: Return video output default configuration libcamera: ipu3: Break-out ipu3 header file libcamera: ipu3: Add CIO2Device class libcamera: ipu3: Add IMGUDevice class src/libcamera/include/v4l2_subdevice.h | 6 +- src/libcamera/pipeline/ipu3/cio2.cpp | 266 +++++++++++++++++++ src/libcamera/pipeline/ipu3/imgu.cpp | 338 ++++++++++++++++++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 291 +++++++------------- src/libcamera/pipeline/ipu3/ipu3.h | 141 ++++++++++ src/libcamera/pipeline/ipu3/meson.build | 2 + src/libcamera/v4l2_subdevice.cpp | 18 +- 7 files changed, 861 insertions(+), 201 deletions(-) create mode 100644 src/libcamera/pipeline/ipu3/cio2.cpp create mode 100644 src/libcamera/pipeline/ipu3/imgu.cpp create mode 100644 src/libcamera/pipeline/ipu3/ipu3.h --- 2.20.1