From patchwork Fri Aug 9 15:04:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1762 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E0DE61623 for ; Fri, 9 Aug 2019 17:05:04 +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 72861CC; Fri, 9 Aug 2019 17:05:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1565363103; bh=VrH54zLuvKfMlz608/5eYEOffnxuGo88Tc/oYAt+zE8=; h=From:To:Cc:Subject:Date:From; b=ODkucqA+g8T5gpxDFp+YXYFFqaqiVWEFHPuGwysjkGuSnmWpsLJJ5FxVHjqhm0M4d qLlYoQtvRgwjOINIX0wqP+nXdMycDjWZuIrBewcRNm0NzahhYF+cu/tvKVqzMXXBD0 08Q3EIopo7KSje1HijvAQ+LsiSXOQMbAMlrV5Z3A= From: Kieran Bingham To: LibCamera Devel Date: Fri, 9 Aug 2019 16:04:53 +0100 Message-Id: <20190809150459.14421-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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: Fri, 09 Aug 2019 15:05:04 -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 Lots of changes following review comments. I was lazy and didn't keep track of them all but approximately: 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() 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 | 28 ++ src/libcamera/pipeline/meson.build | 1 + src/libcamera/pipeline/raspberrypi.cpp | 453 ++++++++++++++++++ src/libcamera/v4l2_device.cpp | 26 + src/libcamera/v4l2_videodevice.cpp | 194 +++++++- test/v4l2_videodevice/meson.build | 1 + test/v4l2_videodevice/v4l2_m2mdevice.cpp | 212 ++++++++ .../v4l2_videodevice_test.cpp | 11 - 9 files changed, 912 insertions(+), 15 deletions(-) create mode 100644 src/libcamera/pipeline/raspberrypi.cpp create mode 100644 test/v4l2_videodevice/v4l2_m2mdevice.cpp