Patch Detail
Show a patch.
GET /api/patches/26177/?format=api
{ "id": 26177, "url": "https://patchwork.libcamera.org/api/patches/26177/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26177/", "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-9-mzamazal@redhat.com>", "date": "2026-02-16T20:30:27", "name": "[RFC,v2,08/14] libcamera: software_isp: Share parameters buffers with debayering", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d96affd581b996ecdd0e31c0a22612fa7c15acee", "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/26177/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/26177/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26177/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 E12A0C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Feb 2026 20:31:00 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ABD0162225;\n\tMon, 16 Feb 2026 21:31:00 +0100 (CET)", "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 0B08D62084\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Feb 2026 21:30:58 +0100 (CET)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-540-Vvl4J4RGO82krFpIB2XERA-1;\n\tMon, 16 Feb 2026 15:30:56 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS\n\tid B7CB119560B2 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Feb 2026 20:30:55 +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 47AE41800464; Mon, 16 Feb 2026 20:30:53 +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=\"d0aBWrSN\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1771273858;\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=iCTExq9BSjDZs1cYMuDKGmre0Nkq/Rsd9MERn2JpJ+k=;\n\tb=d0aBWrSNbZR/bs7zeq2m87qCWfDF/UpvMZgI9x3o5du04TLB+YdK05DDvY/f+7b5n4+0QN\n\tdVxZ/4+pRyUhBjUP8JdewgzyYTo59DxG8GbbVX3Tj2MiTKYTqXuTKtr8e+dLIFoLCSDtbp\n\tfNxOHXXT8IgmsURwmhcXsO6TcYciGFE=", "X-MC-Unique": "Vvl4J4RGO82krFpIB2XERA-1", "X-Mimecast-MFC-AGG-ID": "Vvl4J4RGO82krFpIB2XERA_1771273855", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>", "Subject": "[RFC PATCH v2 08/14] libcamera: software_isp: Share parameters\n\tbuffers with debayering", "Date": "Mon, 16 Feb 2026 21:30:27 +0100", "Message-ID": "<20260216203034.27558-9-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": "gcI9mzU4riC5yfUrVh9B3nRaQxSTKwDMs3pgZaIjx4M_1771273855", "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": "Share the multiple parameters buffers with debayering rather than\ncopying the current parameters buffer there. This is done in a similar\nway as sharing the buffers with IPA in the preceding patch.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/software_isp/debayer.cpp | 27 ++++++++-\n src/libcamera/software_isp/debayer.h | 7 ++-\n src/libcamera/software_isp/debayer_cpu.cpp | 67 +++++++++++----------\n src/libcamera/software_isp/debayer_cpu.h | 11 ++--\n src/libcamera/software_isp/debayer_egl.cpp | 14 +++--\n src/libcamera/software_isp/debayer_egl.h | 7 ++-\n src/libcamera/software_isp/software_isp.cpp | 16 ++---\n 7 files changed, 92 insertions(+), 57 deletions(-)", "diff": "diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex e2e294d3e..ad47c1e8d 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -11,6 +11,8 @@\n \n #include \"debayer.h\"\n \n+#include <sys/mman.h>\n+\n namespace libcamera {\n \n /**\n@@ -21,6 +23,7 @@ namespace libcamera {\n /**\n * \\fn Debayer::Debayer(const GlobalConfiguration &configuration)\n * \\brief Construct a Debayer object\n+ * \\param[in] paramsBuffers SharedFDs of parameter buffers\n * \\param[in] configuration Global configuration reference\n */\n \n@@ -58,8 +61,22 @@ namespace libcamera {\n \n LOG_DEFINE_CATEGORY(Debayer)\n \n-Debayer::Debayer(const GlobalConfiguration &configuration) : bench_(configuration)\n+Debayer::Debayer(const std::vector<SharedFD> ¶msBuffers,\n+\t\t const GlobalConfiguration &configuration) : bench_(configuration)\n {\n+\tparamsBuffers_ = std::map<unsigned int, DebayerParams *>();\n+\n+\tfor (auto &sharedFd : paramsBuffers) {\n+\t\tvoid *mem = mmap(nullptr, sizeof(DebayerParams), PROT_WRITE,\n+\t\t\t\t MAP_SHARED, sharedFd.get(), 0);\n+\t\tif (mem == MAP_FAILED) {\n+\t\t\tLOG(Debayer, Error) << \"Unable to map Parameters\";\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tASSERT(sharedFd.get() >= 0);\n+\t\tparamsBuffers_[sharedFd.get()] = static_cast<DebayerParams *>(mem);\n+\t}\n }\n \n Debayer::~Debayer()\n@@ -105,13 +122,12 @@ Debayer::~Debayer()\n */\n \n /**\n- * \\fn void Debayer::process(uint32_t frame, const uint32_t paramsBufferId, FrameBuffer *input, FrameBuffer *output, DebayerParams params)\n+ * \\fn void Debayer::process(uint32_t frame, 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] paramsBufferId The id of the params buffer in use\n * \\param[in] input The input buffer\n * \\param[in] output The output buffer\n- * \\param[in] params The parameters to be used in debayering\n *\n * \\note DebayerParams is passed by value deliberately so that a copy is passed\n * when this is run in another thread by invokeMethod().\n@@ -239,6 +255,11 @@ Debayer::~Debayer()\n * reversed.\n */\n \n+/**\n+ * \\var Debayer::paramsBuffers_\n+ * \\brief Ring of debayering parameters buffers\n+ */\n+\n /**\n * \\var Debayer::bench_\n * \\brief Benchmarking utility instance for performance measurements\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex 0c9627d30..a66d0cbbe 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -35,7 +35,8 @@ LOG_DECLARE_CATEGORY(Debayer)\n class Debayer : public Object\n {\n public:\n-\tDebayer(const GlobalConfiguration &configuration);\n+\tDebayer(const std::vector<SharedFD> ¶msBuffers,\n+\t\tconst GlobalConfiguration &configuration);\n \tvirtual ~Debayer() = 0;\n \n \tvirtual int configure(const StreamConfiguration &inputCfg,\n@@ -49,8 +50,7 @@ public:\n \n \tvirtual void process(uint32_t frame,\n \t\t\t const uint32_t paramsBufferId,\n-\t\t\t FrameBuffer *input, FrameBuffer *output,\n-\t\t\t const DebayerParams ¶ms) = 0;\n+\t\t\t FrameBuffer *input, FrameBuffer *output) = 0;\n \tvirtual int start() { return 0; }\n \tvirtual void stop() {}\n \n@@ -83,6 +83,7 @@ public:\n \tPixelFormat inputPixelFormat_;\n \tPixelFormat outputPixelFormat_;\n \tbool swapRedBlueGains_;\n+\tstd::map<unsigned int, DebayerParams *> paramsBuffers_;\n \tBenchmark bench_;\n \n private:\ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 5d0e780f7..927ac7d10 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -12,13 +12,14 @@\n #include \"debayer_cpu.h\"\n \n #include <algorithm>\n-#include <stdlib.h>\n #include <sys/ioctl.h>\n #include <time.h>\n #include <utility>\n \n #include <linux/dma-buf.h>\n \n+#include <libcamera/base/shared_fd.h>\n+\n #include <libcamera/formats.h>\n \n #include \"libcamera/internal/bayer_format.h\"\n@@ -38,10 +39,13 @@ namespace libcamera {\n /**\n * \\brief Constructs a DebayerCpu object\n * \\param[in] stats Pointer to the stats object to use\n+ * \\param[in] paramsBuffers SharedFDs of parameter buffers\n * \\param[in] configuration The global configuration\n */\n-DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats, const GlobalConfiguration &configuration)\n-\t: Debayer(configuration), stats_(std::move(stats))\n+DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats,\n+\t\t const std::vector<SharedFD> ¶msBuffers,\n+\t\t const GlobalConfiguration &configuration)\n+\t: Debayer(paramsBuffers, configuration), stats_(std::move(stats))\n {\n \t/*\n \t * Reading from uncached buffers may be very slow.\n@@ -750,13 +754,13 @@ void DebayerCpu::process4(uint32_t frame, const uint8_t *src, uint8_t *dst)\n \t}\n }\n \n-void DebayerCpu::updateGammaTable(const DebayerParams ¶ms)\n+void DebayerCpu::updateGammaTable(const DebayerParams *params)\n {\n-\tconst RGB<float> blackLevel = params.blackLevel;\n+\tconst RGB<float> blackLevel = params->blackLevel;\n \t/* Take let's say the green channel black level */\n \tconst unsigned int blackIndex = blackLevel[1] * gammaTable_.size();\n-\tconst float gamma = params.gamma;\n-\tconst float contrastExp = params.contrastExp;\n+\tconst float gamma = params->gamma;\n+\tconst float contrastExp = params->contrastExp;\n \n \tconst float divisor = gammaTable_.size() - blackIndex - 1.0;\n \tfor (unsigned int i = blackIndex; i < gammaTable_.size(); i++) {\n@@ -780,12 +784,12 @@ void DebayerCpu::updateGammaTable(const DebayerParams ¶ms)\n \t\t gammaTable_[blackIndex]);\n }\n \n-void DebayerCpu::updateLookupTables(const DebayerParams ¶ms)\n+void DebayerCpu::updateLookupTables(const DebayerParams *params)\n {\n \tconst bool gammaUpdateNeeded =\n-\t\tparams.gamma != params_.gamma ||\n-\t\tparams.blackLevel != params_.blackLevel ||\n-\t\tparams.contrastExp != params_.contrastExp;\n+\t\tparams->gamma != params_.gamma ||\n+\t\tparams->blackLevel != params_.blackLevel ||\n+\t\tparams->contrastExp != params_.contrastExp;\n \tif (gammaUpdateNeeded)\n \t\tupdateGammaTable(params);\n \n@@ -796,7 +800,7 @@ void DebayerCpu::updateLookupTables(const DebayerParams ¶ms)\n \tconst double div = static_cast<double>(kRGBLookupSize) / gammaTableSize;\n \tif (ccmEnabled_) {\n \t\tif (gammaUpdateNeeded ||\n-\t\t matrixChanged(params.combinedMatrix, params_.combinedMatrix)) {\n+\t\t matrixChanged(params->combinedMatrix, params_.combinedMatrix)) {\n \t\t\tauto &red = swapRedBlueGains_ ? blueCcm_ : redCcm_;\n \t\t\tauto &green = greenCcm_;\n \t\t\tauto &blue = swapRedBlueGains_ ? redCcm_ : blueCcm_;\n@@ -804,21 +808,21 @@ void DebayerCpu::updateLookupTables(const DebayerParams ¶ms)\n \t\t\tconst unsigned int greenIndex = 1;\n \t\t\tconst unsigned int blueIndex = swapRedBlueGains_ ? 0 : 2;\n \t\t\tfor (unsigned int i = 0; i < kRGBLookupSize; i++) {\n-\t\t\t\tred[i].r = std::round(i * params.combinedMatrix[redIndex][0]);\n-\t\t\t\tred[i].g = std::round(i * params.combinedMatrix[greenIndex][0]);\n-\t\t\t\tred[i].b = std::round(i * params.combinedMatrix[blueIndex][0]);\n-\t\t\t\tgreen[i].r = std::round(i * params.combinedMatrix[redIndex][1]);\n-\t\t\t\tgreen[i].g = std::round(i * params.combinedMatrix[greenIndex][1]);\n-\t\t\t\tgreen[i].b = std::round(i * params.combinedMatrix[blueIndex][1]);\n-\t\t\t\tblue[i].r = std::round(i * params.combinedMatrix[redIndex][2]);\n-\t\t\t\tblue[i].g = std::round(i * params.combinedMatrix[greenIndex][2]);\n-\t\t\t\tblue[i].b = std::round(i * params.combinedMatrix[blueIndex][2]);\n+\t\t\t\tred[i].r = std::round(i * params->combinedMatrix[redIndex][0]);\n+\t\t\t\tred[i].g = std::round(i * params->combinedMatrix[greenIndex][0]);\n+\t\t\t\tred[i].b = std::round(i * params->combinedMatrix[blueIndex][0]);\n+\t\t\t\tgreen[i].r = std::round(i * params->combinedMatrix[redIndex][1]);\n+\t\t\t\tgreen[i].g = std::round(i * params->combinedMatrix[greenIndex][1]);\n+\t\t\t\tgreen[i].b = std::round(i * params->combinedMatrix[blueIndex][1]);\n+\t\t\t\tblue[i].r = std::round(i * params->combinedMatrix[redIndex][2]);\n+\t\t\t\tblue[i].g = std::round(i * params->combinedMatrix[greenIndex][2]);\n+\t\t\t\tblue[i].b = std::round(i * params->combinedMatrix[blueIndex][2]);\n \t\t\t\tgammaLut_[i] = gammaTable_[i / div];\n \t\t\t}\n \t\t}\n \t} else {\n-\t\tif (gammaUpdateNeeded || params.gains != params_.gains) {\n-\t\t\tauto &gains = params.gains;\n+\t\tif (gammaUpdateNeeded || params->gains != params_.gains) {\n+\t\t\tauto &gains = params->gains;\n \t\t\tauto &red = swapRedBlueGains_ ? blue_ : red_;\n \t\t\tauto &green = green_;\n \t\t\tauto &blue = swapRedBlueGains_ ? red_ : blue_;\n@@ -833,18 +837,17 @@ void DebayerCpu::updateLookupTables(const DebayerParams ¶ms)\n \t}\n \n \tLOG(Debayer, Debug)\n-\t\t<< \"Debayer parameters: blackLevel=\" << params.blackLevel\n-\t\t<< \"; gamma=\" << params.gamma\n-\t\t<< \"; contrastExp=\" << params.contrastExp\n-\t\t<< \"; gains=\" << params.gains\n-\t\t<< \"; matrix=\" << params.combinedMatrix;\n+\t\t<< \"Debayer parameters: blackLevel=\" << params->blackLevel\n+\t\t<< \"; gamma=\" << params->gamma\n+\t\t<< \"; contrastExp=\" << params->contrastExp\n+\t\t<< \"; gains=\" << params->gains\n+\t\t<< \"; matrix=\" << params->combinedMatrix;\n \n-\tparams_ = 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-\t\t\t const DebayerParams ¶ms)\n+\t\t\t FrameBuffer *input, FrameBuffer *output)\n {\n \tbench_.startFrame();\n \n@@ -852,8 +855,8 @@ void DebayerCpu::process(uint32_t frame, const uint32_t paramsBufferId,\n \n \tdmaSyncBegin(dmaSyncers, input, output);\n \n+\tDebayerParams *params = paramsBuffers_.at(paramsBufferId);\n \tupdateLookupTables(params);\n-\n \treleaseIspParams.emit(paramsBufferId);\n \n \t/* Copy metadata from the input buffer */\ndiff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\nindex 13253f999..5e3670b37 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -16,6 +16,7 @@\n #include <vector>\n \n #include <libcamera/base/object.h>\n+#include <libcamera/base/shared_fd.h>\n \n #include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/global_configuration.h\"\n@@ -29,7 +30,9 @@ namespace libcamera {\n class DebayerCpu : public Debayer\n {\n public:\n-\tDebayerCpu(std::unique_ptr<SwStatsCpu> stats, const GlobalConfiguration &configuration);\n+\tDebayerCpu(std::unique_ptr<SwStatsCpu> stats,\n+\t\t const std::vector<SharedFD> ¶msBuffers,\n+\t\t const GlobalConfiguration &configuration);\n \t~DebayerCpu();\n \n \tint configure(const StreamConfiguration &inputCfg,\n@@ -41,7 +44,7 @@ public:\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n \tvoid process(uint32_t frame,\n \t\t const uint32_t paramsBufferId,\n-\t\t FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms);\n+\t\t FrameBuffer *input, FrameBuffer *output);\n \tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n \tconst SharedFD &getStatsFD() { return stats_->getStatsFD(); }\n \n@@ -112,8 +115,8 @@ private:\n \tvoid memcpyNextLine(const uint8_t *linePointers[]);\n \tvoid process2(uint32_t frame, const uint8_t *src, uint8_t *dst);\n \tvoid process4(uint32_t frame, const uint8_t *src, uint8_t *dst);\n-\tvoid updateGammaTable(const DebayerParams ¶ms);\n-\tvoid updateLookupTables(const DebayerParams ¶ms);\n+\tvoid updateGammaTable(const DebayerParams *params);\n+\tvoid updateLookupTables(const DebayerParams *params);\n \n \t/* Max. supported Bayer pattern height is 4, debayering this requires 5 lines */\n \tstatic constexpr unsigned int kMaxLineBuffers = 5;\ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex 947c05c07..c24590994 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -32,10 +32,13 @@ namespace libcamera {\n * \\fn DebayerEGL::DebayerEGL(std::unique_ptr<SwStatsCpu> stats, const GlobalConfiguration &configuration)\n * \\brief Construct a DebayerEGL object\n * \\param[in] stats Statistics processing object\n+ * \\param[in] paramsBuffers SharedFDs of parameter buffers\n * \\param[in] configuration Global configuration reference\n */\n-DebayerEGL::DebayerEGL(std::unique_ptr<SwStatsCpu> stats, const GlobalConfiguration &configuration)\n-\t: Debayer(configuration), stats_(std::move(stats))\n+DebayerEGL::DebayerEGL(std::unique_ptr<SwStatsCpu> stats,\n+\t\t const std::vector<SharedFD> ¶msBuffers,\n+\t\t const GlobalConfiguration &configuration)\n+\t: Debayer(paramsBuffers, configuration), stats_(std::move(stats))\n {\n }\n \n@@ -534,8 +537,7 @@ int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParam\n }\n \n void DebayerEGL::process(uint32_t frame, const uint32_t paramsBufferId,\n-\t\t\t FrameBuffer *input, FrameBuffer *output,\n-\t\t\t const DebayerParams ¶ms)\n+\t\t\t FrameBuffer *input, FrameBuffer *output)\n {\n \tbench_.startFrame();\n \n@@ -549,6 +551,9 @@ void DebayerEGL::process(uint32_t frame, const uint32_t paramsBufferId,\n \tmetadata.sequence = input->metadata().sequence;\n \tmetadata.timestamp = input->metadata().timestamp;\n \n+\tDebayerParams params = *paramsBuffers_.at(paramsBufferId);\n+\treleaseIspParams.emit(paramsBufferId);\n+\n \tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n \tif (!in.isValid()) {\n \t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n@@ -559,7 +564,6 @@ void DebayerEGL::process(uint32_t frame, const uint32_t paramsBufferId,\n \t\tLOG(Debayer, Error) << \"debayerGPU failed\";\n \t\tgoto error;\n \t}\n-\treleaseIspParams.emit(paramsBufferId);\n \n \tbench_.finishFrame();\n \ndiff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\nindex 7f29f53e6..435ff7d31 100644\n--- a/src/libcamera/software_isp/debayer_egl.h\n+++ b/src/libcamera/software_isp/debayer_egl.h\n@@ -38,7 +38,9 @@ namespace libcamera {\n class DebayerEGL : public Debayer\n {\n public:\n-\tDebayerEGL(std::unique_ptr<SwStatsCpu> stats, const GlobalConfiguration &configuration);\n+\tDebayerEGL(std::unique_ptr<SwStatsCpu> stats,\n+\t\t const std::vector<SharedFD> ¶msBuffers,\n+\t\t const GlobalConfiguration &configuration);\n \t~DebayerEGL();\n \n \tint configure(const StreamConfiguration &inputCfg,\n@@ -51,8 +53,7 @@ public:\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-\t\t const DebayerParams ¶ms);\n+\t\t FrameBuffer *input, 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 2bc0d30b1..230396bee 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -102,6 +102,10 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \t}\n \tstats->statsReady.connect(this, &SoftwareIsp::statsReady);\n \n+\tstd::vector<SharedFD> fdParams;\n+\tfor (auto &item : sharedParams_)\n+\t\tfdParams.emplace_back(item.second.fd());\n+\n #if HAVE_DEBAYER_EGL\n \tstd::optional<std::string> softISPMode = configuration.envOption(\"LIBCAMERA_SOFTISP_MODE\", { \"software_isp\", \"mode\" });\n \tif (softISPMode) {\n@@ -113,15 +117,14 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \t}\n \n \tif (!softISPMode || softISPMode == \"gpu\")\n-\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);\n+\t\tdebayer_ = std::make_unique<DebayerEGL>(std::move(stats), fdParams,\n+\t\t\t\t\t\t\tconfiguration);\n \n #endif\n \tif (!debayer_)\n-\t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), configuration);\n+\t\tdebayer_ = std::make_unique<DebayerCpu>(std::move(stats), fdParams,\n+\t\t\t\t\t\t\tconfiguration);\n \n-\tstd::vector<SharedFD> fdParams;\n-\tfor (auto &item : sharedParams_)\n-\t\tfdParams.emplace_back(item.second.fd());\n \tdebayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady);\n \tdebayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);\n \tdebayer_->releaseIspParams.connect(this, &SoftwareIsp::releaseIspParams);\n@@ -426,9 +429,8 @@ 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-\tdebayerParams_ = *sharedParams_.at(paramsBufferId);\n \tdebayer_->invokeMethod(&Debayer::process,\n-\t\t\t ConnectionTypeQueued, frame, paramsBufferId, input, output, debayerParams_);\n+\t\t\t ConnectionTypeQueued, frame, paramsBufferId, input, output);\n }\n \n void SoftwareIsp::saveIspParams(uint32_t paramsBufferId)\n", "prefixes": [ "RFC", "v2", "08/14" ] }