From patchwork Wed Jun 24 08:58:39 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: 27026 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 B9411C3306 for ; Wed, 24 Jun 2026 08:59:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3CF8565883; Wed, 24 Jun 2026 10:59:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YXCEWsgw"; dkim-atps=neutral Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EE01565870 for ; Wed, 24 Jun 2026 10:58:59 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-490b613a17bso7035105e9.3 for ; Wed, 24 Jun 2026 01:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782291539; x=1782896339; 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=9gFcpaqvSRqNN016whMBLoM9egWOmGYEXP5jdt0ONMk=; b=YXCEWsgwfgoWDh8OuNyltb/6h4J2taBwrwR255h1mqBX2qHtSx1o+xxoq5q/sD2IoH rppZPEZdZf47VWYVmFjPNV8j0q7xLNHnBBTZpE/2AZ/7Ya6dR3SpJfI6Mo6ScApt5MaS 7UdzMVPpNVuLnelYwucnKkORNsEZTq73jGpJm0YbM1YRl6z8+Z0KAHEIaZEZMzUoJ1Nj YrxmQAhQN85BJyb4wWwsKcGea3NtjvRI5sQ7AWSoZGyPJTtCfj5h03fLPnNRv2wmb9K0 +IKv31a//y44jqEW7KqkKDRZtvr33rJEslBLuuEtCqoH9zapXd0Jz75LpznIaiWHy9hl WfJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782291539; x=1782896339; 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=9gFcpaqvSRqNN016whMBLoM9egWOmGYEXP5jdt0ONMk=; b=YkSpTgJZruxHZI8TOOxk5wO1ahZQHSeqV418jHbmMBdYadyrF/5ADkdH1WeeqqfakO QVRtMuvr3iNdwb2X2vIhWn6/o/K2wlMZczUZXwMU1tM/ILXQiB5oGQ3sDS6EWovx/eHW naAoQ0i9nrFHdbW62QvrMBb5SwbtA1rYDctu3WcgxdiHmoI0wIU/Xw8FuXsqbWRdYKC6 29gfMwglEEeTwFtJkI7RQKHHSCDY9OIS2FAdoIlMtvLoTS3OpBAGz/4fErQTflV8sa+h EePvGoVoeYs0FV5+mt3Rfny0TxElRkcop+VYpuYoD9skzgY3bbpPB+boZ/Nt3S7+4izf jTPg== X-Gm-Message-State: AOJu0YyOERQqkllRyNcP1asXmzFTe4BEz2l9v1u6w+oozZLJR4x3riXG OB+hbqs4leB/h9bnkSkabAzxv7zcAqX9RtxjdmfAAPmpDhijQQoKu5ZAjyd3wSpWeV7WW4C5vpk 5ZrUEg1k= X-Gm-Gg: AfdE7cnCg+hrGY/nbrEj4LqwLEkmbOCKCG1sHbJDaFm/Y0aeS+zG51+TcZEJnpf1jqH 1P6SgJY14kdPo9R8jAP9yd7KI5vr8ootBPbrq/bh7oMv74Wucw32eUYKZfcvJwODrI9kneR8AlL gUWuMyAdhCLtNaWxjWbnQYqz0fnHSv9wZA8SCis7rs386OdD2M/Yij8haCd2ytF26fV7OEBX5J0 i05sr+8BB/Y5c5fzcnBo/Pm+pQ49zrzW/F9WMkZdLdgXFehXe5GlnuNH4BR6wlwDcJYt+gbXWPI 9njc/6E7+qMLgFhOs9k41ytWWLmYhv0CAojTA/ECY94sxuICg6KX6qd8LGrheaN1AaXdVjAEEFz vCyLjzq6opssN/eXM3qnAlTRtbWskfeqdqlQVo+O5qWvrj3qCNIJfWfeAVJHts+1TjFl9wgy/kH yPgF9+sb/aWioUKp2UgxXaIZsYUpT9V1kkaGvfpbQ= X-Received: by 2002:a05:600c:6990:b0:490:b189:212d with SMTP id 5b1f17b1804b1-492490b7ea3mr248052905e9.33.1782291539400; Wed, 24 Jun 2026 01:58:59 -0700 (PDT) Received: from inspiron14p-linux ([109.76.100.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49261063d6esm25128375e9.2.2026.06.24.01.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2026 01:58:58 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 00/10] libcamera: software_isp: gpu: Add go faster stripes Date: Wed, 24 Jun 2026 09:58:39 +0100 Message-ID: <20260624085849.873784-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" 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 (10): libcamera: v4l2_videodevice: Output cache hit as a parameter libcamera: egl: Add new helper attachTextureToFBO libcamera: egl: Extend eGL::createTexture2D to understand floats libcamera: egl: Rename createTexture2D to createInputTexture2D libcamera: egl: Add createOutputTexture2D libcamera: egl: Add updateInputTexture2D libcamera: egl: Add activateBindTexture 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: software_isp: debayer_egl: Implement input/output frame caching mechanism include/libcamera/internal/egl.h | 7 +- include/libcamera/internal/v4l2_videodevice.h | 2 +- src/libcamera/egl.cpp | 126 +++++++++++++++--- src/libcamera/software_isp/debayer_egl.cpp | 119 +++++++++++++---- src/libcamera/software_isp/debayer_egl.h | 16 ++- src/libcamera/v4l2_videodevice.cpp | 9 +- 6 files changed, 228 insertions(+), 51 deletions(-)