Show a patch.

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

{
    "id": 25118,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/25118/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25118/",
    "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": "<20251120232019.3590-18-bryan.odonoghue@linaro.org>",
    "date": "2025-11-20T23:20:14",
    "name": "[17/22] libcamera: software_isp: debayer: Introduce a stop() callback to the debayer object",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "1ae4035c5ff52bf6da15d1aaa09b1e5c2cc7c031",
    "submitter": {
        "id": 175,
        "url": "https://patchwork.libcamera.org/api/1.1/people/175/?format=api",
        "name": "Bryan O'Donoghue",
        "email": "bryan.odonoghue@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25118/mbox/",
    "series": [
        {
            "id": 5599,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5599/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5599",
            "date": "2025-11-20T23:19:57",
            "name": "GPUISP precursor series",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5599/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25118/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25118/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 7B052C3330\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 23:20:58 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2BFDF60B13;\n\tFri, 21 Nov 2025 00:20:58 +0100 (CET)",
            "from mail-wm1-x334.google.com (mail-wm1-x334.google.com\n\t[IPv6:2a00:1450:4864:20::334])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 43C0960AAF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Nov 2025 00:20:54 +0100 (CET)",
            "by mail-wm1-x334.google.com with SMTP id\n\t5b1f17b1804b1-4779cb0a33fso13968775e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 15:20:54 -0800 (PST)",
            "from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-477bf3af0ecsm11618415e9.9.2025.11.20.15.20.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 20 Nov 2025 15:20:52 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"F+x8xakm\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1763680853; x=1764285653;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=ZFi6TZY5hIuZxehPR0Y+ao56s/Ou2XRORvnhhULoNLs=;\n\tb=F+x8xakmCqjGlPJTxxdBg7WUUCJ+f5I8LFMCVkb2DIlXkzUlRznMp6nAlqi9c6f3tl\n\tT54PBnPDKyTFaN1mm+Y0/JD8gUuLekqWIGhb8CC6KLh1Dhptsz3noDtBjqJBweZix2FR\n\tmBBKlFLsoYA3AW2iaFs34AP6CVYq6ACxtaqVHbHGj/Vw/tu89RiFKqjUkwFEQ+vHYNJB\n\tw+aj+u9mZSd24t3dlT127cuNsaNySehxTiCKJ0fRyv6Pb6WjRy7/rCgF2dPUNl9j36Sc\n\twas2RrEb/9nOsws76VnAIadpyk1rMqSsIwmDbCObgtVJEBC5xB3+EUY12kHyNI9Z9bej\n\t9E/A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763680853; x=1764285653;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=ZFi6TZY5hIuZxehPR0Y+ao56s/Ou2XRORvnhhULoNLs=;\n\tb=dxhXo5yCgWyjgla6WetduoWhHyT9VV+xwdh7zKWFP4tGUMZZzL9776nYpi71TRbZ/u\n\tikCiRAW2znBfG4lG7SuMEjmZCzf9jfmY1QJGR1yhFdc37KLrIrln1oKqi50Ry7fduFXU\n\tJK7U75gzm3i81XYQqG8bpqHvEtip63+aZWC3wU5ocZaU/FOiSgV9Q1mi+PBhMD/cTd64\n\tCvBSe8GS6nhMBIun/GgeIgRoCtnU4xEzTXQB8QtgcuWGtqwzsZYSaz3/XCLhp5OdaRRy\n\txd8Su0RuLBwOF5cfG4BdwasmVXCzOlMAG9oVsmTPFZCGKYXigrtWb6mD0ksNUKv6ix2F\n\tJlMA==",
        "X-Gm-Message-State": "AOJu0YydrzbjLo1oB83QsjXU8YG651BE/Hq8oVsZ5gHnTLHFGYSLLzpY\n\tMQZI3PaqYH1XJuw08hy0tqvdXgtuAfGCEZ75FkavZfuOaYHTohsE+bXYVVpxGtD0c6QpG8pl2H8\n\tVybWxrCU=",
        "X-Gm-Gg": "ASbGncsQVIrfoVactc9e2qh8FF4XNRe4SHnI4H+5N8RcT67skHneHogIj9V4phq40A+\n\tvRGTD8v/68NF4N1mayRjpdm5fEeNGeM9pu3ODMXjf2MJ2U9HNe6yt2oXLpchpVh6fMKFEX14LxE\n\t17UQC7ZKi2l6c4avShnJ7OgUJ8HhidOTSsrhNy7zYz730v1KCGHQMJrIJkQssYDnWIDtTeFK8E9\n\tfvUJwboX5Z3CgTdxrrRTfXki2XoF65kUpNW/UKpPh75HEMGZkRTMKFJFb5jE23vbaHeIR4dbp8s\n\tK+oPeKWfyMnBN0lTaJxLNyxY1qFFBtAs23medwVi+AF7alkcdoDZlwIxVlTbrhOwZFg8gTx3Eq3\n\trbn/RaGPXlSqR6NZv+L/s1F2BwPGKhT5s+8KComcSpxRBTXu06uKGfRcXYua3aV94huOYqurn7M\n\tP8rTle7yywF0qg5Gu+TKCX1xPJfLbb97M5WcE8jap1bBFspL6SJCrC4P/U74GuNnOagdY=",
        "X-Google-Smtp-Source": "AGHT+IGFb7DLIoDhZHFAfcSTdib+RQ5z24ZKzLuiQvu0+Xzp+2i1fqIGmH8edG1Q+ToQiYlYvzkZfA==",
        "X-Received": "by 2002:a05:600c:474b:b0:46e:35a0:3587 with SMTP id\n\t5b1f17b1804b1-477c01ee377mr2676675e9.27.1763680853616; \n\tThu, 20 Nov 2025 15:20:53 -0800 (PST)",
        "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH 17/22] libcamera: software_isp: debayer: Introduce a stop()\n\tcallback to the debayer object",
        "Date": "Thu, 20 Nov 2025 23:20:14 +0000",
        "Message-ID": "<20251120232019.3590-18-bryan.odonoghue@linaro.org>",
        "X-Mailer": "git-send-email 2.51.2",
        "In-Reply-To": "<20251120232019.3590-1-bryan.odonoghue@linaro.org>",
        "References": "<20251120232019.3590-1-bryan.odonoghue@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "The eGL class wants to be able to teardown its sync_ data member\nproperly but, doing so in the destructor means we can't make the eGL\ncontext current and thus can't tear down the sync primitive properly.\n\nIntroduce a stop() method to the debayer class which triggers from the\nsoftisp's stop method, allowing a controlled and appropriate tear-down\nof debayer-egl and egl class related data well before the destructors\nget invoked.\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n[bod: Made method blocking not queued per Robert's bugfixes]\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/libcamera/software_isp/debayer.h        |  1 +\n src/libcamera/software_isp/debayer_cpu.cpp  | 10 ++++++++++\n src/libcamera/software_isp/debayer_cpu.h    |  1 +\n src/libcamera/software_isp/software_isp.cpp |  3 +++\n 4 files changed, 15 insertions(+)",
    "diff": "diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex 26787a985..530564c02 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -48,6 +48,7 @@ public:\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;\n \n \tvirtual void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;\n+\tvirtual void stop() = 0;\n \n \tvirtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;\n \ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 00738c56b..28fb8ca50 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -788,6 +788,16 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n \tinputBufferReady.emit(input);\n }\n \n+/**\n+ * \\fn void Debayer::stop()\n+ * \\brief Stop the debayering process and perform cleanup\n+ *\n+ * In the DebayerCPU case this is an empty stub function but\n+ * for the GPU case this does something useful. The stub here is to\n+ * ensure the right version of the virtual gets called.\n+ */\n+void DebayerCpu::stop() {}\n+\n SizeRange DebayerCpu::sizes(PixelFormat inputFormat, const Size &inputSize)\n {\n \tSize patternSize = this->patternSize(inputFormat);\ndiff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\nindex ecc4f9dd0..2d385cf01 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -38,6 +38,7 @@ public:\n \tstd::tuple<unsigned int, unsigned int>\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n \tvoid process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params);\n+\tvoid stop();\n \tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n \tconst SharedFD &getStatsFD() { return stats_->getStatsFD(); }\n \ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 4c232339b..aa4a40cb6 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -367,6 +367,9 @@ int SoftwareIsp::start()\n  */\n void SoftwareIsp::stop()\n {\n+\tdebayer_->invokeMethod(&Debayer::stop,\n+\t\t\t       ConnectionTypeBlocking);\n+\n \tispWorkerThread_.exit();\n \tispWorkerThread_.wait();\n \tispWorkerThread_.removeMessages(debayer_.get());\n",
    "prefixes": [
        "17/22"
    ]
}