From patchwork Mon Apr 15 16:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 981 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C7AC600F9 for ; Mon, 15 Apr 2019 18:57:14 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6B561333 for ; Mon, 15 Apr 2019 18:57:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1555347433; bh=MYO2xbnmTsNFdhuntbonjJJEiKtgQ4pRTrCCGNkizTg=; h=From:To:Subject:Date:From; b=EvwyX/XHZweisXCRxCPCXL2eP2+E+wpXrFE7gTiTB/fjR5bxX8+/vWk9eD98w+bCn 40Sg/wOQfTY5PF+UDRO5kxwR4JoZSFk4PUzX6se7gujPfPUgKlz+gU5hT94vfu19R2 2Yfwum0XbdQuUU5YT34n2A8CxZ56u942p9ZvbPdQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Apr 2019 19:56:49 +0300 Message-Id: <20190415165700.22970-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/11] Rockchip ISP 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: Mon, 15 Apr 2019 16:57:14 -0000 Hello everybody, This patch series implements a pipeline handler for the Rockchip ISP1. The first eight patches, from 01/11 to 08/11, are miscellaneous fixes and improvements, with the most notable change related to comparison operators for geometry classes. Patch 09/11 and 10/11 are were the fun begins, with a new CameraSensor class that factors out code related to the sensor from the IPU3 pipeline handler. Patch 11/11 finally adds the RkISP1 pipeline handler, using the new CameraSensor class. Features are limited, as explained in patch 11/11. Only CSI-2 raw Bayer sensors are supported, and while only one camera can be used at a time, mutual exclusion isn't implemented yet. The rkisp1 driver prints warnings in the kernel log when the stream is started and stopped, as well as during capture: [ 2527.336629] rkisp1: CIF_ISP_PIC_SIZE_ERROR (0x00000001) [ 2527.344146] rkisp1: CIF_ISP_PIC_SIZE_ERROR (0x00000000) This doesn't seem to prevent proper operation so far, but will need to be fixed. Please note that the kernel driver isn't upstream yet, the version used for this development can be found at git://linuxtv.org/pinchartl/media.git rockchip The branch is based on the latest version of the driver as posted to the linux-media mailing list, plus two additional patches that address the bitrotting, and contains DT integration. The patches have been tested on a Acer Chromebook Tab 10 device, based on the Rockchip RK3399 SoC. The RK399 has two ISP instances, with one CSI-2 receiver each, and it should be possible, at least in theory, to use both ISPs for the same camera, one in live streaming mode and one in memory-to-memory mode. This isn't supported on the kernel side, and thus out of scope for this initial pipeline handler implementation in libcamera. Laurent Pinchart (11): Install the cam and qcam utilities libcamera: log: Mark Loggable::_log() methods as const libcamera: camera: Log requested configuration in configureStreams() libcamera: geometry: Sort classes alphabetically libcamera: geometry: Use Size to store min and max in SizeRange libcamera: geometry: Add comparison operators to geometry classes test: geometry: Add tests for Size class comparison operators libcamera: v4l2-subdevice: Add method to retrieve the media entity libcamera: camera_sensor: Add a new class to model a camera sensor libcamera: pipeline: ipu3: Use the new CameraSensor class libcamera: pipeline: Add RKISP1 pipeline include/libcamera/geometry.h | 67 ++- src/cam/meson.build | 1 + src/libcamera/camera.cpp | 14 + src/libcamera/camera_sensor.cpp | 245 +++++++++++ src/libcamera/geometry.cpp | 166 ++++++-- src/libcamera/include/camera_sensor.h | 56 +++ src/libcamera/include/log.h | 5 +- src/libcamera/include/v4l2_subdevice.h | 3 +- src/libcamera/log.cpp | 5 +- src/libcamera/meson.build | 2 + src/libcamera/pipeline/ipu3/ipu3.cpp | 87 +--- src/libcamera/pipeline/meson.build | 1 + src/libcamera/pipeline/rkisp1/meson.build | 3 + src/libcamera/pipeline/rkisp1/rkisp1.cpp | 448 ++++++++++++++++++++ src/libcamera/v4l2_subdevice.cpp | 22 +- src/qcam/meson.build | 1 + test/geometry.cpp | 125 ++++++ test/meson.build | 1 + test/v4l2_subdevice/list_formats.cpp | 14 +- test/v4l2_subdevice/v4l2_subdevice_test.cpp | 2 +- 20 files changed, 1112 insertions(+), 156 deletions(-) create mode 100644 src/libcamera/camera_sensor.cpp create mode 100644 src/libcamera/include/camera_sensor.h create mode 100644 src/libcamera/pipeline/rkisp1/meson.build create mode 100644 src/libcamera/pipeline/rkisp1/rkisp1.cpp create mode 100644 test/geometry.cpp