[{"id":37089,"web_url":"https://patchwork.libcamera.org/comment/37089/","msgid":"<176423445472.567526.15343694671108826779@ping.linuxembedded.co.uk>","date":"2025-11-27T09:07:34","subject":"Re: [PATCH v2 15/22] libcamera: software_isp: Start the ISP thread\n\tin configure","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:47)\n> EGL is not thread-safe and in fact associates invisible handles with the\n> threadid of the calling context.\n> \n> As a result we need to make Deabyer::configure() and Debayer::process() in SoftISP execute on\n> the same thread.\n> \n> When we call Debayer::configure() in the egl class this will setup and egl context\n> for us which is associated with the calling thread context. Hence when\n> Debayer::process(); runs it must run in the same thread as\n> Debayer::configure() or the hidden Gegl context handles will not point\n> to the same place.\n> \n> Move start thread into configure() as a first step towards this.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> Co-developed-by: Robert Mader <robert.mader@collabora.com>\n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  src/libcamera/software_isp/software_isp.cpp | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index 928a2520c..afa4eb7a8 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -265,6 +265,8 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,\n>         if (ret < 0)\n>                 return ret;\n>  \n> +       ispWorkerThread_.start();\n> +\n>         return debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);\n>  }\n>  \n> @@ -346,7 +348,6 @@ int SoftwareIsp::start()\n>         if (ret)\n>                 return ret;\n>  \n> -       ispWorkerThread_.start();\n>         return 0;\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 43DA6C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Nov 2025 09:07:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1F6660A9E;\n\tThu, 27 Nov 2025 10:07:41 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D8C060805\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Nov 2025 10:07:39 +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 82F31593;\n\tThu, 27 Nov 2025 10:05:28 +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=\"kolYxg6s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764234328;\n\tbh=gBMkNPvuurCHcpvImItn0JlHL6AQ0GB4VYG5ej6y7A0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=kolYxg6swOWPecpJY3uQ/m5EHlNvDNzj+o5Cs3EvLE202jjInS8cVS1MHaZ4fKPmV\n\tEC5SXKlkLnxsax+akgnk5dNBu2Qa+Y59XwkWotxPbSg5lQJlN/XMFSl9/kgk2MRPwG\n\txtyXmqLODGIP/eO7xWepf+nEYeH229LEZbzM3CXk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251127022256.178929-16-bryan.odonoghue@linaro.org>","References":"<20251127022256.178929-1-bryan.odonoghue@linaro.org>\n\t<20251127022256.178929-16-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH v2 15/22] libcamera: software_isp: Start the ISP thread\n\tin configure","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tRobert Mader <robert.mader@collabora.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 27 Nov 2025 09:07:34 +0000","Message-ID":"<176423445472.567526.15343694671108826779@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>"}}]