[{"id":37090,"web_url":"https://patchwork.libcamera.org/comment/37090/","msgid":"<176423459525.567526.3399883875951555850@ping.linuxembedded.co.uk>","date":"2025-11-27T09:09:55","subject":"Re: [PATCH v2 16/22] libcamera: software_isp: Move configure to\n\tworker thread","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Bryan O'Donoghue (2025-11-27 02:22:48)\n> EGL requires both configure() and process() to operate on the same\n> thread. As preparation for that, move current CPU configure into the\n> WorkerThread with a ConnectionTypeBlocking invocation of\n> &DebayerCpu::configure.\n> \n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  src/libcamera/software_isp/software_isp.cpp | 12 ++++++++++--\n>  1 file changed, 10 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index afa4eb7a8..4c232339b 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -267,7 +267,15 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,\n>  \n>         ispWorkerThread_.start();\n>  \n> -       return debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);\n> +       ret = debayer_->invokeMethod(&Debayer::configure,\n> +                                    ConnectionTypeBlocking, inputCfg,\n> +                                    outputCfgs, ccmEnabled_);\n> +       if (ret) {\n> +               ispWorkerThread_.exit();\n> +               ispWorkerThread_.wait();\n> +       }\n> +\n> +       return ret;\n>  }\n>  \n>  /**\n> @@ -391,7 +399,7 @@ void SoftwareIsp::stop()\n>  void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>  {\n>         ipa_->computeParams(frame);\n> -       debayer_->invokeMethod(&DebayerCpu::process,\n> +       debayer_->invokeMethod(&Debayer::process,\n>                                ConnectionTypeQueued, frame, input, output, debayerParams_);\n>  }\n>  \n> -- \n> 2.51.2\n>","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 1A5DDC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Nov 2025 09:10:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1D26460A85;\n\tThu, 27 Nov 2025 10:10:00 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B5C460805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Nov 2025 10:09:59 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9EA4A593;\n\tThu, 27 Nov 2025 10:07:48 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qmVvflag\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764234468;\n\tbh=mHYnqyoIqdV6XF5VkH3Sq68rN60iqgEjOyL8UV5Womg=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=qmVvflagdjwpQzkOayKPzmyAr4+wY5PMrBrMikM9Tx8C08LR7WgfvYei6xDDmgxy0\n\t0WQcNJJQoSQOJo5nLOIWMQ9uhHsso4k1sYfqSCJUAiRSKcMjs2Usg2UNgd9rW+KVmd\n\tlAXNaQxmxS6rcDqq1/LqmrjdidwZZt80UB4PgBCs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251127022256.178929-17-bryan.odonoghue@linaro.org>","References":"<20251127022256.178929-1-bryan.odonoghue@linaro.org>\n\t<20251127022256.178929-17-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH v2 16/22] libcamera: software_isp: Move configure to\n\tworker thread","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 27 Nov 2025 09:09:55 +0000","Message-ID":"<176423459525.567526.3399883875951555850@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":37137,"web_url":"https://patchwork.libcamera.org/comment/37137/","msgid":"<96b31bfa-735a-4c40-bcd8-07a9939279c6@ideasonboard.com>","date":"2025-12-01T12:18:45","subject":"Re: [PATCH v2 16/22] libcamera: software_isp: Move configure to\n\tworker thread","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 11. 27. 3:22 keltezéssel, Bryan O'Donoghue írta:\n> EGL requires both configure() and process() to operate on the same\n> thread. As preparation for that, move current CPU configure into the\n> WorkerThread with a ConnectionTypeBlocking invocation of\n> &DebayerCpu::configure.\n> \n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>   src/libcamera/software_isp/software_isp.cpp | 12 ++++++++++--\n>   1 file changed, 10 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index afa4eb7a8..4c232339b 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -267,7 +267,15 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,\n>   \n>   \tispWorkerThread_.start();\n>   \n> -\treturn debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);\n> +\tret = debayer_->invokeMethod(&Debayer::configure,\n> +\t\t\t\t     ConnectionTypeBlocking, inputCfg,\n> +\t\t\t\t     outputCfgs, ccmEnabled_);\n> +\tif (ret) {\n> +\t\tispWorkerThread_.exit();\n> +\t\tispWorkerThread_.wait();\n> +\t}\n> +\n> +\treturn ret;\n>   }\n>   \n>   /**\n> @@ -391,7 +399,7 @@ void SoftwareIsp::stop()\n>   void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n>   {\n>   \tipa_->computeParams(frame);\n> -\tdebayer_->invokeMethod(&DebayerCpu::process,\n> +\tdebayer_->invokeMethod(&Debayer::process,\n>   \t\t\t       ConnectionTypeQueued, frame, input, output, debayerParams_);\n\nI think this change should be part of\n\"libcamera: software_isp: debayer: Make the debayer_ object of type class Debayer not DebayerCpu\".\n\n\nRegards,\nBarnabás Pőcze\n\n>   }\n>","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 2BAC9C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Dec 2025 12:18:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 28F2060B2F;\n\tMon,  1 Dec 2025 13:18:50 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B53960A7B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Dec 2025 13:18:49 +0100 (CET)","from [192.168.33.24] (185.182.214.104.nat.pool.zt.hu\n\t[185.182.214.104])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B2C38B3;\n\tMon,  1 Dec 2025 13:16:35 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hm4SEX4y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764591395;\n\tbh=Z+q6VCK6nail0g0fwa8LvFz482af/M1+OQbk+V+NDrc=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=hm4SEX4yObauGMDi2teSrP94EGh/kZoNNqaBGem8y/j4KH9GWdkbD7w+2qNf5lGqi\n\tBQ45gKf0+jP7r3YgT7QlyXLm7v6it1ClIMqXVWLW5Difgs40KXvazRvh0tf8qu3GnC\n\tip6PBhZaBE8qvI/30c3/kemxhPw/W03LbbtV68Sk=","Message-ID":"<96b31bfa-735a-4c40-bcd8-07a9939279c6@ideasonboard.com>","Date":"Mon, 1 Dec 2025 13:18:45 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 16/22] libcamera: software_isp: Move configure to\n\tworker thread","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"pavel@ucw.cz","References":"<20251127022256.178929-1-bryan.odonoghue@linaro.org>\n\t<20251127022256.178929-17-bryan.odonoghue@linaro.org>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251127022256.178929-17-bryan.odonoghue@linaro.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]