From patchwork Thu Feb 28 20:04:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 687 Return-Path: Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 22AF6610C0 for ; Thu, 28 Feb 2019 21:03:52 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id A9E0AE0004; Thu, 28 Feb 2019 20:03:51 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Feb 2019 21:04:09 +0100 Message-Id: <20190228200410.3022-10-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190228200410.3022-1-jacopo@jmondi.org> References: <20190228200410.3022-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 09/10] libcamera: ipu3: Connect CIO2 output to ImgU input 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: Thu, 28 Feb 2019 20:03:52 -0000 Connect the CIO2 output buffer available signal to a slot that simply queue the received buffer to ImgU for processing. FIXME: as long as the bufferReady signal cannot transport at least the cameraData from where to retrieve a pointer to the ImguDevice, store it as a class member. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index b9bc992879f5..3138eb0bf8b6 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -149,6 +149,8 @@ private: int startDevice(V4L2Device *dev); int stopDevice(V4L2Device *dev); + void cio2BufferDone(Buffer *buffer); + ImguDevice imgu0_; ImguDevice imgu1_; @@ -156,6 +158,7 @@ private: std::shared_ptr imguMediaDev_; unsigned int tmpBufferCount; + IPU3CameraData *tmpCameraData; }; PipelineHandlerIPU3::PipelineHandlerIPU3(CameraManager *manager) @@ -430,6 +433,19 @@ int PipelineHandlerIPU3::start(const Camera *camera) if (ret) return ret; + /* + * FIXME + * This is a big hack! tmpCameraData is used in the cio2BufferDone + * slot, as there is currently no way to access cameraData from there. + */ + tmpCameraData = data; + + /* + * Connect CIO2 output and ImgU input buffer events, when a buffer + * is available from CIO2, queue it to the ImgU. + */ + data->cio2.output->bufferReady.connect(this, + &PipelineHandlerIPU3::cio2BufferDone); ret = startDevice(data->cio2.output); if (ret) return ret; @@ -975,6 +991,13 @@ int PipelineHandlerIPU3::stopDevice(V4L2Device *dev) return 0; } +void PipelineHandlerIPU3::cio2BufferDone(Buffer *buffer) +{ + ImguDevice *imgu = tmpCameraData->imgu; + + imgu->input->queueBuffer(buffer); +} + REGISTER_PIPELINE_HANDLER(PipelineHandlerIPU3); } /* namespace libcamera */