From patchwork Wed Dec 28 22:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 18065 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 85B02C3220 for ; Wed, 28 Dec 2022 22:30:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 42A36625F1; Wed, 28 Dec 2022 23:30:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1672266635; bh=KwCPVGMhnKnk3gOlN8lsIY4y9ZgU1B0i6eBSxJaRGbg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dKabyulCys+M+J4JxDAXMTOy9lXMIwitQBS6JpP9SPpLF8hA+qNK9sk2LJecA4xe8 q1ADHjRpWvzImu52fthjIdHLWBmyTvzr0iQ15Sm+BfuoXZUEgH0tEOLt73PGLjjczQ m4fP6jzANDUE6qoNPYEIVUl6YjUKVAaggtWkqYQMNx/c3R5fseYbCqOEefNA1RbuI8 5m8dek/8+QSfJ0CDkRMv50ScmSymd83JIvBecwm4ouYqFKl+nUwmvcYXdQpZicECRC NnQI27yLxv2FCShNfcG1RaC4R6hrQwKIZI69B8bmajVFAjX0yOQ1uaJrGvW4YXboZf MvBMmR+3IYeEw== 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 3FF66625E2 for ; Wed, 28 Dec 2022 23:30:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WWm0h8H0"; dkim-atps=neutral Received: from pyrite.mediacom.info (unknown [IPv6:2604:2d80:ad8a:9000:1bf9:855b:22de:3645]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C0926D0; Wed, 28 Dec 2022 23:30:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1672266628; bh=KwCPVGMhnKnk3gOlN8lsIY4y9ZgU1B0i6eBSxJaRGbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WWm0h8H0ntMl8qRegeQPzMC0UznKS0Zz9ghdEUFvhOOrUpEdsJsRxnZZNhDzKbWcW z+P/TAZDDfdtvU59rH7cSlULW31ieG6fqTyFCfLhqsx8qfDLdo3vTCMRVnFrJ+a7O+ 4t0jEuCI9Wj7NEFFHSyvfIgY338tHWPRh+0dVDYY= To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Dec 2022 16:29:53 -0600 Message-Id: <20221228223003.2265712-10-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221228223003.2265712-1-paul.elder@ideasonboard.com> References: <20221228223003.2265712-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v10 09/19] libcamera: pipeline: imx8-isi: Don't rely on bufferCount 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: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of using bufferCount as the number of V4L2 buffer slots to reserve in the isi pipeline handler, use a reasonably high constant: 16. Overallocating isn't a problem as buffer slots are cheap. Having too few, on the other hand, could degrade performance. It is expected that this number will be more than enough for most, if not all, use cases. Signed-off-by: Paul Elder --- New in v10 --- src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp index 434fbd63..73eeaf0e 100644 --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp @@ -148,6 +148,8 @@ private: std::unique_ptr crossbar_; std::vector pipes_; + + static constexpr unsigned int kBufferSlotCount = 16; }; /* ----------------------------------------------------------------------------- @@ -820,9 +822,8 @@ int PipelineHandlerISI::start(Camera *camera, for (const auto &stream : data->enabledStreams_) { Pipe *pipe = pipeFromStream(camera, stream); - const StreamConfiguration &config = stream->configuration(); - int ret = pipe->capture->importBuffers(config.bufferCount); + int ret = pipe->capture->importBuffers(kBufferSlotCount); if (ret) return ret;