From patchwork Sun May 10 11:58:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3739 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 3B4BA60BDC for ; Sun, 10 May 2020 13:58:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hBbVA64g"; 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 90630304; Sun, 10 May 2020 13:58:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589111899; bh=6rf32P+7R/gOW7ew/+XGwjkUFX/KgWoCSupR/pCOa4M=; h=From:To:Cc:Subject:Date:From; b=hBbVA64gRrydD9Ybr1dtWbFryjdCu7MA+0yeKQ4ygfgvyffQHJjLTKji2+bDYT510 2kqA0aEn/v/P6T5GSazcdTVJFgLCOpdAajD0YQhqhWHygWkmsUnyrNHDmOjGd0+RqT FJ69mY7MDhQZPUCFPdiQEokvAAwpeg9XdSGnqq5o= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Martijn Braam Date: Sun, 10 May 2020 14:58:04 +0300 Message-Id: <20200510115810.21938-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/6] 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: Sun, 10 May 2020 11:58:20 -0000 Hello, This patch series builds on Martijn's work to implement a pipeline handler for simple pipelines. Additional information about the pipeline handler itself can be found in patch 3/6. Compared to v4, this version incorporates the review comments and has been rebased on top of master, without major changes. Patch 1/6 adds a V4L2 API extension for the VIDIOC_ENUM_FMT ioctl, required for pipeline auto-configuration. The kernel changes have been merged in the linux-media master branch and is scheduled for kernel v5.8. The patch description has been updated accordingly. Patch 2/6 extends the V4L2VideoDevice class to implement the extension. Patch 3/6 adds the new simple pipeline handler, patch 4/6 the simple converter, and patch 5/6 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. Patch 6/6 extends the simple pipeline handler to support devices that contain multiple video nodes. It could be squashed with 3/6, but keeping it separate should ease review. 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. Laurent Pinchart (5): include: linux: Extend VIDIOC_ENUM_FMT to support MC-centric devices libcamera: v4l2_videodevice: Support filtering formats by media bus code libcamera: pipeline: simple: Add simple format converter libcamera: pipeline: simple: Integrate converter support libcamera: pipeline: simple: Support multiple capture video nodes Martijn Braam (1): libcamera: pipeline: Add a simple pipeline handler include/linux/videodev2.h | 5 +- meson_options.txt | 2 +- src/libcamera/include/v4l2_videodevice.h | 4 +- src/libcamera/pipeline/simple/converter.cpp | 217 +++++ src/libcamera/pipeline/simple/converter.h | 60 ++ src/libcamera/pipeline/simple/meson.build | 4 + src/libcamera/pipeline/simple/simple.cpp | 894 ++++++++++++++++++++ src/libcamera/v4l2_videodevice.cpp | 16 +- 8 files changed, 1195 insertions(+), 7 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