From patchwork Fri Jun 26 11:33:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 27047 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 99E69C3264 for ; Fri, 26 Jun 2026 11:33:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A25F965902; Fri, 26 Jun 2026 13:33:38 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xEdagFb0"; dkim-atps=neutral Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E6D2658F2 for ; Fri, 26 Jun 2026 13:33:37 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4926ee9e8d9so1531305e9.0 for ; Fri, 26 Jun 2026 04:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782473616; x=1783078416; 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=K9wbGybkHaPzFzh2Kky11WyMtizoAJUwZldC+Xz9A2U=; b=xEdagFb0XTv/CUGPhPiYvlw6IaZKsjlulk06RqadTq2P+WEzwoS7LbO3RSKoscsNF/ s+qATVGCQRtJAE+za3TQeUe4Qihj2Z3TzaR6ijvoiaZS2eLP/20Rkpf6PQF5uujA2DPw vwuHhZXfRwAu1VSszwhlL5Ogh/Ix57ESb+7J8C7oxugKx0iBzngKoRf9JDYMQ+TaHXNM U4gnvx93IvPQEA6u5NMG3Kgige441vDAg9gz3ZmNeiU1XU7hy4AhS53qcHiUlkgsODEm DYf8mL90knkFiDGjPwvNaazfgACLWtUwJCAfZGcKvA1ziCyKTjDwMMiPGAuVItjR7jrm RTpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473616; x=1783078416; 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=K9wbGybkHaPzFzh2Kky11WyMtizoAJUwZldC+Xz9A2U=; b=N1dYda5SAGR4h17DgzEYYE9aYSqmjhsOAuj627TZx9WLNDgXhzvOcdWtbV4MGwFnIw Qfny58vlfdplXcOaupwMPMcrg/3VXPzbN6lhr5qNS4QsDaE0FH2dRP5/3jjsrGHeJYn6 r99tAeDmYqYZbhKSV2nLG5WMVeZg9IVEFYaIVBsAunBGe0qoAicZ+4Y+WXZ1l28UsfCk UIWWBBMLDHaPpMpFpSuQexhT+lQ3UAG4bY6RiFQU+Fx1WffbI3QWnS2SWc/H92/geJnx j4KGuyrE8Id1msU61faD7UoKyTPvmwDLZdBO4Dd6IbiQ6RBFVQx5lK0gmimzgiOiy5r/ 7qiQ== X-Gm-Message-State: AOJu0Yy7wp5Rf5VbXhc+lhpP0R1eYpEsFms8yFlZnLBQQr5XNDdFU0zM 8t0nmpi9TbujYqgj6kGKUpc/16UGYY62Tev3J49PXAzko5G15BWe76FqcYuD8a9IefvdHK/o45H PZQMtWM4= X-Gm-Gg: AfdE7cnidH+p7zn5+wtgi8sY9MJPTaeJ9Kv2BPtBHPqzioI1NjhcN1fVmGzi1Hr/lwf F0xUKbo6TODIG3vyKiMOC7gwr7thC+Ees/vxAueiD+MJtZqsTRRuhy2Rr1TNT98BNk28M9GYyMn XDwYNk3abMYBkRNzSIIdZin5PHxFR3d58UPn4ufjKUiOkJagE1JQ5TQ7jWNaBeNKcEYxJOC9sCk CSq619SIl6Z5dPxn84yJ2BInmtHw3NsFxmEnQE6G/tSIeONb4bSbkbZs02JAkqXpqcs/ps4g9TI hjDPspMIZFwPLFdE446u7cQXhL+Y/WcPMa3jtA0598l3n7hbjPlKyvEuXJ7NezgthxHT/s2JQKk O3R9w6uRRMCUuGOKiW0hL3g7hKqshKHrQ8G0sqWlTKj1twv7G0kX7JrtnXycLXWwvlhfb869XlF FOHdJeKrJuhA2zvub1nKm8YYOLCw== X-Received: by 2002:a05:600c:e54a:20b0:492:3fb5:3a17 with SMTP id 5b1f17b1804b1-492663f5bc7mr59183395e9.2.1782473616517; Fri, 26 Jun 2026 04:33:36 -0700 (PDT) Received: from inspiron14p-linux ([109.76.78.98]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49268fe31b0sm79265985e9.4.2026.06.26.04.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:33:35 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH v3 0/8] libcamera: software_isp: gpu: Add go faster stripes Date: Fri, 26 Jun 2026 12:33:17 +0100 Message-ID: <20260626113325.3218045-1-bryan.odonoghue@linaro.org> 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" v3: - Fixes a missing switch default from libcamera ci loop - bod v2: - Reverts to debayer_egl specific caching mechanism - Laurent - Pivots on dmabuf handle as key for cache. dmabuf handle must be unique between start() and stop() for eglCreateImageKHR to work - Barnabas - Ensures sizeof cache doesn't exceed the number of expected buffers as discovered during configure() - Barnabas - Drops GL_16F patch - Robert - Drops the "input" name from createInputTexture2D() - Robert - Adds RB as specified by Robert v1: Following on from Robert Mader's ask to bring forward GPUISP multi-pass cache operations to mainline first, I've done some work to enable that. This series implements an input/output texture caching scheme which results in an overall absolute 4.5 millisecond - roughly improvement in performance per processed frame. This is a bit of an odd result as I was expecting to shave a particular % off of each frame in the order of 20% or so. My best guess is that particular paths we are optimising here are around texture generation and these are "fixed costs" on the CPU side. One very welcome outcome of this series is genuine zero-copy on dma-buf paths we can support it on i.e. on paths where the CSI2 and GPU strides agree. The numbers cited in my example are for non dma-buf handle upload and dma-buf handle render-to-texture on the output so, in fact I'd expect to see a much larger improvement on systems where dma-buf handle is used on both paths. As it is on my test reference systems I have a 50% improvement per frame for one system, a 20% improvement on another system or we could view it as a fixed 4.5 millisecond improvement on both. I implemented the cache around V4L2BufferCache as per Barnabas' suggestion, including a fixed cache size. Bryan O'Donoghue (8): libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables libcamera: software_isp: debayer_egl: Flag dmabuf use once per session not for every frame libcamera: egl: Add new helper attachTextureToFBO libcamera: egl: Add createOutputTexture2D libcamera: egl: Add updateTexture2D libcamera: egl: Add activateBindTexture libcamera: egl: Drop dmabuf_import_failed_ libcamera: software_isp: debayer_egl: Implement input/output frame caching mechanism include/libcamera/internal/egl.h | 6 +- src/libcamera/egl.cpp | 115 +++++++++++++++++---- src/libcamera/software_isp/debayer_egl.cpp | 98 +++++++++++++----- src/libcamera/software_isp/debayer_egl.h | 14 ++- 4 files changed, 185 insertions(+), 48 deletions(-)