From patchwork Wed Mar 20 16:30:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 771 Return-Path: Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C30CD61373 for ; Wed, 20 Mar 2019 17:30:43 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 5B0A1200009; Wed, 20 Mar 2019 16:30:43 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 20 Mar 2019 17:30:49 +0100 Message-Id: <20190320163055.22056-26-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190320163055.22056-1-jacopo@jmondi.org> References: <20190320163055.22056-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 25/31] libcamera: ipu3: Connect viewfinder's BufferReady signal 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: Wed, 20 Mar 2019 16:30:44 -0000 Connect the viewfinder buffer ready signal to the IPU3CameraData slot that complets the buffer first, and if not waiting for other buffers completes the request as well. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index b2df9a4ac922..db1ec2a7c3e2 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -135,7 +135,7 @@ private: { } - void imguOutputBufferReady(Buffer *buffer); + void imguCaptureBufferReady(Buffer *buffer); void imguInputBufferReady(Buffer *buffer); void cio2BufferReady(Buffer *buffer); @@ -621,8 +621,13 @@ int PipelineHandlerIPU3::start(Camera *camera) &IPU3CameraData::cio2BufferReady); data->imgu->input->bufferReady.connect(data, &IPU3CameraData::imguInputBufferReady); - data->imgu->output->bufferReady.connect(data, - &IPU3CameraData::imguOutputBufferReady); + + if (isOutputActive(data)) + data->imgu->output->bufferReady.connect(data, + &IPU3CameraData::imguCaptureBufferReady); + if (isViewfinderActive(data)) + data->imgu->viewfinder->bufferReady.connect(data, + &IPU3CameraData::imguCaptureBufferReady); /* * Enqueue all available buffers to the CIO2 unit to start frame @@ -1434,17 +1439,19 @@ void PipelineHandlerIPU3::IPU3CameraData::imguInputBufferReady(Buffer *buffer) } /** - * \brief ImgU output BufferReady slot + * \brief ImgU main and secondary output BufferReady slot * \param buffer The completed buffer * - * Buffer completed from the ImgU output are directed to the applications. + * Buffer completed from the ImgU main and secondary outputs are directed to + * the applications. */ -void PipelineHandlerIPU3::IPU3CameraData::imguOutputBufferReady(Buffer *buffer) +void PipelineHandlerIPU3::IPU3CameraData::imguCaptureBufferReady(Buffer *buffer) { Request *request = queuedRequests_.front(); - pipe_->completeBuffer(camera_, request, buffer); - pipe_->completeRequest(camera_, request); + /* TODO: this will probably need locking. */ + if (pipe_->completeBuffer(camera_, request, buffer)) + pipe_->completeRequest(camera_, request); } /**