From patchwork Mon Jul 15 05:59:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1700 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 76E9261AA0 for ; Mon, 15 Jul 2019 07:58:32 +0200 (CEST) X-Originating-IP: 104.132.146.101 Received: from uno.localdomain (unknown [104.132.146.101]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 3EC7B1C0005; Mon, 15 Jul 2019 05:58:30 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Jul 2019 07:59:34 +0200 Message-Id: <20190715055935.21233-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190715055935.21233-1-jacopo@jmondi.org> References: <20190715055935.21233-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] libcamera: ipu3: Do not re-queue failed buffers 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: Mon, 15 Jul 2019 05:58:32 -0000 When a video device is stopped all the buffers there queued are released and their state is set to failure. Currently, on buffer completion, failed buffers are blindly re-queued to the ImgU input or CIO2 output devices, preventing them to be re-started succesfully in future capture sessions. Fix that by inspecting the buffers status and skip re-queueing if they're reported as failing. For the ImgU output buffers this is not required, as failed buffes should be anyhow delivered to applications in order to report their failure. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 5204487684c2..11bf3af66ae6 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -916,6 +916,9 @@ int PipelineHandlerIPU3::registerCameras() */ void IPU3CameraData::imguInputBufferReady(Buffer *buffer) { + if (buffer->status() != Buffer::BufferSuccess) + return; + cio2_.output_->queueBuffer(buffer); } @@ -946,6 +949,9 @@ void IPU3CameraData::imguOutputBufferReady(Buffer *buffer) */ void IPU3CameraData::cio2BufferReady(Buffer *buffer) { + if (buffer->status() != Buffer::BufferSuccess) + return; + imgu_->input_->queueBuffer(buffer); }