Show a patch.

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

{
    "id": 26833,
    "url": "https://patchwork.libcamera.org/api/patches/26833/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26833/",
    "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": "<20260604095105.68798-13-mzamazal@redhat.com>",
    "date": "2026-06-04T09:50:54",
    "name": "[RFC,v3,08/17] libcamera: software_isp: Allocation of multiple params buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7f5cf530ec01dc11853a9b2fa450c14e8523a5c4",
    "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/26833/mbox/",
    "series": [
        {
            "id": 5976,
            "url": "https://patchwork.libcamera.org/api/series/5976/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5976",
            "date": "2026-06-04T09:50:42",
            "name": "Software ISP: Share params and stats buffers",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/5976/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26833/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26833/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 92D8AC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jun 2026 09:51:49 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3CD8663741;\n\tThu,  4 Jun 2026 11:51:49 +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 7FE3D63403\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jun 2026 11:51:47 +0200 (CEST)",
            "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-650-VdEE4mczPISTqC6Niid6xQ-1;\n\tThu, 04 Jun 2026 05:51:43 -0400",
            "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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 id 53A341956050; Thu,  4 Jun 2026 09:51:42 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.156])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 8C35030001A1; Thu,  4 Jun 2026 09:51:40 +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=\"McCszPp+\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1780566706;\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=00G6fCl+VrAiAKncqdFqlnHj8CGJ2JX9e4VeeAibcj8=;\n\tb=McCszPp+2sfFcKgKodCmbiZw+zClV1Xf2kYdKYnMfkksr0ALF7nzSoJthOT5uGuFXGaK/K\n\tHWT2QxyMOzQgdU8WxiUh6nm5QYz/PTqdMJTrxDAr229gTO67GpNYcgwpt2NUWMS20aeA5+\n\tm0qBQ7k3OLDi+ZpZIpdylof4Wt/8tOQ=",
        "X-MC-Unique": "VdEE4mczPISTqC6Niid6xQ-1",
        "X-Mimecast-MFC-AGG-ID": "VdEE4mczPISTqC6Niid6xQ_1780566702",
        "From": "Milan Zamazal <mzamazal@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Milan Zamazal <mzamazal@redhat.com>, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>,\n\tjohannes.goede@oss.qualcomm.com",
        "Subject": "[RFC PATCH v3 08/17] libcamera: software_isp: Allocation of multiple\n\tparams buffers",
        "Date": "Thu,  4 Jun 2026 11:50:54 +0200",
        "Message-ID": "<20260604095105.68798-13-mzamazal@redhat.com>",
        "In-Reply-To": "<20260604095105.68798-1-mzamazal@redhat.com>",
        "References": "<20260604095105.68798-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "EjBymKknOC_6Xvu6nvBqpH0cpLssvoZEGrCAr4zKIpk_1780566702",
        "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": "SoftwareIsp::sharedParams_ is changed from a single buffer to a map of\nmultiple buffer ids and the corresponding buffers.  This requires some\ncode rearranging within SoftwareIsp::allocateParamsBuffers to keep the\nright sequence of actions.\n\nCurrently, only a single buffer is allocated, this will be changed in a\nfollowup patch.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/software_isp.h      |  3 ++-\n src/libcamera/software_isp/software_isp.cpp   | 25 ++++++++++++-------\n 2 files changed, 18 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\nindex 58fb9d752..b77793713 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -97,7 +97,8 @@ private:\n \tvoid outputReady(FrameBuffer *output);\n \tstd::unique_ptr<Debayer> debayer_;\n \tThread ispWorkerThread_;\n-\tSharedMemObject<DebayerParams> sharedParams_;\n+\tstatic constexpr unsigned int kParamStatBufferCount = 1;\n+\tstd::map<uint32_t, SharedMemObject<DebayerParams>> sharedParams_;\n \tDebayerParams debayerParams_;\n \tstd::vector<uint32_t> availableParams_;\n \tDmaBufAllocator dmaHeap_;\ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex d48cd00ad..6596e6fdb 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -72,6 +72,11 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n  * ready\n  */\n \n+/**\n+ * \\var SoftwareIsp::kParamStatBufferCount\n+ * \\brief The number of stats and params buffers (each of them)\n+ */\n+\n /**\n  * \\brief Constructs SoftwareIsp object\n  * \\param[in] pipe The pipeline handler in use\n@@ -150,7 +155,7 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n \n \tret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n \t\t\t debayer_->getStatsFD(),\n-\t\t\t sharedParams_.fd(),\n+\t\t\t sharedParams_.begin()->second.fd(),\n \t\t\t sensorInfo,\n \t\t\t sensor->controls(),\n \t\t\t ipaControls,\n@@ -179,14 +184,16 @@ SoftwareIsp::~SoftwareIsp()\n \n bool SoftwareIsp::allocateParamsBuffers()\n {\n-\tsharedParams_ = SharedMemObject<DebayerParams>(\"softIsp_params\");\n-\tif (!sharedParams_) {\n-\t\tLOG(SoftwareIsp, Error) << \"Failed to create shared memory for parameters\";\n-\t\treturn false;\n-\t}\n+\tfor (unsigned int bufferId = 0; bufferId < kParamStatBufferCount; bufferId++) {\n+\t\tauto params = SharedMemObject<DebayerParams>(\"softIsp_params\");\n+\t\tif (!params) {\n+\t\t\tLOG(SoftwareIsp, Error) << \"Failed to create shared memory for parameters\";\n+\t\t\treturn false;\n+\t\t}\n \n-\t/* Just a single buffer for now, let's use 0 as its id. */\n-\tavailableParams_.push_back(0);\n+\t\tavailableParams_.push_back(bufferId);\n+\t\tsharedParams_.emplace(bufferId, std::move(params));\n+\t}\n \n \treturn true;\n }\n@@ -442,7 +449,7 @@ int SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n \n void SoftwareIsp::saveIspParams([[maybe_unused]] const uint32_t paramsBufferId)\n {\n-\tdebayerParams_ = *sharedParams_;\n+\tdebayerParams_ = *sharedParams_.begin()->second;\n }\n \n void SoftwareIsp::paramsBufferReady(const uint32_t paramsBufferId)\n",
    "prefixes": [
        "RFC",
        "v3",
        "08/17"
    ]
}