Patch Detail
Show a patch.
GET /api/patches/18021/?format=api
{ "id": 18021, "url": "https://patchwork.libcamera.org/api/patches/18021/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18021/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20221216122939.256534-8-paul.elder@ideasonboard.com>", "date": "2022-12-16T12:29:28", "name": "[libcamera-devel,v9,07/18] libcamera: pipeline: rkisp1: Don't rely on bufferCount", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "490b80dd3349672b96189dd60123d17c8dac8d0c", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18021/mbox/", "series": [ { "id": 3675, "url": "https://patchwork.libcamera.org/api/series/3675/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3675", "date": "2022-12-16T12:29:21", "name": "lc-compliance: Add test to queue more requests than hardware depth", "version": 9, "mbox": "https://patchwork.libcamera.org/series/3675/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18021/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18021/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 86D7DC328E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Dec 2022 12:30:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3657E6339E;\n\tFri, 16 Dec 2022 13:30:15 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 43F1B633A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Dec 2022 13:30:14 +0100 (CET)", "from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CE075158D;\n\tFri, 16 Dec 2022 13:30:12 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671193815;\n\tbh=Tfmed31QJsiSFUJTl8LXBMnkbz7VKjAsoTW99wZxYjM=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=DiuvFDfX+l78FI03rbM8jco9Qg++vFZYuOF3fYZjak2ESql9j7N0U2gsYstjKJlhr\n\tYV61CXb36wi4a9Re3fvp0COqzdEUmpyyRUHmTWDaUmW11CPCoaVDQn6av+Th+6owp3\n\tGQzTjR1jB0heExwCtuO5I2LvE+dYPafyvzX7HeaFPPseUFu2VMlFSQNPiKI8myVlCe\n\tQHFLFx88c5LE69eA+J1Gg7WlKYsWSznmHBck+PX/SeLDG3fIw00cloTAC7y6Iw05Ss\n\tFCNeFA1+ETZGPHReD83s6y5pfRabpNcClSf2jWCloSKUt87TU/PFLG1efxDauQRfV8\n\td14YfTThSpH8g==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671193814;\n\tbh=Tfmed31QJsiSFUJTl8LXBMnkbz7VKjAsoTW99wZxYjM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=k7h53e2o31XciafZbNahfKuPibwGv6CnhjGZYie/Jfu/8r5fNVmB6+4GElntJBts0\n\tyMmoaW5jDbllxwuPRiLkAQSBcwPXEFHdSesWw10kffBua5koJkdfzEHTpDaQgYcZSZ\n\tXPr8YUziOK6WDmv/A/STUaOQZa9y3kG83hTMw5+s=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"k7h53e2o\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 16 Dec 2022 21:29:28 +0900", "Message-Id": "<20221216122939.256534-8-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20221216122939.256534-1-paul.elder@ideasonboard.com>", "References": "<20221216122939.256534-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v9 07/18] libcamera: pipeline: rkisp1:\n\tDon't rely on bufferCount", "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>", "From": "Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Paul Elder <paul.elder@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n\nCurrently the rkisp1 pipeline handler relies on bufferCount to decide on\nthe number of parameter and statistics buffers to allocate internally\nand for the number of V4L2 buffer slots to reserve. Instead, the number\nof internal buffers should be the minimum required by the pipeline to\nkeep the requests flowing, in order to avoid wasting memory, while the\nnumber of V4L2 buffer slots should be greater than the expected number\nof requests queued by the application, in order to avoid thrashing\ndmabuf mappings, which would degrade performance.\n\nStop relying on bufferCount for these numbers and instead set them to\nappropriate, and independent, constants.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v9:\n- rebased\n\nChanges in v8:\n- New\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 19 ++++++++++++-------\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 3 +--\n src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 ++\n 3 files changed, 15 insertions(+), 9 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 8fe37c4f..5028ef1a 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -199,6 +199,16 @@ private:\n \tCamera *activeCamera_;\n \n \tconst MediaPad *ispSink_;\n+\n+\t/*\n+\t * This many internal buffers (or rather parameter and statistics buffer\n+\t * pairs) ensures that the pipeline runs smoothly, without frame drops.\n+\t * This number considers:\n+\t * - three buffers queued to the driver, which is also the minimum\n+\t * required to start streaming\n+\t * - one buffer being processed on the IPA\n+\t */\n+\tstatic constexpr unsigned int kRkISP1InternalBufferCount = 4;\n };\n \n RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)\n@@ -835,17 +845,12 @@ 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 \tif (!isRaw_) {\n-\t\tret = param_->allocateBuffers(maxCount, ¶mBuffers_);\n+\t\tret = param_->allocateBuffers(kRkISP1InternalBufferCount, ¶mBuffers_);\n \t\tif (ret < 0)\n \t\t\tgoto error;\n \n-\t\tret = stat_->allocateBuffers(maxCount, &statBuffers_);\n+\t\tret = stat_->allocateBuffers(kRkISP1InternalBufferCount, &statBuffers_);\n \t\tif (ret < 0)\n \t\t\tgoto error;\n \t}\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex 5079b268..a168e0ad 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -370,8 +370,7 @@ int RkISP1Path::start()\n \tif (running_)\n \t\treturn -EBUSY;\n \n-\t/* \\todo Make buffer count user configurable. */\n-\tret = video_->importBuffers(RKISP1_BUFFER_COUNT);\n+\tret = video_->importBuffers(kRkISP1BufferSlotCount);\n \tif (ret)\n \t\treturn ret;\n \ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex bdf3f95b..5b53783c 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -76,6 +76,8 @@ private:\n \tstd::unique_ptr<V4L2Subdevice> resizer_;\n \tstd::unique_ptr<V4L2VideoDevice> video_;\n \tMediaLink *link_;\n+\n+\tstatic constexpr unsigned int kRkISP1BufferSlotCount = 16;\n };\n \n class RkISP1MainPath : public RkISP1Path\n", "prefixes": [ "libcamera-devel", "v9", "07/18" ] }