From patchwork Mon Aug 10 10:59:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 27728 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 E3D4DBE080 for ; Mon, 10 Aug 2026 10:59:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 99C44681E5; Mon, 10 Aug 2026 12:59:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HWWug15h"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 60E59681AC for ; Mon, 10 Aug 2026 12:59:47 +0200 (CEST) Received: from pb-laptop.local (185.221.141.208.nat.pool.zt.hu [185.221.141.208]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6757812B2; Mon, 10 Aug 2026 12:58:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1786359513; bh=38EagsNVr1wqqvZpAjsOVYqxH8qxGpsgYbBuUr/Hkkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HWWug15hq8Y06CdO7ATkYTX9tzsS7dovHFB873AR0wXP9dADqxf7wspb28wJa8CEh JHNk3O0RfyuV9rct//Qrz7baBvwMD9tLDk5zT1+ummm0OKyv4cTClPzkeZL5FEnngB 3zlV2B0MoSmUY7MU14azE5s6SsFcvEYvuoPJdRCc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [RFC PATCH v2 6/8] libcamera: software_isp: debayer_egl: Avoid EGL context leaks Date: Mon, 10 Aug 2026 12:59:40 +0200 Message-ID: <20260810105942.1098192-7-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260810105942.1098192-1-barnabas.pocze@ideasonboard.com> References: <20260810105942.1098192-1-barnabas.pocze@ideasonboard.com> 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" Currently each `start()` invocation causes a new EGL context to be acquired, and only the last allocation will be properly freed in the `eGL` destructor. To avoid that, call `eGL::resetEGLContext()` in `stop()`. Signed-off-by: Barnabás Pőcze Reviewed-by: Milan Zamazal --- src/libcamera/software_isp/debayer_egl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index ede3be2352..35a5c56321 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -682,6 +682,8 @@ void DebayerEGL::stop() if (programId_) glDeleteProgram(programId_); + + egl_.resetEGLContext(); } SizeRange DebayerEGL::sizes(PixelFormat inputFormat, const Size &inputSize)