[{"id":37187,"web_url":"https://patchwork.libcamera.org/comment/37187/","msgid":"<85h5u73adj.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-12-03T14:31:20","subject":"Re: [PATCH v3 15/22] libcamera: software_isp: Start the ISP thread\n\tin configure","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi,\n\nnack until\nhttps://lists.libcamera.org/pipermail/libcamera-devel/2025-December/055423.html\nis clarified.\n\nBryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\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>\n> Co-developed-by: Robert Mader <robert.mader@collabora.com>\n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.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>  \tif (ret < 0)\n>  \t\treturn ret;\n>  \n> +\tispWorkerThread_.start();\n> +\n>  \treturn debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);\n>  }\n>  \n> @@ -346,7 +348,6 @@ int SoftwareIsp::start()\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tispWorkerThread_.start();\n>  \treturn 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 E1AC2BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Dec 2025 14:31:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 307DB60F4A;\n\tWed,  3 Dec 2025 15:31:30 +0100 (CET)","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 A9DC2609D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Dec 2025 15:31:28 +0100 (CET)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-77-XDCiNqgPOIm-xCDHUAnVfg-1; Wed, 03 Dec 2025 09:31:24 -0500","by mail-wm1-f71.google.com with SMTP id\n\t5b1f17b1804b1-47799717212so50212755e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 03 Dec 2025 06:31:23 -0800 (PST)","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\t5b1f17b1804b1-4792a8c5fdesm54861685e9.10.2025.12.03.06.31.21\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 03 Dec 2025 06:31:21 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"IFRJ/gDO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1764772287;\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=SqdDoMvPt9Mw9M5xyJga84KEDZ21vCX9GNdKu4ITMH0=;\n\tb=IFRJ/gDOARnSS3cgJAxpa9dcxl8XPh/neXTX+7mAWLb2qTbP6WdOExOoSpy/QF4hkdQlrj\n\t79/iHrrZPeJBiJBjdM/CDkvW+HoRwUlm4HjHA7g85hLMmonP2xhfWxcWPQ+X009qmbBUTe\n\tF94oZnCPamdj3Rl9leIE+qV2WHpV3sc=","X-MC-Unique":"XDCiNqgPOIm-xCDHUAnVfg-1","X-Mimecast-MFC-AGG-ID":"XDCiNqgPOIm-xCDHUAnVfg_1764772283","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1764772282; x=1765377082;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=SqdDoMvPt9Mw9M5xyJga84KEDZ21vCX9GNdKu4ITMH0=;\n\tb=Uepf0xxkAcaUh7P2yOvutPyml2G6OxBmu2Am2ldGPsljRStuUr4ubprDKJB/sAejwO\n\t+dlbFHLIEVNWL8ira6Ws/dR3MAKAZRlYoxQi5K9eJWy6f0PtaApd7HVw2cx86NZmISid\n\tPbd2lpcfFb7ish7aV2b8n4pO8+hvvw5EKzJ82yu1VYgl/5IQY6c78i4yTF8BM5YSQ5O0\n\ty5VEVJWEt8Z8JVW/yg1dngv/mTo/i6gS2vWslFUtdKRGKDhSfGwgOdQfS2w3Qb+rK+XA\n\tJef5RU6EgV1cVY42U1dssl7yM2WZWxiQolPJpGIisw8hj1akRNi7GDO35emNrDcf7jpX\n\tZAug==","X-Gm-Message-State":"AOJu0YwqPEKNO4YxFypvCkjauArLydsbKpcs0HsjCyyJg28ZumXGiOT4\n\tuWbmu9gf25fAY/gtxlLC82+kPjv2P3njG3N1yfLs7VI3pHMEmt5dZN6GIdtZg4GDYFB+ET/qHf9\n\tAN/TO8rrVbAbFHz13V1oBJ6BajcMt/sZM0ygtJkFPlVnHX0+2JmE1BAr/tSEF6k7fg9EJMkZ6ZR\n\tc5rZ+l+x4=","X-Gm-Gg":"ASbGncts/B2GqY1eXHM9XwFraHyBaxQKRsX2aeOyexiblpw3rtkCq7VCsqqlpz5Cbb2\n\tfY3oFh8JZa5r3nLU6ophp0QsdX8USFUhAU0S5yvH6BVSdiuFUl5UOVqaJCvnVYk/7hIbyzjQrdU\n\tSp+KMeMWcbGmxc9xlVeB3VqxQpkgLPwDw4xZ7svRPVKOentu8g+qNpaujstKwZq8XGrxitoMUb3\n\tvek9Ydv2TJztwrd/3Gx5OwNqDgKBeU6KTvR1jvHJ/us7eOSQ+tKHXKi1jevkXLbMT7L4HA6KkxA\n\tap33sH8dU7wEDz3vRSJrt2LRk5uKIIWdM57+CTZL9sxyDr0zqSXy6k3SxedYQDP0ykc5vu7guJC\n\tT+/11bJdTvNucV9084RQNovZ3IUKavfBhs1h2/mzE5sczCoeopi2rlO/Z1WZvAik=","X-Received":["by 2002:a05:600c:3b1f:b0:477:8a2a:123e with SMTP id\n\t5b1f17b1804b1-4792af4046fmr22027875e9.33.1764772282317; \n\tWed, 03 Dec 2025 06:31:22 -0800 (PST)","by 2002:a05:600c:3b1f:b0:477:8a2a:123e with SMTP id\n\t5b1f17b1804b1-4792af4046fmr22027615e9.33.1764772281910; \n\tWed, 03 Dec 2025 06:31:21 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IHZYY0/9+PS8id+kqyMlKjSRkBxul/vVBKb8DwW8UDNgpWtsK+eVDw12NqpvS2aVYG0L5muUQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org,  pavel@ucw.cz,  Robert Mader\n\t<robert.mader@collabora.com>,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v3 15/22] libcamera: software_isp: Start the ISP thread\n\tin configure","In-Reply-To":"<20251202133157.661407-16-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Tue, 2 Dec 2025 13:31:46 +0000\")","References":"<20251202133157.661407-1-bryan.odonoghue@linaro.org>\n\t<20251202133157.661407-16-bryan.odonoghue@linaro.org>","Date":"Wed, 03 Dec 2025 15:31:20 +0100","Message-ID":"<85h5u73adj.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":"c2CTF_7u34PEASOtcUGNK8SRbS71yWa-tDbb2LZmPzU_1764772283","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>"}}]