From patchwork Mon Jul 6 11:01:13 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: 27237 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 34EFDC330A for ; Mon, 6 Jul 2026 11:01:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DAB8A66011; Mon, 6 Jul 2026 13:01:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HZUdKRII"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EC9F0658E0 for ; Mon, 6 Jul 2026 13:01:30 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-47122683cf3so1815195f8f.0 for ; Mon, 06 Jul 2026 04:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783335690; x=1783940490; 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=uBLEZqkxgji7+B1U/JPw5brX2uATQx0vKBZCMrMOBGs=; b=HZUdKRIItczHCCLrn7Oh4qeqA+2Psr6DleF32N7blErLatYL0CvYGtLPlGZkQbEUI7 MJYz/vOZokVUeBb4Xdl5pHrK+UXQ8TbFf/I2cL9wl/+1OLgrpH3+EBggLlFZYKiU3KFj Qbz9brXzZ8AzTIRFM+uIlyUYUlwtUqw8N+92i/vZWdOT182DVTaxkAx1Uv3OSZVxU0j/ SN/8himxuEbMxY8xeok3AJxkANbf2KFkTifG3lOZwLyXNJverIKeoGZJIO4c2oBj8ZHr 0/DuM7P0sbGzuQJB/0nZScOkVfW7LIjpDhaiGRYqaQeFo9utv0ue5XkDZ5IKalLwxKAy LZEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783335690; x=1783940490; 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=uBLEZqkxgji7+B1U/JPw5brX2uATQx0vKBZCMrMOBGs=; b=WE89gX4sxcVXHhElwk+5I5jDKmwamF8IfvpjS36odlZZtYWAHKSEDTs5l+sAb3eIya KZUYnzNDq/phHoQprm5iVuQTDqa4rH690iKanxYrYm953MfQsMnTnWHIE4EyVZHxVkYY Q2Fc6MmADFRhwJ5sNZhyAV16aPuDMbGIsY7dO7rtmh0/ENi0pDP37sZCq56w20Nyi8gx HgmiAQuzEjR0WAk5wIJUfskLx7xfCkxzBmLOoml2AzfvDmdTbWsNibi6NQrMz407/Hca BswsudAQkWURQ34/mABgfCgpQFaZEygSdbm3xe+8VtuvIiqvVmFhCrRjhwJSUmPBQlNk ItHQ== X-Gm-Message-State: AOJu0Yzm0ejGq5uQpeQwaP13DpPhQ7vPF1YBRo8xAjsgTErnZFjA3/5b D9OJM/z5LsMz88vxKhDGX7rerQNpPrfCOKl3QF/CSaAcInTFL/NuZExUR5WsdrAkkF8fvUCZk3f mzs5V X-Gm-Gg: AfdE7ckKffweyBLHehl4+aSU79EvJJbJu6y9DOyiWaREA8v31P8xXcxpxjqIJ5BnOeS vFtSYmxqtvrV29H+/ouApj4gVHPw2OsTsXnPi3OlNq3zX3aveCCwCws+et4WEXs22OfbgBB6qTN 2hO1/EXYIVRBBGoA/Mo85ST4Ck/0GygEFMU3VHThzmd2qwEGrRO8coFb1KxXPDZ6Da3+zT7VROG IPuWxaXzeL5+OgHFF08ac6cNWfX6gJ5g8vUKLXOhKT8ngyu/KrOy/l4nRiUb2B88ohSL2lUP2CS xLAGimPKfc3NGQHTSzxRxDEiGMCkDi/jmW8JMNXLMJrCv7hqrXO/5VqKo8eYUAWFxpxj2P9yQ// 0t/Jv1kEbxitz6nKJtIM+lhlp2I23cVpLepG9dBmvPeavdxaQ1z1q+DnsIk1OaZ2k9x+06Q5QZ7 jJpqjoycc2YUtQUVHeuNjQapOay3Df X-Received: by 2002:a05:6000:2c05:b0:47d:df96:c9f4 with SMTP id ffacd0b85a97d-47ddf96cc37mr6174625f8f.10.1783335690418; Mon, 06 Jul 2026 04:01:30 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0960634sm25190846f8f.26.2026.07.06.04.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 04:01:29 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH v4 0/7] libcamera: software_isp: gpu: Add go faster stripes Date: Mon, 6 Jul 2026 12:01:13 +0100 Message-ID: <20260706110120.2509826-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" v4: - Sizes cache as indicated at configure - Ejects oldest entry on cache miss if cache is full. This allows an external application to keep feeding buffers in. - Reverts to using per image dma-buf flags - this is because again we can have heterogeneous sources of buffers. - Takes Barnabas' suggested SharedFD patch - Robert - Accumulates RB as indicated by Milan Link: https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1700354 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 (6): libcamera: software_isp: debayer_egl: Pass eglImage as parameter to setShaderVariables libcamera: egl: Add new helper attachTextureToFBO libcamera: egl: Add createOutputTexture2D libcamera: egl: Add updateTexture2D libcamera: egl: Add activateBindTexture libcamera: software_isp: debayer_egl: Implement input/output frame caching mechanism Robert Mader (1): libcamera: base: shared_fd: Add hash template Documentation/Doxyfile-common.in | 2 + include/libcamera/base/shared_fd.h | 9 ++ include/libcamera/internal/egl.h | 5 + src/libcamera/egl.cpp | 97 ++++++++++++++--- src/libcamera/software_isp/debayer_egl.cpp | 116 +++++++++++++++------ src/libcamera/software_isp/debayer_egl.h | 15 ++- 6 files changed, 195 insertions(+), 49 deletions(-)