From patchwork Mon Mar 11 12:32:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 19660 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 CDB0BBD1F1 for ; Mon, 11 Mar 2024 12:32:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E0F4B62C8D; Mon, 11 Mar 2024 13:32:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AG787P3l"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E136462C8B for ; Mon, 11 Mar 2024 13:32:45 +0100 (CET) Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9E9C2C85; Mon, 11 Mar 2024 13:32:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1710160344; bh=sF0DrTYu2Cc+ovujEymNlCdkBtQrKRo8jyD5vbstFlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AG787P3l+lA6h/FaEp05MA5FjR6ptvpYruB3Mr3tZ1js6xAwi4eecilhl/dWzjS/j cBxEUAbSQ7cIvQnmJN8ymdOehjNBuYokLAkVexuuevHvmbCvbX4oH9dBS57lQftBPv HU3pcw0cGXFT+2Qt1002Uxriu40FvPIxd1pQOzE8= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 4/4] libcamera: ipu3: Return Raw buffers on error Date: Mon, 11 Mar 2024 13:32:32 +0100 Message-ID: <20240311123234.32925-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240311123234.32925-1-jacopo.mondi@ideasonboard.com> References: <20240311123234.32925-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 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: , Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When a Request is cancelled, all its application-provided buffers are completed and the paramters and stats buffer are made available again to the pipeline handler. If the RAW buffer doesn't come from the application (no RAW stream requested) it comes from the CIO2Device internal pool. Return it to the CIO2 pool in case of error. Signed-off-by: Jacopo Mondi Reviewed-by: Daniel Scally Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/ipu3.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 0c9d3167d2e6..57d0d6ed4758 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1384,6 +1384,9 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) availableParamBuffers_.push(request->paramBuffer); availableStatBuffers_.push(request->statBuffer); + /* Return RAW buffer to the CIO2. */ + cio2_.tryReturnBuffer(buffer); + pipe()->completeRequest(request->_o()); return; }