Show a patch.

GET /api/1.1/patches/23281/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 23281,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/23281/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23281/",
    "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": "<20250428090413.38234-10-s.pueschel@pengutronix.de>",
    "date": "2025-04-28T09:02:34",
    "name": "[v11,09/19] libcamera: pipeline: mali-c55: Don't rely on bufferCount",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6b1b7e11a9995ae06b31d551e42967e8b3686ea8",
    "submitter": {
        "id": 225,
        "url": "https://patchwork.libcamera.org/api/1.1/people/225/?format=api",
        "name": "Sven Püschel",
        "email": "s.pueschel@pengutronix.de"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23281/mbox/",
    "series": [
        {
            "id": 5148,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5148/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5148",
            "date": "2025-04-28T09:02:25",
            "name": "lc-compliance: Add test to queue more requests than hardware depth",
            "version": 11,
            "mbox": "https://patchwork.libcamera.org/series/5148/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23281/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23281/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 C3B97C3323\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Apr 2025 09:05:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 025DB68B36;\n\tMon, 28 Apr 2025 11:05:26 +0200 (CEST)",
            "from metis.whiteo.stw.pengutronix.de\n\t(metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 93D7568ADB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Apr 2025 11:05:07 +0200 (CEST)",
            "from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77]\n\thelo=peter.guest.stw.pengutronix.de)\n\tby metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)\n\t(envelope-from <s.pueschel@pengutronix.de>)\n\tid 1u9KQF-0001au-77; Mon, 28 Apr 2025 11:05:07 +0200"
        ],
        "From": "=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "=?utf-8?q?Sven_P=C3=BCschel?= <s.pueschel@pengutronix.de>",
        "Subject": "[PATCH v11 09/19] libcamera: pipeline: mali-c55: Don't rely on\n\tbufferCount",
        "Date": "Mon, 28 Apr 2025 11:02:34 +0200",
        "Message-ID": "<20250428090413.38234-10-s.pueschel@pengutronix.de>",
        "X-Mailer": "git-send-email 2.49.0",
        "In-Reply-To": "<20250428090413.38234-1-s.pueschel@pengutronix.de>",
        "References": "<20250428090413.38234-1-s.pueschel@pengutronix.de>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-SA-Exim-Connect-IP": "2a0a:edc0:0:900:1d::77",
        "X-SA-Exim-Mail-From": "s.pueschel@pengutronix.de",
        "X-SA-Exim-Scanned": "No (on metis.whiteo.stw.pengutronix.de);\n\tSAEximRunCond expanded to false",
        "X-PTX-Original-Recipient": "libcamera-devel@lists.libcamera.org",
        "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": "Instead of using bufferCount as the number of V4L2 buffer slots to\nreserve in the mali-c55 pipeline handler. Instead of using the previous\nbufferCount value of 4 use the higher value of 16 like in other pipeline\nhandlers to avoid trashing dmabuf mappings if the application cycles\nmore than 4 buffers.\n\nThis makes way for removing bufferCount.\n\nSigned-off-by: Sven Püschel <s.pueschel@pengutronix.de>\n\n---\nChanges in v11:\n- Added\n---\n src/libcamera/pipeline/mali-c55/mali-c55.cpp | 22 ++++++++++----------\n 1 file changed, 11 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\nindex 9df1622e..726d9780 100644\n--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n@@ -701,6 +701,14 @@ private:\n \tstd::array<MaliC55Pipe, MaliC55NumPipes> pipes_;\n \n \tbool dsFitted_;\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 * \\todo check if this can be lowered\n+\t */\n+\tstatic constexpr unsigned int kMaliC55InternalBufferCount = 4;\n+\tstatic constexpr unsigned int kMaliC55BufferSlotCount = 16;\n };\n \n PipelineHandlerMaliC55::PipelineHandlerMaliC55(CameraManager *manager)\n@@ -1128,15 +1136,9 @@ int PipelineHandlerMaliC55::allocateBuffers(Camera *camera)\n {\n \tMaliC55CameraData *data = cameraData(camera);\n \tunsigned int ipaBufferId = 1;\n-\tunsigned int bufferCount;\n \tint ret;\n \n-\tbufferCount = std::max({\n-\t\tdata->frStream_.configuration().bufferCount,\n-\t\tdata->dsStream_.configuration().bufferCount,\n-\t});\n-\n-\tret = stats_->allocateBuffers(bufferCount, &statsBuffers_);\n+\tret = stats_->allocateBuffers(kMaliC55InternalBufferCount, &statsBuffers_);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -1147,7 +1149,7 @@ int PipelineHandlerMaliC55::allocateBuffers(Camera *camera)\n \t\tavailableStatsBuffers_.push(buffer.get());\n \t}\n \n-\tret = params_->allocateBuffers(bufferCount, &paramsBuffers_);\n+\tret = params_->allocateBuffers(kMaliC55InternalBufferCount, &paramsBuffers_);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -1189,9 +1191,7 @@ int PipelineHandlerMaliC55::start(Camera *camera, [[maybe_unused]] const Control\n \t\tif (!pipe.stream)\n \t\t\tcontinue;\n \n-\t\tStream *stream = pipe.stream;\n-\n-\t\tret = pipe.cap->importBuffers(stream->configuration().bufferCount);\n+\t\tret = pipe.cap->importBuffers(kMaliC55BufferSlotCount);\n \t\tif (ret) {\n \t\t\tLOG(MaliC55, Error) << \"Failed to import buffers\";\n \t\t\tif (data->ipa_)\n",
    "prefixes": [
        "v11",
        "09/19"
    ]
}