From patchwork Wed Oct 15 01:22:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 24667 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 78A35C3334 for ; Wed, 15 Oct 2025 01:23:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E314560654; Wed, 15 Oct 2025 03:23:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eBekZxVF"; dkim-atps=neutral Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A11C060626 for ; Wed, 15 Oct 2025 03:23:17 +0200 (CEST) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-63b9da57cecso5187733a12.0 for ; Tue, 14 Oct 2025 18:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1760491397; x=1761096197; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TcjrI2pwXI63DofETtDiLdp+t1mdKMGi9/omHCjy1Os=; b=eBekZxVF510LuS8z4/4PVRserTpqdxmUlBeVXs6u7xAjhFkeqDic+6pJXLb0TQ2zKT IE9o0cV0BlmhBJ3HhUIBsB+yIAutUISgHuqjVnUdmECYw2krgfKhTScYtvHiosr54Wdi ZgYVeB4VSLyO8yiHaDSJbYTuDCJFL4v+wLrJXJ5iQhA608tntRTW0SInIRBIP3tneH61 9yCQQQ+Mh0ZSW2tXdTtLZi/02hD/QglPkOfcMpSugmC2Lb2qPfcXi6YgWf0EsEi52yp9 c3w3MRWXCRPegSQhjwgxb2cR37vSJ67mvnJBedjBhU+yCU/DFXyuXzTfkiRnXWKRjUQS IyqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760491397; x=1761096197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TcjrI2pwXI63DofETtDiLdp+t1mdKMGi9/omHCjy1Os=; b=dhrxFfWYG8BrsoSh/wDIBZcYRGW1/NQqIxLowkm20yF30C25KofKOlTE0qWWSg0xwo bT/5tu3q5vF+dLwED9L9KaX93tpA9pJPForJvKJ12jt/QNMbzSbco8q+KxsSHI1y9sAV TnYhAxkgRQm69DzI5pwjkjxfOoTX8YLR40ubjesYUQamsKs6qF4Ev7CgAjFkOZeXj/Iv VfXwJnwGJ4VxeRmFQj6hWMgLe4s/WxbCYerXfCKuT7F49zdHBp5bWVRC9ZDihtA4pkZu ndGVi/12zuFaiZOizKCbH07Pj9qa1bHZuaGzSPu7XxR/C3t7fClbLZy9t+ioh59MvUaU X/zg== X-Gm-Message-State: AOJu0YxAUkdwmDlBL666QEIBJ77t/jSw73sSmra+2mvfMF/s2mOTvLRh WaLs7lVDJ7nZjQooOPJavovuny4PzUvfqH2az+hiJhREwbKz6PnFfHYwegNWh5HbpbYhGfHzH0x RpSFM X-Gm-Gg: ASbGncustIXdmZNX8zpFO855ZDObj4YGQrvX7mDy8hZ/UZaXz2sCwFW7n6zgUkE3qYw e0CJxxkdvlhahQjifK3jSqXFCgv8jMU3KORZjv5h3mzMFBtjot0lIeIZ4ki+Yiua+1SCv/FEGBi KpVoPa+FZqa6aN76pFW6RulV42jwq/E24jl+iPiWhgWQ3KVDqQKppMWCU+gdkSh0Kwl2Ps2xEyK 1qJfaxaAu3NXMO9tATrwxK1s6XwMXiw5vqPHMC/Ffj9Q2iHshjOqeYeu4NbXxpwUqs3Q7Gm6hoa ch3FjfJa9mHI78FgGEXTL7bXvboCbHsomHO7Y36IboUYNxfVTym+2K4qcl0nMBRbRgH9/NLxd+O r0SK7mMIBvmmf0USHSiw+NDt1g53yDPHJhYLTam8QvkUlMWsNkX2foRg/yOa68EMZ1TdPXZbD9C OFqyasgpiKRqKTcUZidz8m0727aHaOag== X-Google-Smtp-Source: AGHT+IEJioIdjnrx0V+L342PmGSB6hPcUzAql28Sl5XMO2Le0FyjbgD7NcMhc0qd6fitrz8IKmp1lQ== X-Received: by 2002:a17:907:26c5:b0:b3b:f19:ac7c with SMTP id a640c23a62f3a-b50aba9e59bmr2630102466b.36.1760491396758; Tue, 14 Oct 2025 18:23:16 -0700 (PDT) Received: from inspiron14p-linux.nxsw.local (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b5ccd7b202dsm98348466b.82.2025.10.14.18.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 18:23:16 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org, bod.linux@nxsw.ie Subject: [PATCH v3 22/39] libcamera: software_isp: debayer: Introduce a stop() callback to the debayer object Date: Wed, 15 Oct 2025 02:22:34 +0100 Message-ID: <20251015012251.17508-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015012251.17508-1-bryan.odonoghue@linaro.org> References: <20251015012251.17508-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The eGL class wants to be able to teardown its sync_ data member properly but, doing so in the destructor means we can't make the eGL context current and thus can't tear down the sync primitive properly. Introduce a stop() method to the debayer class which triggers from the softisp's stop method, allowing a controlled and appropriate tear-down of debayer-egl and egl class related data well before the destructors get invoked. Signed-off-by: Bryan O'Donoghue Reviewed-by: Milan Zamazal --- src/libcamera/software_isp/debayer.h | 1 + src/libcamera/software_isp/debayer_cpu.h | 1 + src/libcamera/software_isp/software_isp.cpp | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h index c5eb0d38..8fa281c7 100644 --- a/src/libcamera/software_isp/debayer.h +++ b/src/libcamera/software_isp/debayer.h @@ -48,6 +48,7 @@ public: strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0; virtual void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0; + virtual void stop() = 0; virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0; diff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h index ff72eaba..3cc07028 100644 --- a/src/libcamera/software_isp/debayer_cpu.h +++ b/src/libcamera/software_isp/debayer_cpu.h @@ -38,6 +38,7 @@ public: std::tuple strideAndFrameSize(const PixelFormat &outputFormat, const Size &size); void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params); + void stop() {} SizeRange sizes(PixelFormat inputFormat, const Size &inputSize); /** diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index df72b1c3..1f984a52 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -366,6 +366,9 @@ int SoftwareIsp::start() */ void SoftwareIsp::stop() { + debayer_->invokeMethod(&Debayer::stop, + ConnectionTypeQueued); + ispWorkerThread_.exit(); ispWorkerThread_.wait();