{"id":26855,"url":"https://patchwork.libcamera.org/api/1.1/patches/26855/?format=json","web_url":"https://patchwork.libcamera.org/patch/26855/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260608150349.134371-14-mzamazal@redhat.com>","date":"2026-06-08T15:03:42","name":"[RFC,v4,13/17] libcamera: software_isp: Introduce arguments for statistics buffers","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"af773147818dad3c4288a292f8990f6e4367f237","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/1.1/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26855/mbox/","series":[{"id":5982,"url":"https://patchwork.libcamera.org/api/1.1/series/5982/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5982","date":"2026-06-08T15:03:29","name":"Software ISP: Share params and stats buffers","version":4,"mbox":"https://patchwork.libcamera.org/series/5982/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26855/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26855/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 63713C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Jun 2026 15:04:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1A43561F12;\n\tMon,  8 Jun 2026 17:04:37 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98DB761EFD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Jun 2026 17:04:34 +0200 (CEST)","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-462-MjBNZcMVPtqValL1WO0dOg-1;\n\tMon, 08 Jun 2026 11:04:30 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.111])\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 id 0DA9F1800867; Mon,  8 Jun 2026 15:04:29 +0000 (UTC)","from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.48.51])\n\tby mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 1583B1800361; Mon,  8 Jun 2026 15:04:26 +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=\"PbW5qVIF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1780931073;\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=ZY5jrFxSrfVkFtU7ZTE7IPoXxigiYpFUwKYixWmzeWk=;\n\tb=PbW5qVIFtsbfCk6q29hY+mqUqw7fjD/Kuq1PiWX5UrY1ULbUqbYGQtZx2UHf5EjXVIShRV\n\t7uuILIms/XaZBoFrW89YEjO3U9UfOSQ/pH0AgidaN/0UsncYHztj2PL1ZvkCYcbMei+TuD\n\tXuAR/PkmB6V7jVkW3QO1jPItZMAsCDQ=","X-MC-Unique":"MjBNZcMVPtqValL1WO0dOg-1","X-Mimecast-MFC-AGG-ID":"MjBNZcMVPtqValL1WO0dOg_1780931069","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>,  johannes.goede@oss.qualcomm.com","Subject":"[RFC PATCH v4 13/17] libcamera: software_isp: Introduce arguments\n\tfor statistics buffers","Date":"Mon,  8 Jun 2026 17:03:42 +0200","Message-ID":"<20260608150349.134371-14-mzamazal@redhat.com>","In-Reply-To":"<20260608150349.134371-1-mzamazal@redhat.com>","References":"<20260608150349.134371-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"BLMFDJSgUkzKLLyL8Zm-i1U21_9LutphUES152XBTjM_1780931069","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 statistics\nbuffer ids passed to the calls.  The buffer ids must be passed to the\nfollowing groups of methods:\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      | 14 ++++++--------\n src/libcamera/software_isp/debayer_cpu.h        |  7 +++++--\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     | 14 ++++++++++----\n src/libcamera/software_isp/swstats_cpu.cpp      | 17 +++++++++--------\n 13 files changed, 55 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 9ea0ed4db..3e879c630 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -92,7 +92,8 @@ private:\n \tvoid paramsBufferReady(const uint32_t paramsBufferId);\n \tbool allocateParamsBuffers(const unsigned int bufferCount);\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 551870921..4356eb826 100644\n--- a/include/libcamera/internal/software_isp/swstats_cpu.h\n+++ b/include/libcamera/internal/software_isp/swstats_cpu.h\n@@ -55,8 +55,8 @@ public:\n \tint configure(const StreamConfiguration &inputCfg, unsigned int statsBufferCount = 1);\n \tvoid setWindow(const Rectangle &window);\n \tvoid startFrame(uint32_t frame);\n-\tvoid finishFrame(uint32_t frame, uint32_t bufferId);\n-\tvoid processFrame(uint32_t frame, uint32_t bufferId, MappedFrameBuffer &input);\n+\tvoid finishFrame(uint32_t frame, uint32_t statsBufferId);\n+\tvoid processFrame(uint32_t frame, uint32_t statsBufferId, MappedFrameBuffer &input);\n \n \tvoid processLine0(uint32_t frame, unsigned int y, const uint8_t *src[], unsigned int statsBufferIndex = 0)\n \t{\ndiff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\nindex f348f582d..c2c5fe382 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 \tparamsComputed(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 0212a3b52..ded75a970 100644\n--- a/src/ipa/simple/soft_simple.cpp\n+++ b/src/ipa/simple/soft_simple.cpp\n@@ -298,7 +298,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@@ -312,6 +312,7 @@ void IPASoftSimple::processStats(const uint32_t frame,\n \tfor (const auto &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 b49f372a6..2e6bff146 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@@ -1044,9 +1044,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 28e04d0df..341930e5b 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -120,9 +120,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 6cefa4c01..259261b1a 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 eb30ae047..148841809 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -1072,8 +1072,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@@ -1124,12 +1127,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 dc626f55c..8f8b2d6b1 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -45,8 +45,11 @@ public:\n \tstd::vector<PixelFormat> formats(PixelFormat input) override;\n \tstd::tuple<unsigned int, unsigned int>\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size) override;\n-\tvoid process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t     FrameBuffer *input, FrameBuffer *output) override;\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) override;\n \tint start() override;\n \tvoid stop() override;\n \tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize) override;\ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex a0a957db7..aacaaa66e 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -558,8 +558,11 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye\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 43e3dcb15..36c856c10 100644\n--- a/src/libcamera/software_isp/debayer_egl.h\n+++ b/src/libcamera/software_isp/debayer_egl.h\n@@ -53,8 +53,11 @@ public:\n \tstd::vector<PixelFormat> formats(PixelFormat input) override;\n \tstd::tuple<unsigned int, unsigned int> strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) override;\n \n-\tvoid process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t     FrameBuffer *input, FrameBuffer *output) override;\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) override;\n \tint start() override;\n \tvoid stop() override;\n \ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex dbe4cc270..c44e035b8 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -171,6 +171,7 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe,\n \t\treturn;\n \t}\n \n+\tipa_->statsProcessed.connect(this, &SoftwareIsp::statsProcessed);\n \tipa_->metadataReady.connect(this,\n \t\t\t\t    [this](uint32_t frame, const ControlList &metadata) {\n \t\t\t\t\t    metadataReady.emit(frame, metadata);\n@@ -444,9 +445,10 @@ int SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n \tconst uint32_t paramsBufferId = availableParams_.back();\n \tavailableParams_.pop_back();\n \tipa_->computeParams(frame, paramsBufferId);\n+\tconst uint32_t statsBufferId = 0;\n \tdebayer_->invokeMethod(&Debayer::process,\n-\t\t\t       ConnectionTypeQueued, frame, paramsBufferId,\n-\t\t\t       input, output);\n+\t\t\t       ConnectionTypeQueued, frame,\n+\t\t\t       statsBufferId, paramsBufferId, input, output);\n \n \treturn 0;\n }\n@@ -461,9 +463,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 7fb77ce7d..a10535004 100644\n--- a/src/libcamera/software_isp/swstats_cpu.cpp\n+++ b/src/libcamera/software_isp/swstats_cpu.cpp\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: LGPL-2.1-or-later */\n /*\n  * Copyright (C) 2023, Linaro Ltd\n- * Copyright (C) 2023, Red Hat Inc.\n+ * Copyright (C) 2023-2026 Red Hat Inc.\n  *\n  * Authors:\n  * Hans de Goede <hdegoede@redhat.com>\n@@ -398,11 +398,12 @@ 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 \tbool valid = frame % kStatPerNumFrames == 0;\n \n@@ -419,7 +420,7 @@ void SwStatsCpu::finishFrame(uint32_t frame, uint32_t bufferId)\n \t}\n \n \tsharedStats_->valid = valid;\n-\tstatsReady.emit(frame, bufferId);\n+\tstatsReady.emit(frame, statsBufferId);\n }\n \n /**\n@@ -597,22 +598,22 @@ 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, MappedFrameBuffer &input)\n+void SwStatsCpu::processFrame(uint32_t frame, uint32_t statsBufferId, MappedFrameBuffer &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 \t(this->*processFrame_)(input);\n-\tfinishFrame(frame, bufferId);\n+\tfinishFrame(frame, statsBufferId);\n \tbench_.finishFrame();\n }\n \n","prefixes":["RFC","v4","13/17"]}