| Message ID | 20260810105942.1098192-1-barnabas.pocze@ideasonboard.com |
|---|---|
| Headers | show
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 [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D73F3BE080 for <parsemail@patchwork.libcamera.org>; Mon, 10 Aug 2026 10:59:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EB0B1681EB; Mon, 10 Aug 2026 12:59:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="FbPVWXT9"; 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 43434681AC for <libcamera-devel@lists.libcamera.org>; Mon, 10 Aug 2026 12:59:46 +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 2761D12F for <libcamera-devel@lists.libcamera.org>; Mon, 10 Aug 2026 12:58:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1786359512; bh=v5phL1RBxP+VvxqykhZwr65UwZZ4Py/Dmvcb5+/yJyY=; h=From:To:Subject:Date:From; b=FbPVWXT9qs6+o0W1DtU9U310+y5tBaB4NAarFZSpT6Stbv9FO71BZaCpGCjN057aC ljzi6IyV/qjX8cAlKDAlh/QGHSomxjY6qYoye4zgLc286H1Qrjpv6Hglh90nq0Abu2 rVF/HDDbzTa3NZ/U80r6QhHUbqAJwkqIR6I6i+g8= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v2 0/8] libcamera: software_isp: debayer_egl: Remove some leaks Date: Mon, 10 Aug 2026 12:59:34 +0200 Message-ID: <20260810105942.1098192-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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>, <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>, <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> |
| Series |
|
| Related |
show
|
Currently `eGL::initEGLContext()` is called each time the camera is started, so the `EGLContext` is leaked if the camera is started more than once. Furthermore, mesa does not seem to have any thread destructors to clean up the bound context when the thread is stopped. So these are some RFC changes intended to address the above leaks. (As well some other small changes.) The effects can be observed with asan and e.g. $ lc-compliance -f '*CaptureStartStop/StillCapture__8' -c '\_SB_.PC00.LNK1' (which does 3 start-stop sequences) but I have also extended `cam` to be able to repeat the capture sessions, and that very clearly shows a start-stop leak: before: repeat | result 4 | SUMMARY: AddressSanitizer: 8979617 byte(s) leaked in 72738 allocation(s). 8 | SUMMARY: AddressSanitizer: 17536873 byte(s) leaked in 144057 allocation(s). 16 | SUMMARY: AddressSanitizer: 34717529 byte(s) leaked in 286697 allocation(s). 32 | SUMMARY: AddressSanitizer: 69078457 byte(s) leaked in 571977 allocation(s). after: repeat | result 32 | SUMMARY: AddressSanitizer: 487117 byte(s) leaked in 1425 allocation(s). changes in v2: * drop the explicit context un-make and move it into `resetEGLContext()` * assert the appropriate thread after the removal of the explicit make-context call v1: https://patchwork.libcamera.org/cover/27602/ Barnabás Pőcze (8): libcamera: egl: Remove `gl{Use,Delete}Program()` libcamera: egl: Remove `eGL::surface_` libcamera: egl: Do not load `glGetString` dynamically libcamera: egl: Ensure all members are always initialized libcamera: egl: Add `resetEGLContext()` libcamera: software_isp: debayer_egl: Avoid EGL context leaks libcamera: egl: initEGLContext(): Avoid double init libcamera: software_isp: debayer_egl: Remove EGL context switch include/libcamera/internal/egl.h | 24 +++-- src/libcamera/egl.cpp | 102 +++++++++------------ src/libcamera/software_isp/debayer_egl.cpp | 8 +- 3 files changed, 63 insertions(+), 71 deletions(-) -- 2.55.0