From patchwork Wed Jan 16 13:59:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 249 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AECFD60B2D for ; Wed, 16 Jan 2019 14:59:48 +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 relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 2ADDDC000A; Wed, 16 Jan 2019 13:59:47 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 16 Jan 2019 14:59:44 +0100 Message-Id: <20190116135949.2097-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/5] libcamera: pipeline: Add Intel IPU3 pipeline handler 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, 16 Jan 2019 13:59:48 -0000 Hello second iteration for the IPU3 pipeline manager. Dropped from the series the awkward patch than made Camera's destructors public and used them in VIMC and IPU3 pipeline handler. Cameras are just "put" at pipeline handler destruction time. This will possibly be reworked when the lifetime of Camera devices will be re-worked. I have here added a patch to actually set (and get) a MediaEntity devnode path, and a little patch to make the pipeline handlers name a bit more expressive than just the class names. On the real meat of the series: the IPU3 pipeline handler. I included suggestions from Niklas and Laurent on re-ordering the media device acquisition, and made a bit more clear what is going on when operating on maps as suggested by Kieran. Also, I made sure camera names are now unique in the system. Overall, I have expanded comments as bit, as I agree with Niklas this class should serve as example for future pipeline handlers, so it is worth having a few comments more than necessary there. I have kept in patch [1/5] modifications to the list-cameras test, even if I have there included comments received on v1. I assume more comments will arrive on this. Tested on Soraka, where cameras gets enumerated as: root@libcamera:/home/cam/libcamera_deploy# ./test/list-cameras [3:07:00.815060285] DBG pipeline_handler.cpp:119 Registered pipeline handler "VIMC virtual driver pipeline handler" [3:07:00.815296070] DBG pipeline_handler.cpp:119 Registered pipeline handler "Intel IPU3 pipeline handler" [3:07:00.816056718] DBG device_enumerator.cpp:214 New media device "ipu3-imgu" created from /dev/media1 [3:07:00.816625144] DBG device_enumerator.cpp:214 New media device "ipu3-cio2" created from /dev/media0 [3:07:00.817116059] DBG device_enumerator.cpp:255 Successful match for media device "ipu3-cio2" [3:07:00.817132343] DBG device_enumerator.cpp:255 Successful match for media device "ipu3-imgu" [3:07:00.817157509] DBG media_device.cpp:672 ov13858 2-0010[0] -> ipu3-csi2 0[0]: 0 [3:07:00.817165563] DBG media_device.cpp:672 ov5670 4-0036[0] -> ipu3-csi2 1[0]: 0 [3:07:00.817198891] DBG media_device.cpp:672 ov13858 2-0010[0] -> ipu3-csi2 0[0]: 1 [3:07:00.817232593] INFO ipu3.cpp:249 Registered Camera[0] "ov13858 0" connected to CSI-2 receiver 0 [3:07:00.817247081] DBG media_device.cpp:672 ov5670 4-0036[0] -> ipu3-csi2 1[0]: 1 [3:07:00.817258419] INFO ipu3.cpp:249 Registered Camera[1] "ov5670 1" connected to CSI-2 receiver 1 [3:07:00.817269201] DBG ipu3.cpp:147 "Intel IPU3" pipeline handler initialized with 2 cameras registered [3:07:00.817279348] DBG pipeline_handler.cpp:150 Pipeline handler "Intel IPU3 pipeline handler" matched Found camera 'ov13858 0 Found camera 'ov5670 1 Thanks j Jacopo Mondi (5): test: list-cameras: Make test output more verbose libcamera: media_object: Add functions to entities libcamera: media_object: Set devnode in MediaEntity libcamera: pipeline: Allows more expressive names libcamera: pipeline: Add Intel IPU3 pipeline src/libcamera/include/media_object.h | 3 + src/libcamera/include/pipeline_handler.h | 4 +- src/libcamera/media_object.cpp | 33 ++- src/libcamera/pipeline/ipu3/ipu3.cpp | 263 +++++++++++++++++++++++ src/libcamera/pipeline/ipu3/meson.build | 3 + src/libcamera/pipeline/meson.build | 2 + src/libcamera/pipeline/vimc.cpp | 2 +- test/list-cameras.cpp | 41 +++- 8 files changed, 335 insertions(+), 16 deletions(-) create mode 100644 src/libcamera/pipeline/ipu3/ipu3.cpp create mode 100644 src/libcamera/pipeline/ipu3/meson.build --- 2.20.1