From patchwork Fri Apr 9 21:38:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 11885 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 8430BBD16B for ; Fri, 9 Apr 2021 21:38:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5229F68800; Fri, 9 Apr 2021 23:38:53 +0200 (CEST) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AFB84687EF for ; Fri, 9 Apr 2021 23:38:52 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2804:14c:1a9:2978:fcbb:7aa5:bea8:667e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nfraprado) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 87F9A1F46AB2; Fri, 9 Apr 2021 22:38:50 +0100 (BST) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: libcamera-devel@lists.libcamera.org Date: Fri, 9 Apr 2021 18:38:15 -0300 Message-Id: <20210409213815.356837-4-nfraprado@collabora.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409213815.356837-1-nfraprado@collabora.com> References: <20210409213815.356837-1-nfraprado@collabora.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 3/3] libcamera: pipeline: rkisp1: Make fixed amount of internal buffer allocation more explicit 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: Collabora Kernel ML Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that bufferCount can be increased and there is a lc-compliance test in place to check if the pipeline can handle more requests than it has internal buffers, we need to be able to test it. Make the internal buffer allocation always constant, so that by increasing bufferCount we can simulate this scenario. Scaling the internal buffers amount with bufferCount only hides the issue, that should be handled by queueing the overflowing requests. Signed-off-by: NĂ­colas F. R. A. Prado --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++------- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index c7b93b2804c7..0dc474f343fc 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -685,16 +685,11 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera) unsigned int ipaBufferId = 1; int ret; - unsigned int maxCount = std::max({ - data->mainPathStream_.configuration().bufferCount, - data->selfPathStream_.configuration().bufferCount, - }); - - ret = param_->allocateBuffers(maxCount, ¶mBuffers_); + ret = param_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, ¶mBuffers_); if (ret < 0) goto error; - ret = stat_->allocateBuffers(maxCount, &statBuffers_); + ret = stat_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, &statBuffers_); if (ret < 0) goto error; diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index 13291da89dc5..4ab4c0516ebc 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -21,6 +21,8 @@ namespace libcamera { +static constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4; + class MediaDevice; class V4L2Subdevice; struct StreamConfiguration; @@ -56,8 +58,6 @@ public: Signal &bufferReady() { return video_->bufferReady; } private: - static constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4; - const char *name_; bool running_;