From patchwork Tue Aug 13 09:40:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1799 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 B739360E2E for ; Tue, 13 Aug 2019 11:40:24 +0200 (CEST) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 32B3B30F; Tue, 13 Aug 2019 11:40:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1565689224; bh=Knhsd+BceXnjpue+8kY+jIu6sGNErG3+t+ZRm1t5ci0=; h=From:To:Cc:Subject:Date:From; b=HhhJb2u4CSa3XEBj3187hTKwNkDBC2v1Qm5YoPuQImkBKaIty6aeCcy7t4OqCl8BW nRlukXFKYpZjWJNOJpEitxfdHrGw+kOOEET3Q1oeNoNDhqkZZmSDoZPxJoU/bJVv+I IkrONtGUse2h5mEtrjNr50eEeeqwQsWJtRPCVWQg= From: Kieran Bingham To: LibCamera Devel Date: Tue, 13 Aug 2019 10:40:14 +0100 Message-Id: <20190813094020.10277-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/6] V4L2 M2M Support (+RPi PoC) 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: Tue, 13 Aug 2019 09:40:24 -0000 The RaspberryPi pipeline handler will require a Memory2Memory device to support it's ISP processing. An initial RFC of this has been posted some time ago. This series improves upon the V4L2M2MDevice RFC that was posted and promotes it to it's own class. Support for opening a device for two streams is added by overloading the V4L2VideoDevice::open() call to allow a second implemention to provide the the fd and stream type, rather than opening the node and guessing the type. An initial test using the V4L2M2MDevice on the VIM2M virtual M2M driver is also provided. Along side all of this there are a couple of small independent fixup patches (Fix the ordering of a debug statement, and remove an unused function) and my current state of the RaspberryPi Pipeline handler. * Please Note * The PipelineHandlerRPi requires out of tree kernel drivers to operate. These are available publically on the RaspberryPi foundation's linux tree, however I have added further patches on top of those. A branch containing the drivers for the RPi with my patches on top is at: https://github.com/kbingham/linux-rpi.git rpi-4.19.y-libcamera v3: - Moved location of setFd within V4L2Device - Fixed documentation - Close newFd in V4L2VideoDevice::open(handle, type) error path v2: - M2M device now has its own open()/close() calls - Return codes are not lost in PipelineHandlerRPi::freeBuffers() - unicam node added to device match. - Test code executes in the run() rather than the init() *** BLURB HERE *** Kieran Bingham (6): libcamera: v4l2_device: Add setFd() libcamera: v4l2_videodevice: Fix ordering of debug statement libcamera: v4l2_videodevice: Support M2M devices test: v4l2_videodevice: Add M2M device test test: v4l2_device: Remove unused function [PoC/RFC] libcamera: pipeline: Add RaspberryPi handler src/libcamera/include/v4l2_device.h | 1 + src/libcamera/include/v4l2_videodevice.h | 25 + src/libcamera/pipeline/meson.build | 1 + src/libcamera/pipeline/raspberrypi.cpp | 453 ++++++++++++++++++ src/libcamera/v4l2_device.cpp | 26 + src/libcamera/v4l2_videodevice.cpp | 202 +++++++- test/v4l2_videodevice/meson.build | 1 + test/v4l2_videodevice/v4l2_m2mdevice.cpp | 212 ++++++++ .../v4l2_videodevice_test.cpp | 11 - 9 files changed, 916 insertions(+), 16 deletions(-) create mode 100644 src/libcamera/pipeline/raspberrypi.cpp create mode 100644 test/v4l2_videodevice/v4l2_m2mdevice.cpp