From patchwork Wed May 27 08:15:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 26803 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 CFE11C328C for ; Wed, 27 May 2026 08:16:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CB71C62FD3; Wed, 27 May 2026 10:16:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="O0si7BHr"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 78F8262E6A for ; Wed, 27 May 2026 10:16:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1779869762; cv=none; d=zohomail.com; s=zohoarc; b=kgkQv7OM85jrNDiCG55YgOuLoHCA73JBf+T+JSj4vrhQ/ZvjmtxmnX7wJHSpUDWA6Gp/DYT0NfufkrWr/gTik4DYQkrb4BZP9wD4/xGX7QUOwvK6H7pr0+QJHdK1e3qENaFZwCiydf3Nc+5RBzT7eouiwWvB15fRA/luCKyjgdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779869762; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=a0DQTieAVmu11Pz9oL1JfXLjuTfYnzZID9sVkCgyeeg=; b=DvNJjxED5RKNH53xPPLHlj5WC7v8PffzAIl1TYCEoFk/c/+PL7I+l3EuY88P/P/W2zWc7OgXxNxQjWMTmytugk87gaSJ4jSG9ADNMAaiJUzniI44otyPigPjiossQ3YDGz5a9uI1wwabcfmBzJjw7plAykmxoZW2ELZ9cLOsSdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779869762; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=a0DQTieAVmu11Pz9oL1JfXLjuTfYnzZID9sVkCgyeeg=; b=O0si7BHrBJcXho1jZ6PulrwjueJvgLe+FdqvZdBP4c6KFUvQ3Stvibju5uroNuNh jioRohApSMggwI2uYKw/Uf2FRp7QDSV/qWF4x+zQfTuwAnbqDLvsrVMEFKGMcYXAu+E cYk52NcdZPunCMygFyWelnRFgYClSYTVlc5vHuTs= Received: by mx.zohomail.com with SMTPS id 177986976004887.88434092110788; Wed, 27 May 2026 01:16:00 -0700 (PDT) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH v5 0/5] software_isp: Implement DMABuf import for input buffers Date: Wed, 27 May 2026 10:15:29 +0200 Message-ID: <20260527081534.20245-1-robert.mader@collabora.com> X-Mailer: git-send-email 2.54.0 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" From the main commit: In many cases we can import the GPU-ISP input buffer, a dmabuf from v4l2, directly into EGL instead of mapping and uploading - i.e. copying - it. This reduces memory bandwidth and CPU usage and can slightly improve latency. Notes: Previous iterations of these patches have already been tested on various platforms, without known regressions and showing significant improvements. Changes in v5: - Added R-B tags - Made MappedFrameBuffer parameter of SwStatsCpu::processFrame() non-optional, using finishFrame() directly instead where appropriate. - Minor code changes in the last patch to address review feedback and improve readability. No functional changes. Changes in v4: - Split out commit "debayer_egl: Sync output buffer after processing stats" into its own series and rebased this series on top: https://patchwork.libcamera.org/cover/26788/ - Added performance benchmarks - Move dmabuf_import_failed_ variable to eGLImage, ensuring it gets reset. - Added commit to ensure input buffer doesn't get mapped twice. Changes in v3: - Split up changes to createTexture2D() and eGLImage constructor into two commits. - Added field to remember dmabuf import fails - and promote the relevant log to Info. - Reordered and slightly extended commit message for "egl: Demote an error log to debug" - Fixed some CI / linter errors Changes in v2: - Instead of adding parameters to createInputDMABufTexture2D(), remove them from createTexture2D instead. - Use std::optional to make the code easier to understand. - Move error log level change into its own commit. Robert Mader (5): egl: Add GL format parameter to eGLImage constructor egl: Remove some parameters from createTexture2D() egl: eGLImage: Add flag to remember dmabuf import fails libcamera: swstats_cpu: Take MappedFrameBuffer in processFrame() debayer_egl: Implement dmabuf import for input buffers include/libcamera/internal/egl.h | 9 ++- .../internal/software_isp/swstats_cpu.h | 2 +- src/libcamera/egl.cpp | 32 +++++++-- src/libcamera/software_isp/debayer_egl.cpp | 68 +++++++++++++------ src/libcamera/software_isp/debayer_egl.h | 2 +- src/libcamera/software_isp/swstats_cpu.cpp | 11 +-- 6 files changed, 82 insertions(+), 42 deletions(-)