[{"id":36309,"web_url":"https://patchwork.libcamera.org/comment/36309/","msgid":"<85tszzdqvg.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-10-16T11:32:03","subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Bryan,\n\nBryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> The eGL class wants to be able to teardown its sync_ data member\n> properly but, doing so in the destructor means we can't make the eGL\n> context current and thus can't tear down the sync primitive properly.\n>\n> Introduce a stop() method to the debayer class which triggers from the\n> softisp's stop method, allowing a controlled and appropriate tear-down\n> of debayer-egl and egl class related data well before the destructors\n> get invoked.\n\nLooking around, I'm not sure stop() gets called only before the\ndestructor, perhaps the instance survives camera stop-(re)start.  But\neven then it looks like the correct thing to do.\n\nAFAICS:\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> Signed-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.h    | 1 +\n>  src/libcamera/software_isp/software_isp.cpp | 3 +++\n>  3 files changed, 5 insertions(+)\n>\n> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n> index c5eb0d38..8fa281c7 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>  \n> diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\n> index ff72eaba..3cc07028 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>  \n>  \t/**\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index df72b1c3..1f984a52 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -366,6 +366,9 @@ int SoftwareIsp::start()\n>   */\n>  void SoftwareIsp::stop()\n>  {\n> +\tdebayer_->invokeMethod(&Debayer::stop,\n> +\t\t\t       ConnectionTypeQueued);\n> +\n>  \tispWorkerThread_.exit();\n>  \tispWorkerThread_.wait();","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 4A887C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Oct 2025 11:32:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5681360678;\n\tThu, 16 Oct 2025 13:32:10 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0EE63605D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 13:32:08 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-133-28OF9ruPO5uS_14tl3gyQw-1; Thu, 16 Oct 2025 07:32:06 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-46fa88b5760so2049985e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 04:32:06 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-426ce5e8207sm33411864f8f.47.2025.10.16.04.32.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 16 Oct 2025 04:32:04 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"JjoNk5tM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1760614328;\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\tin-reply-to:in-reply-to:references:references;\n\tbh=UjbZN+O3R45AJTayCXQMlJOTX+rAfsnoa1pvBG/8wN4=;\n\tb=JjoNk5tMlQoQGQJJfhb1w4T67wiOfylslR7ERGsjYeq8d0zwVfqGyO0u9THMYsCe6wX1xA\n\tDFA2CnYSufCbkWrJhsrtmHN9n0hxqTOELDThAP88ujwnN6aezAZZsBQEd5rU2wFu5RvOaD\n\twJjhbIYOvm7Mm7zJ1OMjppkXpwxPvPo=","X-MC-Unique":"28OF9ruPO5uS_14tl3gyQw-1","X-Mimecast-MFC-AGG-ID":"28OF9ruPO5uS_14tl3gyQw_1760614325","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1760614325; x=1761219125;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=UjbZN+O3R45AJTayCXQMlJOTX+rAfsnoa1pvBG/8wN4=;\n\tb=Zps2F0LOqqKWwreaCIKdmx+PLnIPpDTU1JRoqWnL86mU61gVH0G+EubFeeUzWmgML/\n\tkdGxyvOW8fQbWttsceQDnBGSYtamIrnp2J28lMGX58EKWdt2FDJFm0hkU0Ai0FXI4k3R\n\t9YM+Wdbhyod1maN/sfqeUKlHtfmPHZS6VnrjCM9IPmsrY4P49TE2NhbiuKLbvzwJhrkr\n\t1EytBGDzKFwug23iN8TtV2Uqr9AbRTDe1L+orCWRoNVHDT3EVztQZGb3aAAkOGGM+ENr\n\tPzvpdGDGDNZ5lnT12VUkznprFgZkRHcubLtN8W2taIzWfveSPeTguhWJiaBEvHCAD3LZ\n\t16iw==","X-Gm-Message-State":"AOJu0YxI1Vq8qga1tnSecW855kz12hpQYbgm319wqz/W1gJw+OAn8kU4\n\tw9gA++83aHpiqiDqvE7sbaOopyNMUZW9W28deQyFg9nA4Xce4dEswuflvoZFNa7iEnia2Xjkvn2\n\tqg7BYYJ2klrsyc3jKFAqlvN0UFPgQbmlysoW0BJ56mJ+Q1qTAwrp3F7CROwm5B4k0awOqtWB7Kw\n\ts=","X-Gm-Gg":"ASbGnctkOD/HDb3z99FjXpTpJASd5kDMMPg+CmrTqFN3RMq7j0oG2wDdjc/uoFYQYTr\n\tFwjmOMR6/v3NmNwMsPWlVL0W71T73ib1q5va2G8sQF7yOhicA/VKa5Kt337DG3g+qO3ITK3uOaA\n\tuP8konH3x8RWIiS/nWdG72dogfMpsfFCHUC8mZ26nSuOzV1zMFHq0YSYqEsyD7wKfbefY4Xy7ct\n\tUwhnTovVmNn+LkZFgSxXHV4GdN0veO9PcZF1ASdjX4FKyw+5eeC3isi6Y9v8kfBeRBG3QIZAgFg\n\tDPmr/Lc7RzcOmPCdwy8pagVztoGQPf/YeagfCSzj7cJMWOQ5rsFNOqVY8cNCQ/O77LgIWcvB6+U\n\tGgLwTyew5OzNM2K+iugH49E6vcPkA3euD6yZa469d6iNrY44815FF","X-Received":["by 2002:a05:6000:430b:b0:3ec:d7c4:25b6 with SMTP id\n\tffacd0b85a97d-4266e7c7c4bmr23342373f8f.27.1760614325169; \n\tThu, 16 Oct 2025 04:32:05 -0700 (PDT)","by 2002:a05:6000:430b:b0:3ec:d7c4:25b6 with SMTP id\n\tffacd0b85a97d-4266e7c7c4bmr23342355f8f.27.1760614324822; \n\tThu, 16 Oct 2025 04:32:04 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGHMhp9qLGqIWV8SW+MbWxEKWfzUiSRS3utAQ3mwVQiva9nhz8Gr86elkN1S1q9nAZhB8rOTw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  hdegoede@redhat.com,\n\tbod.linux@nxsw.ie","Subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","In-Reply-To":"<20251015012251.17508-23-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 15 Oct 2025 02:22:34 +0100\")","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-23-bryan.odonoghue@linaro.org>","Date":"Thu, 16 Oct 2025 13:32:03 +0200","Message-ID":"<85tszzdqvg.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"qO_QcLzJFkV6AGU7lGwH_VvvarAPRw8bxhI3A0Lj0FM_1760614325","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":36311,"web_url":"https://patchwork.libcamera.org/comment/36311/","msgid":"<b746444e-0181-457a-86c9-9230ea9f76f2@collabora.com>","date":"2025-10-16T11:38:58","subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 10/16/25 13:32, Milan Zamazal wrote:\n> Hi Bryan,\n>\n> Bryan O'Donoghue<bryan.odonoghue@linaro.org> writes:\n>\n>> The eGL class wants to be able to teardown its sync_ data member\n>> properly but, doing so in the destructor means we can't make the eGL\n>> context current and thus can't tear down the sync primitive properly.\n>>\n>> Introduce a stop() method to the debayer class which triggers from the\n>> softisp's stop method, allowing a controlled and appropriate tear-down\n>> of debayer-egl and egl class related data well before the destructors\n>> get invoked.\n> Looking around, I'm not sure stop() gets called only before the\n> destructor, perhaps the instance survives camera stop-(re)start.  But\n> even then it looks like the correct thing to do.\n\nIn fact I can reliably reproduce the assert in DebayerEGL::stop() -> \neGL::cleanUp() when restarting a camera, switching back-and-forth \nbetween two cameras in Snapshot. IIRC that was not the case in v2 - did \nanything change here?\n\n> AFAICS:\n>\n> Reviewed-by: Milan Zamazal<mzamazal@redhat.com>\n>\n>> Signed-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.h    | 1 +\n>>   src/libcamera/software_isp/software_isp.cpp | 3 +++\n>>   3 files changed, 5 insertions(+)\n>>\n>> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n>> index c5eb0d38..8fa281c7 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>>   \n>> diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\n>> index ff72eaba..3cc07028 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>>   \n>>   \t/**\n>> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n>> index df72b1c3..1f984a52 100644\n>> --- a/src/libcamera/software_isp/software_isp.cpp\n>> +++ b/src/libcamera/software_isp/software_isp.cpp\n>> @@ -366,6 +366,9 @@ int SoftwareIsp::start()\n>>    */\n>>   void SoftwareIsp::stop()\n>>   {\n>> +\tdebayer_->invokeMethod(&Debayer::stop,\n>> +\t\t\t       ConnectionTypeQueued);\n>> +\n>>   \tispWorkerThread_.exit();\n>>   \tispWorkerThread_.wait();","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 C71C9BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Oct 2025 11:39:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0A466067B;\n\tThu, 16 Oct 2025 13:39:08 +0200 (CEST)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8345B60676\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 13:39:07 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1760614740446192.1529553612578;\n\tThu, 16 Oct 2025 04:39:00 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"iutMl2py\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1760614743; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=lVewTgl/SDLFNGM+xpY//Q1YuEh6tPldWsIY/I+FJ1y1O+n6GsGMrDhto9mv3N1JY26+q0BdAbttx/uUq2OBf80iot13kH4v0FECLQM9UQPXkWH/o3zFuPTl39OV3mHpqc5fg0S0dfkcSlJMyloBAyD1h+Ptz5ZWLPVH7O6904s=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1760614743;\n\th=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=zNqFU7GvpMP5lbcYM2PWWtFxeFVUsFNHq35zDcJvBFI=; \n\tb=jwRYK27zUAupm0OBha/szRl8B6Oaw+g5d7l8kwdzvlNYtwYn4tmgXzMqqfKYUEqo01Af3OaBRny5jHXC5eJeAt/w78LZBzBvQKqkoqyJqGDFMChi5lobdFXEf9QuSRmNDWZp4oOLU5dp5nfnCbbFfxO4wq0ExuoFp6AXlmp1bb4=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1760614743;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Content-Type:Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Message-Id:Reply-To:Cc;\n\tbh=zNqFU7GvpMP5lbcYM2PWWtFxeFVUsFNHq35zDcJvBFI=;\n\tb=iutMl2pyn2hF9xO6HWqBDTkv6NFZu9aqLZZWJSyfhkzHPKJockGI4gmSlkpTM8HA\n\tJ89fu8r9W1zGqoQ6+oLuo49kLuUgfCRx6bSuWs5Ym3UnBSLfGWv+ROaX0N22QirVs4J\n\tj4KHZPxfKqB2RhvKwW49wPUPq5EIyvKORQiRiYkQ=","Content-Type":"multipart/alternative;\n\tboundary=\"------------ZOxpavEbL9YYutJ264w7bF1V\"","Message-ID":"<b746444e-0181-457a-86c9-9230ea9f76f2@collabora.com>","Date":"Thu, 16 Oct 2025 13:38:58 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","To":"libcamera-devel@lists.libcamera.org","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<20251015012251.17508-23-bryan.odonoghue@linaro.org>\n\t<85tszzdqvg.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<85tszzdqvg.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","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":36312,"web_url":"https://patchwork.libcamera.org/comment/36312/","msgid":"<4275538d-b850-4f0a-bc4b-429da327218f@ideasonboard.com>","date":"2025-10-16T11:39:36","subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n\n2025. 10. 15. 3:22 keltezéssel, Bryan O'Donoghue írta:\n> The eGL class wants to be able to teardown its sync_ data member\n> properly but, doing so in the destructor means we can't make the eGL\n> context current and thus can't tear down the sync primitive properly.\n> \n> Introduce a stop() method to the debayer class which triggers from the\n> softisp's stop method, allowing a controlled and appropriate tear-down\n> of debayer-egl and egl class related data well before the destructors\n> get invoked.\n> \n> Signed-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.h    | 1 +\n>   src/libcamera/software_isp/software_isp.cpp | 3 +++\n>   3 files changed, 5 insertions(+)\n> \n> diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\n> index c5eb0d38..8fa281c7 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> \n> diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\n> index ff72eaba..3cc07028 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> \n>   \t/**\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index df72b1c3..1f984a52 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -366,6 +366,9 @@ int SoftwareIsp::start()\n>    */\n>   void SoftwareIsp::stop()\n>   {\n> +\tdebayer_->invokeMethod(&Debayer::stop,\n> +\t\t\t       ConnectionTypeQueued);\n\nThis should be `ConnectionTypeBlocking` otherwise it's not\nguaranteed to run since the thread is immediately stopped.\n\n\nRegards,\nBarnabás Pőcze\n\n> +\n>   \tispWorkerThread_.exit();\n>   \tispWorkerThread_.wait();\n> \n> --\n> 2.51.0\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 E10F5BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Oct 2025 11:39:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 894DF6068B;\n\tThu, 16 Oct 2025 13:39:42 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6ECE060676\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 13:39:40 +0200 (CEST)","from [192.168.33.24] (185.182.214.105.nat.pool.zt.hu\n\t[185.182.214.105])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 20CDB316;\n\tThu, 16 Oct 2025 13:38:00 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HDMGq0Sq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760614680;\n\tbh=rkXig4mBDFip+l1SKXo4lJHvTaQL3D1TslcgOnqjm10=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=HDMGq0SqyOME4QqG54K/l4Xv9C9f+eJUwkDL6SKa7yu2dGdmBKiy1nQOtJKjfYQUB\n\tn9KPfJtBxYqH1R0laceTUbpZFsD1JLRJxpMOQ9XPk3oDZSeKxLhaImXvSJLZn8Ir5+\n\tYJc04ZrQ3URyvTK7zHDcjRuXUXiZBaMkremj1N7o=","Message-ID":"<4275538d-b850-4f0a-bc4b-429da327218f@ideasonboard.com>","Date":"Thu, 16 Oct 2025 13:39:36 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"hdegoede@redhat.com, mzamazal@redhat.com, bod.linux@nxsw.ie","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<rOiSxrsvX_QipQjxAv5RfWvEABDgcsVLoGI0ltEBdBQq_QYgUA_Wa6b0izmVuwKGO4uEQnC1EIqIubFDIvr73g==@protonmail.internalid>\n\t<20251015012251.17508-23-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":"<20251015012251.17508-23-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>"}},{"id":36327,"web_url":"https://patchwork.libcamera.org/comment/36327/","msgid":"<f95d37bc-dda8-4f27-af72-a781b31a30bc@collabora.com>","date":"2025-10-16T17:35:06","subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 16.10.25 13:39, Barnabás Pőcze wrote:\n>> diff --git a/src/libcamera/software_isp/software_isp.cpp \n>> b/src/libcamera/software_isp/software_isp.cpp\n>> index df72b1c3..1f984a52 100644\n>> --- a/src/libcamera/software_isp/software_isp.cpp\n>> +++ b/src/libcamera/software_isp/software_isp.cpp\n>> @@ -366,6 +366,9 @@ int SoftwareIsp::start()\n>>    */\n>>   void SoftwareIsp::stop()\n>>   {\n>> +    debayer_->invokeMethod(&Debayer::stop,\n>> +                   ConnectionTypeQueued);\n>\n> This should be `ConnectionTypeBlocking` otherwise it's not\n> guaranteed to run since the thread is immediately stopped.\nNice, can confirm that doing that fixes the assertions I saw in \nDebayerEGL::stop() -> eGL::cleanUp() when restarting a camera.\n>\n>\n> Regards,\n> Barnabás Pőcze\n>\n>> +\n>>       ispWorkerThread_.exit();\n>>       ispWorkerThread_.wait();\n>>\n>> -- \n>> 2.51.0\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 D3A94BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Oct 2025 17:35:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 10FC26068F;\n\tThu, 16 Oct 2025 19:35:18 +0200 (CEST)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 005F3605D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Oct 2025 19:35:16 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1760636109620966.1342460619933;\n\tThu, 16 Oct 2025 10:35:09 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"guv/cYCt\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1760636114; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=SNl/1OaTY3ix4vy44R46VcL/rfO9jk9RmsJJTemDvkE4rZythIMnyMsDPCLRHj5HsFjoCOUzaq55PuWfl7glPucl3q9a5dGVz9PG5vYWF2MZnCG8Vz24wpbdDfr0IQYBzs9eCxXYxEWooFDwq9E49su5owxRtsx66hiPYcLuJFA=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1760636114;\n\th=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=jcoO0EFDUUmwNcQdY3xlvCLg04ltUUYkXGZ1Szu/LsQ=; \n\tb=WinMGKw2wB9q9jeM/qRm9OXPYAFd30Y7Z/p7DmfrrzNpLbSL+ld7WXwJbHXfXaDcXCuXjRBq4kELtNZ6ozsljXjY1UL9ifLO9UhXuF/wL9PwxqUKSayCdm1RBKvPEiy6hnqJasRcYKo29Dxy3KVH86IAln7PmxCdBjKThHg0tZo=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1760636114;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Content-Type:Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Message-Id:Reply-To:Cc;\n\tbh=jcoO0EFDUUmwNcQdY3xlvCLg04ltUUYkXGZ1Szu/LsQ=;\n\tb=guv/cYCtKDocluJ73yZF8w7o83ejH644h34NtF8GbJHw54c9VOPJd4Efw9858nLg\n\tqZBJs1UW/Y7G6gCmdxC9tQjo4ETgA+8ktmubeM+cpg14w3M1dhg/sImNd9qmdsYFvi3\n\taf6PBW638Gu79k79izcWrwtB8CFhPtIax0xhzE8Q=","Content-Type":"multipart/alternative;\n\tboundary=\"------------r8lRPJsLkiH1BgxF8DHP4To5\"","Message-ID":"<f95d37bc-dda8-4f27-af72-a781b31a30bc@collabora.com>","Date":"Thu, 16 Oct 2025 19:35:06 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a\n\tstop() callback to the debayer object","To":"libcamera-devel@lists.libcamera.org","References":"<20251015012251.17508-1-bryan.odonoghue@linaro.org>\n\t<rOiSxrsvX_QipQjxAv5RfWvEABDgcsVLoGI0ltEBdBQq_QYgUA_Wa6b0izmVuwKGO4uEQnC1EIqIubFDIvr73g==@protonmail.internalid>\n\t<20251015012251.17508-23-bryan.odonoghue@linaro.org>\n\t<4275538d-b850-4f0a-bc4b-429da327218f@ideasonboard.com>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<4275538d-b850-4f0a-bc4b-429da327218f@ideasonboard.com>","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>"}}]