Patch Detail
Show a patch.
GET /api/1.1/patches/23691/?format=api
{ "id": 23691, "url": "https://patchwork.libcamera.org/api/1.1/patches/23691/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23691/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250630081126.2384387-6-stefan.klug@ideasonboard.com>", "date": "2025-06-30T08:11:20", "name": "[v1,5/6] libcamera: pipeline: rkisp1: Don't rely on bufferCount", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e50b9152b0424a1c0e4d48d219d5dac3d7b54b0f", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23691/mbox/", "series": [ { "id": 5257, "url": "https://patchwork.libcamera.org/api/1.1/series/5257/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5257", "date": "2025-06-30T08:11:15", "name": "rkisp1: Allow usage of more than 4 buffers", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5257/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23691/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23691/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 8E7A4C3293\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Jun 2025 08:11:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B795E68E12;\n\tMon, 30 Jun 2025 10:11:52 +0200 (CEST)", "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 247FD68E04\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Jun 2025 10:11:47 +0200 (CEST)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:883b:eaf8:7aec:d1d4])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 8B9CE1352; \n\tMon, 30 Jun 2025 10:11:25 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"a9WL0VpV\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751271085;\n\tbh=D/M37FW2q6WdsWBGwEXaFTX/NL41SS2QvkI5Z2chawI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=a9WL0VpVw8B2/fPhFyoQM984cgSdPbF1rrGWVrfcu6wckmb2N+DvlR2voUuawu2RD\n\tOX7uJUJhJEd+rqV36UJ46w46pDRAjAGOhINJHjA5J5sXNISp658S3V6MTfNgbhRu4Y\n\tCSshyybZ3p1R9sBYBMf09LWywWh0yrVcTmkqvhMk=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>, =?utf-8?b?TsOtY29sYXMgRi4g?=\n\t=?utf-8?q?R=2E_A=2E_Prado?= <nfraprado@collabora.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>, =?utf-8?q?Sven_P=C3=BCschel?=\n\t<s.pueschel@pengutronix.de>", "Subject": "[PATCH v1 5/6] libcamera: pipeline: rkisp1: Don't rely on\n\tbufferCount", "Date": "Mon, 30 Jun 2025 10:11:20 +0200", "Message-ID": "<20250630081126.2384387-6-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.48.1", "In-Reply-To": "<20250630081126.2384387-1-stefan.klug@ideasonboard.com>", "References": "<20250630081126.2384387-1-stefan.klug@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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>", "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.\nInstead, the number of internal buffers should be the minimum required\nby the pipeline to keep the requests flowing, in order to avoid wasting\nmemory.\n\nStop relying on bufferCount for these numbers and instead set them to\nkPipelineDepth, as this already limits the number of buffers queued\nto the driver.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Sven Püschel <s.pueschel@pengutronix.de>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 15 +++++++--------\n 1 file changed, 7 insertions(+), 8 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 9d7b05490af6..0106dcff23a0 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -157,6 +157,10 @@ private:\n \n namespace {\n \n+/*\n+ * This many internal buffers (or rather parameter and statistics buffer\n+ * pairs) ensures that the pipeline runs smoothly, without frame drops.\n+ */\n const unsigned int kPipelineDepth = 4;\n \n };\n@@ -990,24 +994,19 @@ 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(kPipelineDepth, ¶mBuffers_);\n \t\tif (ret < 0)\n \t\t\tgoto error;\n \n-\t\tret = stat_->allocateBuffers(maxCount, &statBuffers_);\n+\t\tret = stat_->allocateBuffers(kPipelineDepth, &statBuffers_);\n \t\tif (ret < 0)\n \t\t\tgoto error;\n \t}\n \n \t/* If the dewarper is being used, allocate internal buffers for ISP. */\n \tif (useDewarper_) {\n-\t\tret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);\n+\t\tret = mainPath_.exportBuffers(kPipelineDepth, &mainPathBuffers_);\n \t\tif (ret < 0)\n \t\t\tgoto error;\n \n", "prefixes": [ "v1", "5/6" ] }