Patch Detail
Show a patch.
GET /api/1.1/patches/23747/?format=api
{ "id": 23747, "url": "https://patchwork.libcamera.org/api/1.1/patches/23747/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23747/", "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": "<20250707075400.9079-5-stefan.klug@ideasonboard.com>", "date": "2025-07-07T07:53:38", "name": "[v2,4/5] pipeline: rkisp1: Properly handle the bufferCount set in the stream configuration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "226fafda03e19028ed23a671a3d19c5c4a4d5ada", "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/23747/mbox/", "series": [ { "id": 5272, "url": "https://patchwork.libcamera.org/api/1.1/series/5272/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5272", "date": "2025-07-07T07:53:34", "name": "rkisp1: Allow usage of more than 4 buffers", "version": 2, "mbox": "https://patchwork.libcamera.org/series/5272/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23747/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23747/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 7A5A3C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 7 Jul 2025 07:54:30 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9027068E8A;\n\tMon, 7 Jul 2025 09:54:29 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 26AB568E7F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 7 Jul 2025 09:54:24 +0200 (CEST)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:c79f:85df:e7f5:4c31])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 7D48D9CA;\n\tMon, 7 Jul 2025 09:53:57 +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=\"ap6ms3kr\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751874837;\n\tbh=yM8Kf73Aeg3TPvTYh2uujN5Rh09/lPziHX1KXP2CNwc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ap6ms3krJPMAyGuXVTZpFrFl3vWALNHF8mItj7ELPWvd1NdV8fvNTbLm3Iho5vplx\n\temBEEK0UNPWP2iCj8oBfSCgUtK/tVyIt3v6hS62VKHGdNOmx/Ja9QWu7PaE+21zOEn\n\tQfTAdrVs+P2gprcycph/ILkVF17dFmoy1pI1mCXQ=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[PATCH v2 4/5] pipeline: rkisp1: Properly handle the bufferCount set\n\tin the stream configuration", "Date": "Mon, 7 Jul 2025 09:53:38 +0200", "Message-ID": "<20250707075400.9079-5-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.48.1", "In-Reply-To": "<20250707075400.9079-1-stefan.klug@ideasonboard.com>", "References": "<20250707075400.9079-1-stefan.klug@ideasonboard.com>", "MIME-Version": "1.0", "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": "The bufferCount is reset to a hardcoded value of 4 in\nRkISP1Path::validate(). Keep the default value of 4 but do not reset\nit, if it was changed. This allows the user to set bufferCount to an\narbitrary number of buffers which then can be allocated for example by\nthe FrameBufferAllocator. Internally maxQueuedRequestsDevice_ is used as\nbuffer count which is the maximum number of buffers queued to the device\nat once.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\n\nChanges in v1:\n- Removed todo comment that was solved by this change\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++--\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 7 ++-----\n src/libcamera/pipeline/rkisp1/rkisp1_path.h | 4 +---\n 3 files changed, 6 insertions(+), 10 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex fff42359cbff..bdaeb935ee06 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -790,6 +790,7 @@ PipelineHandlerRkISP1::generateConfiguration(Camera *camera,\n \t\t\treturn nullptr;\n \n \t\tcfg.colorSpace = colorSpace;\n+\t\tcfg.bufferCount = kPipelineDepth;\n \t\tconfig->addConfiguration(cfg);\n \t}\n \n@@ -1123,14 +1124,14 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n \t}\n \n \tif (data->mainPath_->isEnabled()) {\n-\t\tret = mainPath_.start();\n+\t\tret = mainPath_.start(maxQueuedRequestsDevice_);\n \t\tif (ret)\n \t\t\treturn ret;\n \t\tactions += [&]() { mainPath_.stop(); };\n \t}\n \n \tif (hasSelfPath_ && data->selfPath_->isEnabled()) {\n-\t\tret = selfPath_.start();\n+\t\tret = selfPath_.start(maxQueuedRequestsDevice_);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex 64018dc5b2f4..8ea5500d4080 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -249,7 +249,6 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size,\n \tStreamConfiguration cfg(formats);\n \tcfg.pixelFormat = format;\n \tcfg.size = streamSize;\n-\tcfg.bufferCount = RKISP1_BUFFER_COUNT;\n \n \treturn cfg;\n }\n@@ -383,7 +382,6 @@ RkISP1Path::validate(const CameraSensor *sensor,\n \n \tcfg->size.boundTo(maxResolution);\n \tcfg->size.expandTo(minResolution);\n-\tcfg->bufferCount = RKISP1_BUFFER_COUNT;\n \n \tV4L2DeviceFormat format;\n \tformat.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\n@@ -480,15 +478,14 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n \treturn 0;\n }\n \n-int RkISP1Path::start()\n+int RkISP1Path::start(unsigned int bufferCount)\n {\n \tint ret;\n \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(bufferCount);\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 430181d371a7..0b60c499ac64 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -58,7 +58,7 @@ public:\n \t\treturn video_->exportBuffers(bufferCount, buffers);\n \t}\n \n-\tint start();\n+\tint start(unsigned int bufferCount);\n \tvoid stop();\n \n \tint queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }\n@@ -69,8 +69,6 @@ private:\n \tvoid populateFormats();\n \tSize filterSensorResolution(const CameraSensor *sensor);\n \n-\tstatic constexpr unsigned int RKISP1_BUFFER_COUNT = 4;\n-\n \tconst char *name_;\n \tbool running_;\n \n", "prefixes": [ "v2", "4/5" ] }