{"id":27253,"url":"https://patchwork.libcamera.org/api/covers/27253/?format=json","web_url":"https://patchwork.libcamera.org/cover/27253/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260706222245.247396-1-bryan.odonoghue@linaro.org>","date":"2026-07-06T22:22:39","name":"[v6,0/6] libcamera: software_isp: gpu: Add go faster stripes","submitter":{"id":175,"url":"https://patchwork.libcamera.org/api/people/175/?format=json","name":"Bryan O'Donoghue","email":"bryan.odonoghue@linaro.org"},"mbox":"https://patchwork.libcamera.org/cover/27253/mbox/","series":[{"id":6042,"url":"https://patchwork.libcamera.org/api/series/6042/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6042","date":"2026-07-06T22:22:39","name":"libcamera: software_isp: gpu: Add go faster stripes","version":6,"mbox":"https://patchwork.libcamera.org/series/6042/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/27253/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6D1CBC3308\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2026 22:22:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B32E6605A;\n\tTue,  7 Jul 2026 00:22:58 +0200 (CEST)","from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7B85965FBE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jul 2026 00:22:56 +0200 (CEST)","by mail-wr1-x42c.google.com with SMTP id\n\tffacd0b85a97d-47640541585so2175480f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Jul 2026 15:22:56 -0700 (PDT)","from inspiron14p-linux ([109.77.44.220])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-47aa039ad21sm27916413f8f.20.2026.07.06.15.22.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 06 Jul 2026 15:22:55 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"Kn0nAaq7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1783376576; x=1783981376;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=eR/J/KjMv3FFWydwvAFVCsF7iB7TZfoT6HA7WxELzng=;\n\tb=Kn0nAaq7cIvbc4bUUFGrmHKOP7MAhIN2g0c4nU2xs40ShmJTgsC+rwMaD3BSkYQpM5\n\t0jZrtdrpOjKCiLNGNHkHX1Xm0aedaWpKSumOCfstUWlrEpp73vb+yPtq1ur97+HsEGhS\n\t56Fgxa4U6hFCvlEYh4Bbr6xE9WOg4hbbXpn6jAfoA9jiypB2xJXy/gFCQVH4MExlDmH1\n\tUjfAF7wpPnevx1iYA/5a+mQZwIoVzgs7AuDE8K8dUG2O36zFpSHhyIQ6iva41qJcX0cx\n\tV9KdeL91A8l9H2VB4pkzvyO5/5Xp8SZgiVQc1HiJkuhOwXM9PGoQGV925k5L3NPmjO+T\n\tHLGQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1783376576; x=1783981376;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=eR/J/KjMv3FFWydwvAFVCsF7iB7TZfoT6HA7WxELzng=;\n\tb=mkLSEAH/awN5b0lGgqvQ75NiO6oVcVi5GVVQQc2YYHkiPKU+poDP0ATFrG58rxhW/6\n\tOl5yTZLIiy1XQasnVx5uh1YUJbdZA+DCF4GX9JQWpObLghTRGgLtPrx30G0jSMQoaJw5\n\tY6XvjICIqlFw4ikY1820nhnHCi9Z+ETs0MlNDkXsYfI1a1c9ancZKP4nMbRPVMIlBvn5\n\tveaOghmVo2HaaujHNSo7YDqjK3uQnioEPGpCVU/d+v0U4K1q4vi2nc7AgsXA+6xEYKHA\n\toVN5yrXIMSbRExSZ4o9YAW7ViqhzdNRJAzA3ZCKdJwz/ae0cTYfsOeMD1lc1OkKrxMwt\n\tYukA==","X-Gm-Message-State":"AOJu0Yy96+60q/kIFWnToN1mdvBjw6LstK9WW+HWhoLZuICzpQ5FV0wc\n\t6nygYLU2YJDXkXN/11OFlxmnx2Ebpv07TpeyO/hc1WR7r44vG2qT1AVW/3MAcJbvKAKAJjpgbWJ\n\tOhrk1","X-Gm-Gg":"AfdE7clc9Z8KlyT6iUMusB5ssU41v71ACTBNrosA95xKrcJhaICIk03ohLHj7Ie5Dsf\n\tv3STPWI2k/EF7a3Hob5IdW/pCG+WbP9nZzE/RzCLUOjQ/9lH3k3WZVCE3aperLmBc4zaCXWJA2J\n\tu1P482i2KW6wIbZC6NkOMBk0fCXek6PomP+anl9HpZD4eZhpSdX/BYpl07eSuRlICGn88Pr9n0q\n\t8CyO6r/abCNrsT2nZdr/EcrnDlX/bHcbzWiqujfOu0vyUJK39npe4Ypo9dTOdPb4SUws/BGSWhn\n\tRNfuPdnNxNrFc2Pa5cAdE68AqprlhTq495cpAK9IhTEilEShv0giChbyuNyjWqwWwJLsqPy/czD\n\tYbnzM9QGHFFh2/41aBxVHygjbpAJHKhLyk3wmmdZfuoGTXQdqLAk3E3UavHEQzKAaEbFKB7gjlE\n\trUogHnw14TKC3Q5yxYZ+j0egHNRSzg","X-Received":"by 2002:a5d:6543:0:b0:475:f0f0:9efc with SMTP id\n\tffacd0b85a97d-47de66cb46bmr1923536f8f.51.1783376575787; \n\tMon, 06 Jul 2026 15:22:55 -0700 (PDT)","From":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"bryan.odonoghue@linaro.org,\n\tpavel@ucw.cz","Subject":"[PATCH v6 0/6] libcamera: software_isp: gpu: Add go faster stripes","Date":"Mon,  6 Jul 2026 23:22:39 +0100","Message-ID":"<20260706222245.247396-1-bryan.odonoghue@linaro.org>","X-Mailer":"git-send-email 2.54.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"v6:\n- Uses std::deque<std::pair<SharedFD, std::unique_ptr<eGLImage>>>; - Robert\n- Drops SharedFD patch - Robert\n\nLink: https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1700783\n\nv5:\n- use activateBindTexture in createTexture2D - Robert\n\nLink: https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1700395\n\nv4:\n- Sizes cache as indicated at configure\n- Ejects oldest entry on cache miss if cache is full. This allows an external\n  application to keep feeding buffers in.\n- Reverts to using per image dma-buf flags - this is because again we can\n  have heterogeneous sources of buffers.\n- Takes Barnabas' suggested SharedFD patch - Robert\n- Accumulates RB as indicated by Milan\n\nLink: https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1700354\n\nv3:\n- Fixes a missing switch default from libcamera ci loop - bod\n\nv2:\n- Reverts to debayer_egl specific caching mechanism - Laurent\n- Pivots on dmabuf handle as key for cache. dmabuf handle\n  must be unique between start() and stop() for eglCreateImageKHR to work - Barnabas\n- Ensures sizeof cache doesn't exceed the number of expected buffers\n  as discovered during configure() - Barnabas\n- Drops GL_16F patch - Robert\n- Drops the \"input\" name from createInputTexture2D() - Robert\n- Adds RB as specified by Robert\n\nv1:\nFollowing on from Robert Mader's ask to bring forward GPUISP multi-pass\ncache operations to mainline first, I've done some work to enable that.\n\nThis series implements an input/output texture caching scheme which results\nin an overall absolute 4.5 millisecond - roughly improvement in performance\nper processed frame. This is a bit of an odd result as I was expecting to\nshave a particular % off of each frame in the order of 20% or so. My best\nguess is that particular paths we are optimising here are around texture\ngeneration and these are \"fixed costs\" on the CPU side.\n\nOne very welcome outcome of this series is genuine zero-copy on dma-buf\npaths we can support it on i.e. on paths where the CSI2 and GPU strides\nagree.\n\nThe numbers cited in my example are for non dma-buf handle upload and\ndma-buf handle render-to-texture on the output so, in fact I'd expect to\nsee a much larger improvement on systems where dma-buf handle is used on\nboth paths.\n\nAs it is on my test reference systems I have a 50% improvement per frame\nfor one system, a 20% improvement on another system or we could view it as\na fixed 4.5 millisecond improvement on both.\n\nI implemented the cache around V4L2BufferCache as per Barnabas' suggestion,\nincluding a fixed cache size.\n\nBryan O'Donoghue (6):\n  libcamera: software_isp: debayer_egl: Pass eglImage as parameter to\n    setShaderVariables\n  libcamera: egl: Add new helper attachTextureToFBO\n  libcamera: egl: Add createOutputTexture2D\n  libcamera: egl: Add activateBindTexture\n  libcamera: egl: Add updateTexture2D\n  libcamera: software_isp: debayer_egl: Implement input/output frame\n    caching mechanism\n\n include/libcamera/internal/egl.h           |   5 +\n src/libcamera/egl.cpp                      |  96 ++++++++++++---\n src/libcamera/software_isp/debayer_egl.cpp | 129 ++++++++++++++++-----\n src/libcamera/software_isp/debayer_egl.h   |  13 ++-\n 4 files changed, 192 insertions(+), 51 deletions(-)"}