From patchwork Thu Aug 13 00:52:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9299 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AFFA2BD87E for ; Thu, 13 Aug 2020 00:53:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 69013613C2; Thu, 13 Aug 2020 02:53:47 +0200 (CEST) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AA57B613A2 for ; Thu, 13 Aug 2020 02:53:42 +0200 (CEST) X-Halon-ID: 6e1168a0-dcff-11ea-92dc-005056917a89 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 6e1168a0-dcff-11ea-92dc-005056917a89; Thu, 13 Aug 2020 02:53:41 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 13 Aug 2020 02:52:42 +0200 Message-Id: <20200813005246.3265807-10-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> References: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 09/13] libcamera: pipeline: rkisp1: Add self path devices 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add the V4L2 device nodes needed to operate the self path. Signed-off-by: Niklas Söderlund --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 60179a1151f18491..132878c13b10b555 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -129,9 +129,11 @@ public: class RkISP1CameraData : public CameraData { public: - RkISP1CameraData(PipelineHandler *pipe, V4L2VideoDevice *video) + RkISP1CameraData(PipelineHandler *pipe, V4L2VideoDevice *mainPathVideo, + V4L2VideoDevice *selfPathVideo) : CameraData(pipe), sensor_(nullptr), frame_(0), - frameInfo_(pipe), mainPathVideo_(video) + frameInfo_(pipe), mainPathVideo_(mainPathVideo), + selfPathVideo_(selfPathVideo) { } @@ -150,6 +152,7 @@ public: RkISP1Timeline timeline_; V4L2VideoDevice *mainPathVideo_; + V4L2VideoDevice *selfPathVideo_; private: void queueFrameAction(unsigned int frame, @@ -226,7 +229,9 @@ private: MediaDevice *media_; V4L2Subdevice *isp_; V4L2Subdevice *mainPathResizer_; + V4L2Subdevice *selfPathResizer_; V4L2VideoDevice *mainPathVideo_; + V4L2VideoDevice *selfPathVideo_; V4L2VideoDevice *param_; V4L2VideoDevice *stat_; @@ -559,7 +564,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate() PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager) : PipelineHandler(manager), isp_(nullptr), mainPathResizer_(nullptr), - mainPathVideo_(nullptr), param_(nullptr), stat_(nullptr) + selfPathResizer_(nullptr), mainPathVideo_(nullptr), + selfPathVideo_(nullptr), param_(nullptr), stat_(nullptr) { } @@ -568,7 +574,9 @@ PipelineHandlerRkISP1::~PipelineHandlerRkISP1() delete param_; delete stat_; delete mainPathVideo_; + delete selfPathVideo_; delete mainPathResizer_; + delete selfPathResizer_; delete isp_; } @@ -972,7 +980,8 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor) int ret; std::unique_ptr data = - std::make_unique(this, mainPathVideo_); + std::make_unique(this, mainPathVideo_, + selfPathVideo_); ControlInfoMap::Map ctrls; ctrls.emplace(std::piecewise_construct, @@ -1027,11 +1036,19 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator) if (mainPathResizer_->open() < 0) return false; + selfPathResizer_ = V4L2Subdevice::fromEntityName(media_, "rkisp1_resizer_selfpath"); + if (selfPathResizer_->open() < 0) + return false; + /* Locate and open the capture video node. */ mainPathVideo_ = V4L2VideoDevice::fromEntityName(media_, "rkisp1_mainpath"); if (mainPathVideo_->open() < 0) return false; + selfPathVideo_ = V4L2VideoDevice::fromEntityName(media_, "rkisp1_selfpath"); + if (selfPathVideo_->open() < 0) + return false; + stat_ = V4L2VideoDevice::fromEntityName(media_, "rkisp1_stats"); if (stat_->open() < 0) return false; @@ -1041,6 +1058,7 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator) return false; mainPathVideo_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady); + selfPathVideo_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady); stat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statReady); param_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramReady);