From patchwork Thu Nov 5 00:15:41 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: 10343 X-Patchwork-Delegate: niklas.soderlund@ragnatech.se 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 12C7FBE081 for ; Thu, 5 Nov 2020 00:16:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3BCBC62CE8; Thu, 5 Nov 2020 01:16:21 +0100 (CET) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1844062C8E for ; Thu, 5 Nov 2020 01:16:19 +0100 (CET) X-Halon-ID: 6d432969-1efa-11eb-8a9c-005056917a89 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de [79.202.36.88]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 6d432969-1efa-11eb-8a9c-005056917a89; Thu, 05 Nov 2020 01:04:09 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Nov 2020 01:15:41 +0100 Message-Id: <20201105001546.1690179-7-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201105001546.1690179-1-niklas.soderlund@ragnatech.se> References: <20201105001546.1690179-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/11] libcamera: ipu3: cio2: Generate start of frame event 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" Propagate the frameStart event whenever the CSI-2 receiver in the CIO2 pipeline generates one. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/cio2.cpp | 18 +++++++++++++++--- src/libcamera/pipeline/ipu3/cio2.h | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index 1c7b9676f52abdb6..1eca674da339b8e0 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -247,15 +247,27 @@ int CIO2Device::start() availableBuffers_.push(buffer.get()); ret = output_->streamOn(); - if (ret) + if (ret) { freeBuffers(); + return ret; + } - return ret; + ret = csi2_->setFrameStartEnabled(true); + if (ret) { + stop(); + return ret; + } + + return 0; } int CIO2Device::stop() { - int ret = output_->streamOff(); + int ret; + + csi2_->setFrameStartEnabled(false); + + ret = output_->streamOff(); freeBuffers(); diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index e8b491a0c104a3e2..67fede4e3b4e9fb6 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -13,6 +13,7 @@ #include +#include "libcamera/internal/v4l2_subdevice.h" #include "libcamera/internal/v4l2_videodevice.h" namespace libcamera { @@ -24,7 +25,6 @@ class PixelFormat; class Request; class Size; class SizeRange; -class V4L2Subdevice; struct StreamConfiguration; class CIO2Device @@ -56,6 +56,7 @@ public: void tryReturnBuffer(FrameBuffer *buffer); Signal &bufferReady() { return output_->bufferReady; } + Signal &frameStart() { return csi2_->frameStart; } private: void freeBuffers();