From patchwork Sat Apr 4 00:44:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3377 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B499E605D1 for ; Sat, 4 Apr 2020 02:44:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DXirUb9w"; dkim-atps=neutral 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 EDEFC321; Sat, 4 Apr 2020 02:44:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1585961091; bh=Y+nRbu7R6wgKaOzxNPmWZm9LuppCL0avS0XrtjJ88Xc=; h=From:To:Cc:Subject:Date:From; b=DXirUb9wn18DOnP5DVirApd4vNyUIzc1xuUk1Sha5ci8k56SDh8EHju55XonobHpI pcwG2eNB9n2uHF+Do2B7R4ZcUFQXtVW34QCoWeArY7Im7YQtWOrygkzwK1zHt5sEpc glwM6/kiEs9v1VJAHu5NaKlHRfEYV8euut1xkTQM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Martijn Braam , Benjamin GAIGNARD , Andrey Konovalov Date: Sat, 4 Apr 2020 03:44:27 +0300 Message-Id: <20200404004438.17992-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 00/11] Simple pipeline handler X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2020 00:44:52 -0000 Hello, This patch series builds on Martijn's work to implement a pipeline handler for simpler pipelines. Additional information about the pipeline handler itself can be found in patch 09/11. Compared to v3, this version only incorporates the review comments and has been rebased on top of master, without major changes. Patch 01/11 adds a V4L2 API extension required for pipeline auto-configuration, and patches 02/11 to 08/11 add a new utility function and miscellaneous small extensions. Patch 09/11 adds the new simple pipeline handler, patch 10/11 the simpler converter, and patch 11/11 integrates converter support into the simple pipeline handler. The converter API hasn't changed and should still be improved, it's currently a proof of concept. Other options also exist, such as making the simple pipeline handler a base class from which more specialized pipeline handlers could derive from, and implement support for converters in device-specific code. The code has been tested on an i.MX7 platform with a greyscale sensor and the i.MX PXP as format converter to produce RGB. I've kept sun6i-csi from Martijn's work in the list of supported drivers, but supporting that platform will require extending the corresponding driver to support the VIDIOC_ENUM_FMT extension. Once done, if all goes well, the platform should work out of the box. As before, this is meant to be compatible with the stm32 and qcom-camss that pipeline handlers have previously been submitted for, although for qcom-camss the pipeline configuration is a bit more complex, and the best strategy to move forward remains to be decided. The respective drivers need be added to the drivers array in SimplePipelineHandler::match(), and, as for sun6i-csi, support for the VIDIOC_ENUM_FMT extension needs to be implemented in the drivers, which should be fairly easy. Laurent Pinchart (10): [DNI] include: linux: Extend VIDIOC_ENUM_FMT to support MC-centric devices libcamera: utils: Add string join function libcamera: v4l2_subdevice: Extend [gs]etFormat() to specify format type libcamera: v4l2_subdevice: Don't use doxygen \ref needlessly libcamera: v4l2_videodevice: Support filtering formats by media bus code libcamera: v4l2_videodevice: Expose the device capabilities libcamera: v4l2_videodevice: Downgrade 4CC conversion errors to warnings libcamera: v4l2_videodevice: Map V4L2_PIX_FMT_GREY to DRM FourCC libcamera: pipeline: simple: Add simple format converter libcamera: pipeline: simple: Integrate converter support Martijn Braam (1): libcamera: pipeline: Add a simple pipeline handler include/linux/videodev2.h | 5 +- meson_options.txt | 2 +- src/libcamera/include/utils.h | 44 + src/libcamera/include/v4l2_subdevice.h | 11 +- src/libcamera/include/v4l2_videodevice.h | 6 +- src/libcamera/pipeline/simple/converter.cpp | 213 +++++ src/libcamera/pipeline/simple/converter.h | 60 ++ src/libcamera/pipeline/simple/meson.build | 4 + src/libcamera/pipeline/simple/simple.cpp | 877 ++++++++++++++++++++ src/libcamera/utils.cpp | 16 + src/libcamera/v4l2_subdevice.cpp | 28 +- src/libcamera/v4l2_videodevice.cpp | 36 +- test/utils.cpp | 20 +- 13 files changed, 1303 insertions(+), 19 deletions(-) create mode 100644 src/libcamera/pipeline/simple/converter.cpp create mode 100644 src/libcamera/pipeline/simple/converter.h create mode 100644 src/libcamera/pipeline/simple/meson.build create mode 100644 src/libcamera/pipeline/simple/simple.cpp