From patchwork Sat Jun 27 03:00:32 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: 8444 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 8D3AFC2E66 for ; Sat, 27 Jun 2020 03:00:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6831560AF2; Sat, 27 Jun 2020 05:00:53 +0200 (CEST) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0ACF1609D6 for ; Sat, 27 Jun 2020 05:00:50 +0200 (CEST) X-Halon-ID: 53f3bd94-b822-11ea-86ee-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 53f3bd94-b822-11ea-86ee-0050569116f7; Sat, 27 Jun 2020 05:00:16 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sat, 27 Jun 2020 05:00:32 +0200 Message-Id: <20200627030043.2088585-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200627030043.2088585-1-niklas.soderlund@ragnatech.se> References: <20200627030043.2088585-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/13] libcamera: ipu3: Import instead of allocate statistic buffers 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" Statistics buffers are not yet used by the IPU3 pipeline, they are never queued to the video device or in any other way consumed. The kernel driver will however not allow video streaming to start if buffers are not either allocated or imported on the video device. Instead of allocating the buffers wasting memory that is never used import buffers. Signed-off-by: Niklas Söderlund --- src/libcamera/pipeline/ipu3/ipu3.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index fba45935741e0e4e..405550b1302fb370 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1135,11 +1135,13 @@ int ImgUDevice::allocateBuffers(IPU3CameraData *data, unsigned int bufferCount) } /* - * Use for the stat's internal pool the same number of buffers as for - * the input pool. + * The kernel fails to start if buffers are not either imported or + * allocated for the statisitcs video device. As statistics buffers are + * not yet used by the pipeline import buffers to save memory. + * * \todo To be revised when we'll actually use the stat node. */ - ret = stat_.dev->allocateBuffers(bufferCount, &stat_.buffers); + ret = stat_.dev->importBuffers(bufferCount); if (ret < 0) { LOG(IPU3, Error) << "Failed to allocate ImgU stat buffers"; goto error;