{"id":11885,"url":"https://patchwork.libcamera.org/api/1.1/patches/11885/?format=json","web_url":"https://patchwork.libcamera.org/patch/11885/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210409213815.356837-4-nfraprado@collabora.com>","date":"2021-04-09T21:38:15","name":"[libcamera-devel,RFC,3/3] libcamera: pipeline: rkisp1: Make fixed amount of internal buffer allocation more explicit","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c2bd07ee76738df02fde31fae6e086317a71524e","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/1.1/people/84/?format=json","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11885/mbox/","series":[{"id":1908,"url":"https://patchwork.libcamera.org/api/1.1/series/1908/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1908","date":"2021-04-09T21:38:12","name":"Add lc-compliance test for overflowing requests","version":1,"mbox":"https://patchwork.libcamera.org/series/1908/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11885/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11885/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8430BBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  9 Apr 2021 21:38:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5229F68800;\n\tFri,  9 Apr 2021 23:38:53 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AFB84687EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Apr 2021 23:38:52 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2978:fcbb:7aa5:bea8:667e])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 87F9A1F46AB2;\n\tFri,  9 Apr 2021 22:38:50 +0100 (BST)"],"From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","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\n\tfixed amount of internal buffer allocation more explicit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"Collabora Kernel ML <kernel@collabora.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Now that bufferCount can be increased and there is a lc-compliance test\nin place to check if the pipeline can handle more requests than it has\ninternal buffers, we need to be able to test it.\n\nMake the internal buffer allocation always constant, so that by\nincreasing bufferCount we can simulate this scenario. Scaling the\ninternal buffers amount with bufferCount only hides the issue, that\nshould be handled by queueing the overflowing requests.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp    | 9 ++-------\n src/libcamera/pipeline/rkisp1/rkisp1_path.h | 4 ++--\n 2 files changed, 4 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex c7b93b2804c7..0dc474f343fc 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -685,16 +685,11 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)\n \tunsigned int ipaBufferId = 1;\n \tint ret;\n \n-\tunsigned int maxCount = std::max({\n-\t\tdata->mainPathStream_.configuration().bufferCount,\n-\t\tdata->selfPathStream_.configuration().bufferCount,\n-\t});\n-\n-\tret = param_->allocateBuffers(maxCount, &paramBuffers_);\n+\tret = param_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, &paramBuffers_);\n \tif (ret < 0)\n \t\tgoto error;\n \n-\tret = stat_->allocateBuffers(maxCount, &statBuffers_);\n+\tret = stat_->allocateBuffers(RKISP1_MIN_BUFFER_COUNT, &statBuffers_);\n \tif (ret < 0)\n \t\tgoto error;\n \ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex 13291da89dc5..4ab4c0516ebc 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -21,6 +21,8 @@\n \n namespace libcamera {\n \n+static constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4;\n+\n class MediaDevice;\n class V4L2Subdevice;\n struct StreamConfiguration;\n@@ -56,8 +58,6 @@ public:\n \tSignal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }\n \n private:\n-\tstatic constexpr unsigned int RKISP1_MIN_BUFFER_COUNT = 4;\n-\n \tconst char *name_;\n \tbool running_;\n \n","prefixes":["libcamera-devel","RFC","3/3"]}