{"id":25411,"url":"https://patchwork.libcamera.org/api/1.1/patches/25411/?format=json","web_url":"https://patchwork.libcamera.org/patch/25411/","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":"<20251210003139.43606-16-bryan.odonoghue@linaro.org>","date":"2025-12-10T00:31:32","name":"[v4,15/20] libcamera: software_isp: debayer: Introduce a start() / stop() methods to the debayer object","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"518ff6cfe9c6729849494c60125c32287e5ce7fe","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/1.1/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25411/mbox/","series":[{"id":5644,"url":"https://patchwork.libcamera.org/api/1.1/series/5644/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5644","date":"2025-12-10T00:31:17","name":"GPUISP precursor series","version":4,"mbox":"https://patchwork.libcamera.org/series/5644/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25411/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25411/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 A8AF4BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 00:32:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6D60C6145F;\n\tWed, 10 Dec 2025 01:32:38 +0100 (CET)","from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com\n\t[IPv6:2607:f8b0:4864:20::102a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A4EAC6144C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 01:32:36 +0100 (CET)","by mail-pj1-x102a.google.com with SMTP id\n\t98e67ed59e1d1-340c39ee02dso5040258a91.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Dec 2025 16:32:36 -0800 (PST)","from inspiron14p-linux (p96936b06.osaknt01.ap.so-net.ne.jp.\n\t[150.147.107.6]) by smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-34a70427ea6sm566580a91.3.2025.12.09.16.32.33\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Dec 2025 16:32:34 -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=\"GtkkB4k2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765326755; x=1765931555;\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=5TmeYZw4sP3gvIeKkN5VVzOzrCwOWv0nwPHkPwkgQcc=;\n\tb=GtkkB4k2XrIibGZjyHh5iRGjJpKBM4mcKTLM76K4voDJn5u7b6/2uyGw56YgeRE4QM\n\t0ObXGeULJPP6dallunelZ1zrpt0bhKK5fPcoKu5ZSpgxFC8j5mZIWhXjsiaUwhXjMjpD\n\tc5w5TuPjih7Y3DODrwNON1y4o/9mLcWvA1yI/z89CPdifdgLaJP5CX8vg4LZtfUR5qPf\n\tFWM7mDKNgcpkz81a6FQJnvKMcNDt0WPTBu/SxtjJsqXQTaqgaGZHF2Cdxa0YhnwT2Uf0\n\tHnsUDVNyyI1cHmxI+kvMSVidXTmUGwGcoiol9hANG0ogn8srex5czC4za0PkO837JTDc\n\t1HlQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765326755; x=1765931555;\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=5TmeYZw4sP3gvIeKkN5VVzOzrCwOWv0nwPHkPwkgQcc=;\n\tb=Vfp5mBKUnScs/oljkK4MGqiC6KV7T/HIBuRROjoi469x/0E4Hjj5Gunj7cuvTLnMV+\n\tOjAn4gNboK3ZV69l3WWBw2L6QdzCF+djziMEVU77tCtW34fVhBvQueL7Rbd9UcXUD1iD\n\tx9l1rV2kMM7qXSeaT8ezUK4XG+DOKezK1ZcByFoq12r3n3VKr2kVicHmYZXoRCqxv0VM\n\t6KtvnHnrWAKDH/8N03WeHbPFH1V/EWjFCOYto1mVPtWHrvOoNL0DLLqCs3XQ/RrkHoaX\n\tw3ZhYpS8KpK2lFEXpkfcfZA5Ogk+Hme30ArL6cseSRDS0bMhEb5hDsFhgrFXI4hTlykd\n\ti83g==","X-Gm-Message-State":"AOJu0YwTijBtbEcQK3KVwQtftR5gpSwpOHD0CSGVrkDKlDhnhhPpabwf\n\tkGLaSp0by7IzNcgCYU2EFoUGBLbnDoKVSm4wHzQegJuCzSNtqsZt4+CgueG6gyEtQPo8Ze9cGie\n\tUHXxD","X-Gm-Gg":"AY/fxX7POt9dtwz62FSUMzTvkNpjbPO0UhbVuUryY7au+H7QN48x9eJi0Y615+EwiWw\n\tqKDUvTv+8dmZUXfBU4jYsXcAxNQXARTvskf+DUt/0JveEMKEi6DXVNkltxmM3riET9osKuRfSnr\n\t3DBnCFbzNlZVnZJDPoT+qBCLINrxoY7RSxXH/PleruWAW7KcxjBU7jZ39ebH59snoUhVkHKeBnG\n\tBggAZLSy51qTAYcz1cGvh2Q9JXT6S9jbzmNLwnm6qHnbvIihnk/hms3fMwEOUzsMH2mEvEIDdft\n\tyBDOTRF5dkJZmctF/YZu9RyKg79hYh40uLURwKPclbP/ex00j183E1Z+5A/2pLimcKopq965pcB\n\t0petyycCpOTplMo3+TMcjrCIlUub72zNv0owhPmR2+3ieDkCyX09swDjHwDjpQyKohpssMF7BcF\n\tIjAcLE1qIdFINyzdoXUDoCX8GRSC7OsFEpErW7haZ9LdltPDmS/lW48JhunUDMAR2F","X-Google-Smtp-Source":"AGHT+IF2YvXThUQpzYSn1BpTMUGc+R2eL3OazSbVEyE1Pe0wxk0g+GR1mLpLqYr+Cr/3QApxXqAPow==","X-Received":"by 2002:a17:90a:dfc6:b0:349:3fe8:e7df with SMTP id\n\t98e67ed59e1d1-34a72874747mr501225a91.22.1765326754886; \n\tTue, 09 Dec 2025 16:32:34 -0800 (PST)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>","Subject":"[PATCH v4 15/20] libcamera: software_isp: debayer: Introduce a\n\tstart() / stop() methods to the debayer object","Date":"Wed, 10 Dec 2025 00:31:32 +0000","Message-ID":"<20251210003139.43606-16-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20251210003139.43606-1-bryan.odonoghue@linaro.org>","References":"<20251210003139.43606-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":"In order to initialise and deinitialise gpuisp we need to be able to setup\nEGL in the same thread as Debayer::process() happens in.\n\nIn order to do this we need to extend the Debayer object to provide start\nand stop methods which are triggered through invokeMethod in the same way\nas process() is.\n\nIntroduce start() and stop() methods to the debayer class. Trigger those\nmethods as described above via invokeMethod. The debayer_egl class will\ntake care of initialising and de-initialising as necessary. Debayer CPU\nsees no functional change.\n\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.cpp      | 18 ++++++++++++++++++\n src/libcamera/software_isp/debayer.h        |  2 ++\n src/libcamera/software_isp/software_isp.cpp |  8 ++++++--\n 3 files changed, 26 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/software_isp/debayer.cpp b/src/libcamera/software_isp/debayer.cpp\nindex 1d135b278..32a2c8378 100644\n--- a/src/libcamera/software_isp/debayer.cpp\n+++ b/src/libcamera/software_isp/debayer.cpp\n@@ -336,6 +336,24 @@ Debayer::~Debayer()\n  * debayer processing.\n  */\n \n+/**\n+ * \\fn int Debayer::start()\n+ * \\brief Execute a start signal in the debayer object from workerthread context.\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+\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+\n /**\n  * \\fn void Debayer::setParams(DebayerParams &params)\n  * \\brief Select the bayer params to use for the next frame debayer\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex ff4a92c15..5c0cb3914 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -48,6 +48,8 @@ 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 int start() { return 0; }\n+\tvirtual void stop() { }\n \n \tvirtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;\n \ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 928a2520c..7c9ad9160 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -347,7 +347,9 @@ int SoftwareIsp::start()\n \t\treturn ret;\n \n \tispWorkerThread_.start();\n-\treturn 0;\n+\n+\treturn debayer_->invokeMethod(&DebayerCpu::start,\n+\t\t\t\t      ConnectionTypeBlocking);\n }\n \n /**\n@@ -358,9 +360,11 @@ int SoftwareIsp::start()\n  */\n void SoftwareIsp::stop()\n {\n+\tdebayer_->invokeMethod(&DebayerCpu::stop,\n+\t\t\t       ConnectionTypeBlocking);\n+\n \tispWorkerThread_.exit();\n \tispWorkerThread_.wait();\n-\tispWorkerThread_.removeMessages(debayer_.get());\n \n \tThread::current()->dispatchMessages(Message::Type::InvokeMessage, this);\n \n","prefixes":["v4","15/20"]}