From patchwork Mon Mar 23 20:10:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gianfranco Mariotti X-Patchwork-Id: 26319 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 33E94BD87C for ; Mon, 23 Mar 2026 20:12:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 71D9962777; Mon, 23 Mar 2026 21:12:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cbEbr4Ym"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5833662647 for ; Mon, 23 Mar 2026 21:12:55 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-486fb112c09so28977735e9.1 for ; Mon, 23 Mar 2026 13:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774296774; x=1774901574; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Zmi8UdektOiNbhiZay6d0nDmMc2ruVGEzCqpcNOwBWw=; b=cbEbr4Ym1xpMqZCFAYacenquYaZd3VOQZhVevbLxdkJsjufFDs7xbYpVKkUgqjVQjq yRGxWy6Dfsel1IGR/iVoEec+gcThCTF5pR2YDjyjINsmT0GhIqsgC+YxRynp9+8pjegb ovy0tI/D1oua/EPtzG+HZf/TMRWDe1eKoqklghjFmDVdRpfr8NBoKO8E0yfJ8CuiZ3w5 WG74W01L6wuzaHQidR9HIqwbjC+cRn0/lcFR3RF1aUhyrLIZwL79hOlGggRClX5NbUhq VR1D8Yqf69FViFBAgsLMeeOjllstmO8ZhW5oZgCWHQj+BZL3NwobiS3+axhw3yjVR/1b bZcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774296774; x=1774901574; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Zmi8UdektOiNbhiZay6d0nDmMc2ruVGEzCqpcNOwBWw=; b=lIXR3jtTuT5qUyC5DI0Mdg8ra1nOssTQwEMS4l9R8b1Y6MV7DZB0C3RbGmzYG4zBF8 Pq2UI4WDuQ44mVeEdOke1OH5IsOiqnEkvA5XzrB6Xow7Pz4z7pztNm8F+ZzSo1xlvhpr ksOWF0AJ11DbsjMoVjW+uXti3/xWJH/jdnXAVgqzJciQJoy/ikZleyBbL/MRwG92F8Ku QGVvMhaTNbJHHOJnCjh/GKGmJLby+kT4RqX2HE2rCv9FkRqW/sS6KNKVKE61FLri6QhW itm/lCcA6QOKcqtepSHFcBAwHkI0XjvxC8y3XDRq+IV/iwtYiK5aKNrPhARyOhu4YyBh CQ9g== X-Gm-Message-State: AOJu0YzOafAdy5KLT6Wmn1BP3KPd4iO6HD5BrsC4hYo8UpSQ2xC5EMeH 3lMPQKwivK+B3Sn+aVu4rsOvdZM7l92+4orUJJAN7dNxScF1S8QC/AlpLC3i X-Gm-Gg: ATEYQzxiCgEccM8tDHCEk63macBumdG1Mv8kKvTRk4Vi29sjRgzBqqvd7UNO4ofz+89 fz9Uix9wl6rbUTAEYdWs/HJjtbbQMgkdUBPmNsKmpsVnwDEW5faDlHvuaLwH+pGDhoPND8Bw80s 2EfJbucfKKbBp9yNosE9keJikqg0DEu3zyWed3+4+Nhiw6kQpag7UESjTP3YHt+Qb0xIm1cAmUE xTQNN0rFYbIJRLAu36y87SerAleM3gZDmKjobsic+JgcfyppiuPWTvsw+cPWNLfvRJqrKiPAO8K qeK4beBD56n+HHPu9syZTjcLgYk9GVUMO9/kPkj+Ioz3/Q9qjgSunXN70DFGkgKhRm6DWRRqP5g TX9ONB1LgJ66IroqumWsQl+8UgFKJbKiDXr9OojHNtSY1GamTx4N79lJk5UhR/k+xOkEQG2S5lz tEjID6uX/I9wXD93iXxhY8+AwpxLV0jIYlTQ== X-Received: by 2002:a05:600c:3b07:b0:485:419c:4eab with SMTP id 5b1f17b1804b1-486fedab40emr183511675e9.6.1774296774274; Mon, 23 Mar 2026 13:12:54 -0700 (PDT) Received: from h7015t.. ([193.207.126.104]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486fe032a55sm591533925e9.7.2026.03.23.13.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 13:12:53 -0700 (PDT) From: Gianfranco Mariotti To: libcamera-devel@lists.libcamera.org Cc: Gianfranco Mariotti Subject: [PATCH v2] libcamera: software_isp: debayer_egl: Teardown the output texture Date: Mon, 23 Mar 2026 21:10:17 +0100 Message-Id: <20260323201015.4480-1-gianfranco.mariotti94@gmail.com> X-Mailer: git-send-email 2.34.1 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" Destroy the EGL image associated with the output DMA-BUF texture after processing the frame. Without this change memory can be seen building up while running a gstreamer pipeline using GPUISP, and on end of available memory the stream freezes and the error message `eglCreateImageKHR fail` is reported repeatedly. Signed-off-by: Gianfranco Mariotti Tested-by: Barnabás Pőcze # ThinkPad X1 Yoga Gen 7 + ov2740 Reviewed-by: Barnabás Pőcze --- Changes in v2: - use utils::scope_exit to teardown src/libcamera/software_isp/debayer_egl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 8147eca1..14ea98eb 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -506,6 +506,7 @@ int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParam /* Generate the output render framebuffer as render to texture */ egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd); + utils::scope_exit outImageGuard([&] { egl_.destroyDMABufTexture(*eglImageBayerOut_); }); setShaderVariableValues(params); glViewport(0, 0, width_, height_);