From patchwork Mon Jul 6 11:38:53 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: 27245 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 5AD82C330A for ; Mon, 6 Jul 2026 11:39:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 14F3D6600A; Mon, 6 Jul 2026 13:39:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kRAdH0AH"; 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 94EA065EFF for ; Mon, 6 Jul 2026 13:39:11 +0200 (CEST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-493b7612475so26996255e9.3 for ; Mon, 06 Jul 2026 04:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783337951; x=1783942751; 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=At957s+NLE3W2I757JtLgXtLGAc/5hZFbfrHbc7598k=; b=kRAdH0AHbfG98RDQw8mRv+dOBGSk9FAuUo3N7KnbsB6AjhAr+t/DtfPsUcwbeAoP9l 8BpLSlSmxnC345SYXAuJ35fv8yPpC8r4h1cVz/5q+Z7nSlmv8wu6sIVcW9xsnqozA+Uy VsqhtOZP+0pR7rFxjbz/YqU8whBWh5tbczA1KWP7n29e+aJDMiOPyXpQO4oYLwskkO9X geQFSo7600mgDvPkQvF4U6DYxUMRrYzhfO8THxGc4RV/sQPLmWgXIrDVJMYZJwk1/H+7 P+GAvrvScjdoRYkYrZl30vnGidTllSvu+iXo4WIM9yMg/ii7efBiqOPOOOy+9JZXKfw0 Eu5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783337951; x=1783942751; 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=At957s+NLE3W2I757JtLgXtLGAc/5hZFbfrHbc7598k=; b=NNFetiSU3b0dgdxqPJDii+XH+lqxJYfhr8JJfOLGO8wODJ8kI8djJk/eca8f3nPNm+ fj7MsGNdkredcVTMzF1Xhsmp761TM7KIPTFCj7vIq3wqcUeVRiKMM0oFff/MY66/7vbo Lh2Eut5ujb0LfOfVO8nUOc7LAaOdW25zkn89VqGjtebhmzyV7GNAOf2H4Dc/03c60zFJ x+biOv+36GeL4JsGQa+Pzt/jEBAW1vQ8EVB6Gym/jxcT6Pe8b/kDG24wgTNllFlXCpql /irKAQNMHpyVO+Cdty+NrQMM/X8+rtgTTa9pvgWyHev/5g3JqMne9q8sAXWO9HOB/R7q O2hw== X-Gm-Message-State: AOJu0YyicvH/Ce7fjOVUgCtsCi9H6NZlrbKL7gCAyQZWcBPtsd4P4WXo gg4TJeCKFEI85ZJtFt5/Ty4nisFlWYQUktJIkl0gBa+/aKFbdUjOvCI+3/9P9gYWQ48iDDy76M4 1jqmg X-Gm-Gg: AfdE7ckNq4FfrqpiO4OAokFcO7JmHKEx5LKn+SisMGl6nfYLfvFIcD0rpdgBOAVHiOn 3heVfos6UsOUp6CeJf0RSz/VDdkEWguceO5hyQVeCwvbDMH8MTahH+5gSRVrLb1F2oq06lH8zEZ orPeTTgPsMgv8cVDjJ6++HEcdhbZJgzX3jDiEvZTQBwUeXonYm7Z5VmGJZJ317EUddkN4MDUjgP 0NNwz/znFtZOrGwyZaS5jE55/4/Rx6KmyRmAcrqnaPN1AaKfDNDAVsVrxkBX3NU+1/MWXJqslcX INSeFK+ygmjrpy7idwoATWlUk+avOSK65P82Xmniv5WddMHOxMsHpQy5rT/mUfvCpqUbrQRjL2d ughZ/P/GWVJNcj3Xs7KIPILXM2bBkP984BqXc+KXaojcz2IvRxQ8gk9tpiwNm4eHgI2R1AQOzZA 3D1gjED6CiKDP1INtA4N7OyM7qY5m1 X-Received: by 2002:a05:6000:601:b0:475:f0f0:9ef2 with SMTP id ffacd0b85a97d-47aaee4d0abmr11638369f8f.55.1783337951079; Mon, 06 Jul 2026 04:39:11 -0700 (PDT) Received: from inspiron14p-linux ([109.77.44.220]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1e6ccsm24796084f8f.5.2026.07.06.04.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 04:39:10 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH v5 0/7] libcamera: software_isp: gpu: Add go faster stripes Date: Mon, 6 Jul 2026 12:38:53 +0100 Message-ID: <20260706113900.2530549-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" v5: - use activateBindTexture in createTexture2D - Robert Link: https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1700395 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 activateBindTexture libcamera: egl: Add updateTexture2D 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 | 96 ++++++++++++++--- src/libcamera/software_isp/debayer_egl.cpp | 116 +++++++++++++++------ src/libcamera/software_isp/debayer_egl.h | 15 ++- 6 files changed, 194 insertions(+), 49 deletions(-)