From patchwork Thu Apr 18 14:14:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1047 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 876FE60DBE for ; Thu, 18 Apr 2019 16:14:53 +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 0415D333 for ; Thu, 18 Apr 2019 16:14:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1555596893; bh=/3YXmbqG/mzDANCcKeWE+dZJ0zJmprKhXivlvLadkic=; h=From:To:Subject:Date:From; b=rP5pdygxHc0PwQBCvKt2EbRXaR9fe2W3jQNSoRfluRNacCylqLWuA7BIO1YWOws4O HNMLA9guKFAzY7Mo98lYz90ck4yR6xVgMkhAtWrk+ctTLxGhmEE66eGBhsnmZ7hJba dAXg6pOqvX4hCXUXm27Mx1caneHHQpXW6A9JP+CY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 18 Apr 2019 17:14:24 +0300 Message-Id: <20190418141437.14014-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 00/13] 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: Thu, 18 Apr 2019 14:14:53 -0000 Hello everybody, This patch series implements a pipeline handler for the Rockchip ISP1. The first ten patches, from 01/13 to 10/13, are miscellaneous fixes and improvements, with the most notable change related to comparison operators for geometry classes. Patch 11/13 and 12/13 are were the fun begins, with a new CameraSensor class that factors out code related to the sensor from the IPU3 pipeline handler. Patch 13/13 finally adds the RkISP1 pipeline handler, using the new CameraSensor class. Features are limited, as explained in patch 13/13. 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. Compated to v2, the series has been rebased on top of the multi-stream preparation commits that are now in the master branch. All review comments have been taken into account. Compared to v1, patches 08/13 and 09/13 have been added, and minor miscellaneous changes have been performed, all described in the respective patches. 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 (13): 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: utils: Add set_overlap() function libcamera: v4l2_subdevice: Close subdevice when destroyed 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 | 258 +++++++++++ src/libcamera/geometry.cpp | 162 +++++-- src/libcamera/include/camera_sensor.h | 56 +++ src/libcamera/include/log.h | 5 +- src/libcamera/include/utils.h | 19 + src/libcamera/include/v4l2_subdevice.h | 4 +- src/libcamera/log.cpp | 5 +- src/libcamera/meson.build | 2 + src/libcamera/pipeline/ipu3/ipu3.cpp | 116 ++--- src/libcamera/pipeline/meson.build | 1 + src/libcamera/pipeline/rkisp1/meson.build | 3 + src/libcamera/pipeline/rkisp1/rkisp1.cpp | 448 ++++++++++++++++++++ src/libcamera/utils.cpp | 12 + src/libcamera/v4l2_subdevice.cpp | 27 +- src/qcam/meson.build | 1 + test/geometry.cpp | 116 +++++ test/meson.build | 1 + test/v4l2_subdevice/list_formats.cpp | 14 +- test/v4l2_subdevice/v4l2_subdevice_test.cpp | 2 +- 22 files changed, 1171 insertions(+), 163 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