Show a patch.

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

{
    "id": 26179,
    "url": "https://patchwork.libcamera.org/api/patches/26179/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26179/",
    "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": "<20260216203034.27558-11-mzamazal@redhat.com>",
    "date": "2026-02-16T20:30:29",
    "name": "[RFC,v2,10/14] libcamera: software_isp: Introduce arguments for statistics buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5e91d41dbca612d3eaf2532cff24ea47b290ce48",
    "submitter": {
        "id": 177,
        "url": "https://patchwork.libcamera.org/api/people/177/?format=api",
        "name": "Milan Zamazal",
        "email": "mzamazal@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26179/mbox/",
    "series": [
        {
            "id": 5795,
            "url": "https://patchwork.libcamera.org/api/series/5795/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5795",
            "date": "2026-02-16T20:30:19",
            "name": "Software ISP: Share params and stats buffers",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5795/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26179/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26179/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 92F81C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Feb 2026 20:31:05 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 51BAC62232;\n\tMon, 16 Feb 2026 21:31:05 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C1866221D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Feb 2026 21:31:03 +0100 (CET)",
            "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-43-9cqGMfTLNz-HNVpG6Xugpg-1;\n\tMon, 16 Feb 2026 15:31:00 -0500",
            "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.93])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS\n\tid 6B6AB180034D for <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Feb 2026 20:30:59 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.25])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 2D0001800464; Mon, 16 Feb 2026 20:30:57 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"OwInZ/Yl\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1771273862;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=4qAvsc1pwWcThY/Mhwrt2f8MKgpjp3McXlfI2EtssZg=;\n\tb=OwInZ/YlhwJunhAbTUj+VI9xoyfX5GOOX7Sx2IuCgJv48UD9BEN1FFdlFAKlUlStFvZt45\n\tkVSEZhgy0TB3I8jz3Se7YGH98DAaAdF6VPmbHy5lpdyqrf5zf/QOGXXFADbX8yLRt0fnMy\n\t/Mq12QyIVQUv2pt3TM7NrMv2tZrbx0A=",
        "X-MC-Unique": "9cqGMfTLNz-HNVpG6Xugpg-1",
        "X-Mimecast-MFC-AGG-ID": "9cqGMfTLNz-HNVpG6Xugpg_1771273859",
        "From": "Milan Zamazal <mzamazal@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Milan Zamazal <mzamazal@redhat.com>",
        "Subject": "[RFC PATCH v2 10/14] libcamera: software_isp: Introduce arguments\n\tfor statistics buffers",
        "Date": "Mon, 16 Feb 2026 21:30:29 +0100",
        "Message-ID": "<20260216203034.27558-11-mzamazal@redhat.com>",
        "In-Reply-To": "<20260216203034.27558-1-mzamazal@redhat.com>",
        "References": "<20260216203034.27558-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "i30xJTl0WEBYHwLIIswZVPprBOKjXVHVVxrM0A5ZgfM_1771273859",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "Statistics in software ISP is held in two fixed buffers, copying the\nstatistics from the working one to the shared one in\nSwIspStats::finishFrame.  This patch introduces support for a ring of\nstatistics buffers that are never copied, similarly to parameters\nbuffers and to how hardware pipelines operate.  This is to address\nsoftware ISP TODO #2.\n\nThe patch adds a new argument statsBufferId for the future parameters\nbuffer ids passed to the calls.  The buffer ids must be passed to the\nfollowing groups of methods:\n\n- SwStatsCpu::startFrame, to reset the statistics.\n\n- Debayer::process, to signal what statistics buffer is started and\n  stopped being used to gather the statistics.\n\n- SoftwareIsp::statsProcessed, a new signal to indicate that the given\n  statistics buffer contents is no longer needed.\n\nThe type of the buffer id statistics is set to uint32_t because:\n\n- It can be used in mojom.\n- The same type is used for parameters buffers.\n- It is consistent with the similar types in the hardware pipelines.\n- It covers file descriptor number range, which will be used as buffer\n  ids.\n\nAlready provided statistics buffer arguments are renamed from bufferId\nto statsBufferId for consistency and to avoid confusion between\nstatistics and parameters buffer id arguments.\n\nThis patch doesn't do more than adding the arguments, to keep the patch\nsimple.  The buffer handling will be implemented in the followup\npatches.\n\nStatistics and parameters buffers use is coupled to much extent.  It can\nbe tempting to perhaps use the same buffer ids and perhaps some common\nsignals.  But it's better to keep them separate to avoid contingent\nfuture refactoring in case this coupling becomes less tight in future.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/software_isp.h      |  3 ++-\n .../internal/software_isp/swstats_cpu.h       |  4 ++--\n include/libcamera/ipa/soft.mojom              |  3 ++-\n src/ipa/simple/soft_simple.cpp                |  3 ++-\n src/libcamera/pipeline/simple/simple.cpp      |  7 ++++---\n src/libcamera/software_isp/debayer.cpp        |  3 ++-\n src/libcamera/software_isp/debayer.h          |  1 +\n src/libcamera/software_isp/debayer_cpu.cpp    | 16 +++++++--------\n src/libcamera/software_isp/debayer_cpu.h      |  4 +++-\n src/libcamera/software_isp/debayer_egl.cpp    |  7 +++++--\n src/libcamera/software_isp/debayer_egl.h      |  7 +++++--\n src/libcamera/software_isp/software_isp.cpp   | 13 +++++++++---\n src/libcamera/software_isp/swstats_cpu.cpp    | 20 ++++++++++---------\n 13 files changed, 56 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\nindex 65348e213..519dfc71a 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -93,7 +93,8 @@ private:\n \tvoid saveIspParams(uint32_t paramsBufferId);\n \tvoid releaseIspParams(uint32_t paramsBufferId);\n \tvoid setSensorCtrls(const ControlList &sensorControls);\n-\tvoid statsReady(uint32_t frame, uint32_t bufferId);\n+\tvoid statsReady(uint32_t frame, const uint32_t statsBufferId);\n+\tvoid statsProcessed(const uint32_t statsBufferId);\n \tvoid inputReady(FrameBuffer *input);\n \tvoid outputReady(FrameBuffer *output);\n \tstd::unique_ptr<Debayer> debayer_;\ndiff --git a/include/libcamera/internal/software_isp/swstats_cpu.h b/include/libcamera/internal/software_isp/swstats_cpu.h\nindex 64b3e23f5..ae8ce1e59 100644\n--- a/include/libcamera/internal/software_isp/swstats_cpu.h\n+++ b/include/libcamera/internal/software_isp/swstats_cpu.h\n@@ -53,8 +53,8 @@ public:\n \n \tint configure(const StreamConfiguration &inputCfg);\n \tvoid setWindow(const Rectangle &window);\n-\tvoid startFrame(uint32_t frame);\n-\tvoid finishFrame(uint32_t frame, uint32_t bufferId);\n+\tvoid startFrame(uint32_t frame, const uint32_t statsBufferId);\n+\tvoid finishFrame(uint32_t frame, const uint32_t statsBufferId);\n \tvoid processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input);\n \n \tvoid processLine0(uint32_t frame, unsigned int y, const uint8_t *src[])\ndiff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\nindex 4738a1b46..5ebe2864c 100644\n--- a/include/libcamera/ipa/soft.mojom\n+++ b/include/libcamera/ipa/soft.mojom\n@@ -27,12 +27,13 @@ interface IPASoftInterface {\n \t[async] queueRequest(uint32 frame, libcamera.ControlList sensorControls);\n \t[async] computeParams(uint32 frame, uint32 paramsBufferId);\n \t[async] processStats(uint32 frame,\n-\t\t\t     uint32 bufferId,\n+\t\t\t     uint32 statsBufferId,\n \t\t\t     libcamera.ControlList sensorControls);\n };\n \n interface IPASoftEventInterface {\n \tsetSensorControls(libcamera.ControlList sensorControls);\n+\tstatsProcessed(uint32 statsBufferId);\n \tsetIspParams(uint32 paramsBufferId);\n \tmetadataReady(uint32 frame, libcamera.ControlList metadata);\n };\ndiff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\nindex f212fabe3..4a681babe 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -300,7 +300,7 @@ void IPASoftSimple::computeParams(const uint32_t frame,\n }\n \n void IPASoftSimple::processStats(const uint32_t frame,\n-\t\t\t\t [[maybe_unused]] const uint32_t bufferId,\n+\t\t\t\t const uint32_t statsBufferId,\n \t\t\t\t const ControlList &sensorControls)\n {\n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n@@ -314,6 +314,7 @@ void IPASoftSimple::processStats(const uint32_t frame,\n \tfor (auto const &algo : algorithms())\n \t\talgo->process(context_, frame, frameContext, stats_, metadata);\n \tmetadataReady.emit(frame, metadata);\n+\tstatsProcessed.emit(statsBufferId);\n \n \t/* Sanity check */\n \tif (!sensorControls.contains(V4L2_CID_EXPOSURE) ||\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex dc9176c29..9e2c2a493 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -369,7 +369,7 @@ private:\n \tvoid conversionInputDone(FrameBuffer *buffer);\n \tvoid conversionOutputDone(FrameBuffer *buffer);\n \n-\tvoid ispStatsReady(uint32_t frame, uint32_t bufferId);\n+\tvoid ispStatsReady(uint32_t frame, const uint32_t statsBufferId);\n \tvoid metadataReady(uint32_t frame, const ControlList &metadata);\n \tvoid setSensorControls(const ControlList &sensorControls);\n };\n@@ -1025,9 +1025,10 @@ void SimpleCameraData::conversionOutputDone(FrameBuffer *buffer)\n \t\ttryCompleteRequest(request);\n }\n \n-void SimpleCameraData::ispStatsReady(uint32_t frame, uint32_t bufferId)\n+void SimpleCameraData::ispStatsReady(uint32_t frame,\n+\t\t\t\t     const uint32_t statsBufferId)\n {\n-\tswIsp_->processStats(frame, bufferId,\n+\tswIsp_->processStats(frame, statsBufferId,\n \t\t\t     delayedCtrls_->get(frame));\n }\n \ndiff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex ad47c1e8d..f3f241e14 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -122,9 +122,10 @@ Debayer::~Debayer()\n  */\n \n /**\n- * \\fn void Debayer::process(uint32_t frame, const uint32_t paramsBufferId, FrameBuffer *input, FrameBuffer *output)\n+ * \\fn void Debayer::process(uint32_t frame, const uint32_t statsBufferId, const uint32_t paramsBufferId, FrameBuffer *input, FrameBuffer *output)\n  * \\brief Process the bayer data into the requested format\n  * \\param[in] frame The frame number\n+ * \\param[in] statsBufferId The id of the stats buffer to use\n  * \\param[in] paramsBufferId The id of the params buffer in use\n  * \\param[in] input The input buffer\n  * \\param[in] output The output buffer\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex a66d0cbbe..9f08a7f4e 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -49,6 +49,7 @@ public:\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;\n \n \tvirtual void process(uint32_t frame,\n+\t\t\t     const uint32_t statsBufferId,\n \t\t\t     const uint32_t paramsBufferId,\n \t\t\t     FrameBuffer *input, FrameBuffer *output) = 0;\n \tvirtual int start() { return 0; }\ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 927ac7d10..6f2d70617 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -846,8 +846,11 @@ void DebayerCpu::updateLookupTables(const DebayerParams *params)\n \tparams_ = *params;\n }\n \n-void DebayerCpu::process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t\t FrameBuffer *input, FrameBuffer *output)\n+void DebayerCpu::process(uint32_t frame,\n+\t\t\t const uint32_t statsBufferId,\n+\t\t\t const uint32_t paramsBufferId,\n+\t\t\t FrameBuffer *input,\n+\t\t\t FrameBuffer *output)\n {\n \tbench_.startFrame();\n \n@@ -873,7 +876,7 @@ void DebayerCpu::process(uint32_t frame, const uint32_t paramsBufferId,\n \t\treturn;\n \t}\n \n-\tstats_->startFrame(frame);\n+\tstats_->startFrame(frame, statsBufferId);\n \n \tif (inputConfig_.patternSize.height == 2)\n \t\tprocess2(frame, in.planes()[0].data(), out.planes()[0].data());\n@@ -887,12 +890,7 @@ void DebayerCpu::process(uint32_t frame, const uint32_t paramsBufferId,\n \t/* Measure before emitting signals */\n \tbench_.finishFrame();\n \n-\t/*\n-\t * Buffer ids are currently not used, so pass zeros as its parameter.\n-\t *\n-\t * \\todo Pass real bufferId once stats buffer passing is changed.\n-\t */\n-\tstats_->finishFrame(frame, 0);\n+\tstats_->finishFrame(frame, statsBufferId);\n \toutputBufferReady.emit(output);\n \tinputBufferReady.emit(input);\n }\ndiff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\nindex 5e3670b37..8d38fa43f 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -43,8 +43,10 @@ public:\n \tstd::tuple<unsigned int, unsigned int>\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n \tvoid process(uint32_t frame,\n+\t\t     const uint32_t statsBufferId,\n \t\t     const uint32_t paramsBufferId,\n-\t\t     FrameBuffer *input, FrameBuffer *output);\n+\t\t     FrameBuffer *input,\n+\t\t     FrameBuffer *output);\n \tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n \tconst SharedFD &getStatsFD() { return stats_->getStatsFD(); }\n \ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex c24590994..5715b80ae 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -536,8 +536,11 @@ int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParam\n \treturn 0;\n }\n \n-void DebayerEGL::process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t\t FrameBuffer *input, FrameBuffer *output)\n+void DebayerEGL::process(uint32_t frame,\n+\t\t\t [[maybe_unused]] const uint32_t statsBufferId,\n+\t\t\t const uint32_t paramsBufferId,\n+\t\t\t FrameBuffer *input,\n+\t\t\t FrameBuffer *output)\n {\n \tbench_.startFrame();\n \ndiff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\nindex 435ff7d31..3504c0d4f 100644\n--- a/src/libcamera/software_isp/debayer_egl.h\n+++ b/src/libcamera/software_isp/debayer_egl.h\n@@ -52,8 +52,11 @@ public:\n \tstd::vector<PixelFormat> formats(PixelFormat input);\n \tstd::tuple<unsigned int, unsigned int> strideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n \n-\tvoid process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t     FrameBuffer *input, FrameBuffer *output);\n+\tvoid process(uint32_t frame,\n+\t\t     const uint32_t statsBufferId,\n+\t\t     const uint32_t paramsBufferId,\n+\t\t     FrameBuffer *input,\n+\t\t     FrameBuffer *output);\n \tint start();\n \tvoid stop();\n \ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 230396bee..04aaf7a8c 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -164,6 +164,7 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \t\treturn;\n \t}\n \n+\tipa_->statsProcessed.connect(this, &SoftwareIsp::statsProcessed);\n \tipa_->setIspParams.connect(this, &SoftwareIsp::saveIspParams);\n \tipa_->metadataReady.connect(this,\n \t\t\t\t    [this](uint32_t frame, const ControlList &metadata) {\n@@ -429,8 +430,10 @@ void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *outpu\n \tconst uint32_t paramsBufferId = availableParams_.front();\n \tavailableParams_.pop();\n \tipa_->computeParams(frame, paramsBufferId);\n+\tconst uint32_t statsBufferId = 0;\n \tdebayer_->invokeMethod(&Debayer::process,\n-\t\t\t       ConnectionTypeQueued, frame, paramsBufferId, input, output);\n+\t\t\t       ConnectionTypeQueued, frame,\n+\t\t\t       statsBufferId, paramsBufferId, input, output);\n }\n \n void SoftwareIsp::saveIspParams(uint32_t paramsBufferId)\n@@ -448,9 +451,13 @@ void SoftwareIsp::setSensorCtrls(const ControlList &sensorControls)\n \tsetSensorControls.emit(sensorControls);\n }\n \n-void SoftwareIsp::statsReady(uint32_t frame, uint32_t bufferId)\n+void SoftwareIsp::statsReady(uint32_t frame, const uint32_t statsBufferId)\n+{\n+\tispStatsReady.emit(frame, statsBufferId);\n+}\n+\n+void SoftwareIsp::statsProcessed([[maybe_unused]] const uint32_t statsBufferId)\n {\n-\tispStatsReady.emit(frame, bufferId);\n }\n \n void SoftwareIsp::inputReady(FrameBuffer *input)\ndiff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp\nindex 5c3011a7f..a3b11c443 100644\n--- a/src/libcamera/software_isp/swstats_cpu.cpp\n+++ b/src/libcamera/software_isp/swstats_cpu.cpp\n@@ -321,10 +321,11 @@ void SwStatsCpu::statsGBRG10PLine0(const uint8_t *src[])\n /**\n  * \\brief Reset state to start statistics gathering for a new frame\n  * \\param[in] frame The frame number\n+ * \\param[in] statsBufferId ID of the statistics buffer\n  *\n  * This may only be called after a successful setWindow() call.\n  */\n-void SwStatsCpu::startFrame(uint32_t frame)\n+void SwStatsCpu::startFrame(uint32_t frame, [[maybe_unused]] const uint32_t statsBufferId)\n {\n \tif (frame % kStatPerNumFrames)\n \t\treturn;\n@@ -339,15 +340,16 @@ void SwStatsCpu::startFrame(uint32_t frame)\n /**\n  * \\brief Finish statistics calculation for the current frame\n  * \\param[in] frame The frame number\n- * \\param[in] bufferId ID of the statistics buffer\n+ * \\param[in] statsBufferId ID of the statistics buffer\n  *\n  * This may only be called after a successful setWindow() call.\n  */\n-void SwStatsCpu::finishFrame(uint32_t frame, uint32_t bufferId)\n+void SwStatsCpu::finishFrame(uint32_t frame,\n+\t\t\t     const uint32_t statsBufferId)\n {\n \tstats_.valid = frame % kStatPerNumFrames == 0;\n \t*sharedStats_ = stats_;\n-\tstatsReady.emit(frame, bufferId);\n+\tstatsReady.emit(frame, statsBufferId);\n }\n \n /**\n@@ -512,20 +514,20 @@ void SwStatsCpu::processBayerFrame2(MappedFrameBuffer &in)\n /**\n  * \\brief Calculate statistics for a frame in one go\n  * \\param[in] frame The frame number\n- * \\param[in] bufferId ID of the statistics buffer\n+ * \\param[in] statsBufferId ID of the statistics buffer\n  * \\param[in] input The frame to process\n  *\n  * This may only be called after a successful setWindow() call.\n  */\n-void SwStatsCpu::processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input)\n+void SwStatsCpu::processFrame(uint32_t frame, uint32_t statsBufferId, FrameBuffer *input)\n {\n \tif (frame % kStatPerNumFrames) {\n-\t\tfinishFrame(frame, bufferId);\n+\t\tfinishFrame(frame, statsBufferId);\n \t\treturn;\n \t}\n \n \tbench_.startFrame();\n-\tstartFrame(frame);\n+\tstartFrame(frame, statsBufferId);\n \n \tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n \tif (!in.isValid()) {\n@@ -534,7 +536,7 @@ void SwStatsCpu::processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *in\n \t}\n \n \t(this->*processFrame_)(in);\n-\tfinishFrame(frame, bufferId);\n+\tfinishFrame(frame, statsBufferId);\n \tbench_.finishFrame();\n }\n \n",
    "prefixes": [
        "RFC",
        "v2",
        "10/14"
    ]
}