Patch Detail
Show a patch.
GET /api/1.1/patches/27247/?format=api
{ "id": 27247, "url": "https://patchwork.libcamera.org/api/1.1/patches/27247/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27247/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260706113900.2530549-3-bryan.odonoghue@linaro.org>", "date": "2026-07-06T11:38:55", "name": "[v5,2/7] libcamera: egl: Add new helper attachTextureToFBO", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "ab7e7374ad9f125c072ddf3e4a2bd1cd1cfd2f4e", "submitter": { "id": 175, "url": "https://patchwork.libcamera.org/api/1.1/people/175/?format=api", "name": "Bryan O'Donoghue", "email": "bryan.odonoghue@linaro.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27247/mbox/", "series": [ { "id": 6041, "url": "https://patchwork.libcamera.org/api/1.1/series/6041/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6041", "date": "2026-07-06T11:38:53", "name": "libcamera: software_isp: gpu: Add go faster stripes", "version": 5, "mbox": "https://patchwork.libcamera.org/series/6041/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27247/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27247/checks/", "tags": {}, "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 95A83C330A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 6 Jul 2026 11:39:17 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4EDAA66023;\n\tMon, 6 Jul 2026 13:39:17 +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 60F4066030\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 6 Jul 2026 13:39:13 +0200 (CEST)", "by mail-wr1-x42c.google.com with SMTP id\n\tffacd0b85a97d-47c2b362ee2so1523466f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Jul 2026 04:39:13 -0700 (PDT)", "from inspiron14p-linux ([109.77.44.220])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-47a9de1e6ccsm24796084f8f.5.2026.07.06.04.39.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 06 Jul 2026 04:39:12 -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=\"xGD4BWn7\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1783337953; x=1783942753;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=sCherSufb0on4kaTY2CKoIjTcZ+GTv1qK3dt1yZ0ysg=;\n\tb=xGD4BWn7VEAW5mipZlXFi2fLOmqB5FZvNIv/5hvhZWx1OcP1SS5+0bkMoEhGkK7jEH\n\tlYYs0nSLhP+3GAVV7x/7XOChxE+YOHOLePhNsv9ME6C0bmy/6EvHUpGTKJmTVVhHhEQ6\n\tzPeQ6BiYRGlgtHYXLGM/C64UAapU49aW6DNiEAUh79Vw1L45r58J5RyDbU1w36Owj8dC\n\tv6tPG+9CJ17saLEZkK/ESrWc98a8FXHLQp8kSmNyB5D5JmsIkaYmpJR469fiXeQXBeTD\n\tMvYHTK5N1z9VQJVaY1uKGeHeDFkGqcynOEgSHsv63G2rJrS204WoJY224o7z75Z0M2zz\n\t+FTQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1783337953; x=1783942753;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=sCherSufb0on4kaTY2CKoIjTcZ+GTv1qK3dt1yZ0ysg=;\n\tb=CRk4OHs/Btlrh7wuIz4QFTokhFeqcXY/dYJ44HfHhPr50QyGFsVkJ7vfAbMMc0QlKZ\n\tV5gwu+o3K5SJOEy3wuPQSvuY2vPeDA/+KXn7Cqs80upbtllt+JcQWgjzF1RzV0Zu5fNd\n\tCSqMEVko/i3R4kbXuBTwdTLfPfPs2DnhiLK5QwSDRBIdeI25YmNtk/pfH30ZtqVcnKLU\n\tb32VMK+c0sB5bsu+X0O1fioitjHC5+Kmo9uS6TjIdWnsuo0+hpC+zE2lIN0Zz7jxWa2i\n\tRjIjdw0ylcTukNLy7xNyO3m2co7BUbOlNxduLTZeFNadO6rvTTQTQM8xlynP7ALGak/K\n\tkfew==", "X-Gm-Message-State": "AOJu0YwAVCZAjYUtgAxVADsGECU46oxtdgDIqzxdi6c4svlofy84LWCQ\n\tmTDCQja3DXuvJwfrTufLoInwZQHvLO0NRXGV/BRyVEjDTvdP8Y92pRRhpNX2iO8AXVui8wXTA2T\n\tujB83", "X-Gm-Gg": "AfdE7cmt5piq/4IbdVg6sg+kz7U/a9fBUQT3R5aVdzq1YkWcr15bdOSA+KcK0AyZQDg\n\tIdw77C3mVRAwa6u56Jn70tUyM51Ic/2k/OSRzsXFWXTkE3sxPH6S5k8zHIeFQxBmx0yi1KeL6By\n\t9Ef3uojm5ZUc/ePzVLHqPyUgDmLftKX9NL/1lMMHPzmGWo7zNwz9gI/cvo5R4D2+Pf0tfc7+WQ3\n\tbflOghgVzhh4PLQOd+YS1t3jM31uyaOyD7fhqtSs4aFIBILd8MZpbvA31H7L0IrqudVdH7jxgu+\n\tC756Sjil8ldwhzYtPn286Ca4USIcqvZhCqWOyM6hwq8NI4CQog6vF74kUFq0l6e/E//MNogNN1D\n\tk9lYMuscZ8RkEBUzZcU1sLmzgWL3A3At17N5oOMGs23P0Xy68Ofur+jd/KZ2ljUrsrnLVirRxA9\n\t8xvVpUNjNCseBPYQpHH/RHUG3xBFZo", "X-Received": "by 2002:a05:6000:184d:b0:47d:ca2:6234 with SMTP id\n\tffacd0b85a97d-47d0ca26431mr7636412f8f.19.1783337952677; \n\tMon, 06 Jul 2026 04:39:12 -0700 (PDT)", "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "bryan.odonoghue@linaro.org, pavel@ucw.cz,\n\tRobert Mader <robert.mader@collabora.com>,\n\tMilan Zamazal <mzamazal@redhat.com>", "Subject": "[PATCH v5 2/7] libcamera: egl: Add new helper attachTextureToFBO", "Date": "Mon, 6 Jul 2026 12:38:55 +0100", "Message-ID": "<20260706113900.2530549-3-bryan.odonoghue@linaro.org>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260706113900.2530549-1-bryan.odonoghue@linaro.org>", "References": "<20260706113900.2530549-1-bryan.odonoghue@linaro.org>", "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": "This method does what it says on the tin. It attaches a texture to a\nframebuffer object, splitting existing code into a helper function which we\nwill use in subsequent patches.\n\nReviewed-by: Robert Mader <robert.mader@collabora.com>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n include/libcamera/internal/egl.h | 2 ++\n src/libcamera/egl.cpp | 42 +++++++++++++++++++++++---------\n 2 files changed, 32 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\nindex 523a62aa8..085a371f3 100644\n--- a/include/libcamera/internal/egl.h\n+++ b/include/libcamera/internal/egl.h\n@@ -109,6 +109,8 @@ public:\n \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n \tvoid createTexture2D(eGLImage &eglImage, void *data);\n \n+\tint attachTextureToFBO(eGLImage &eglImage);\n+\n \tvoid pushEnv(std::vector<std::string> &shaderEnv, const char *str);\n \tvoid makeCurrent();\n \ndiff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\nindex b5a5dc60b..ed67aca7b 100644\n--- a/src/libcamera/egl.cpp\n+++ b/src/libcamera/egl.cpp\n@@ -112,6 +112,32 @@ void eGL::flushOutput()\n \tglFlush();\n }\n \n+/**\n+ * \\brief Attach a texture to a frame-buffer-object\n+ *\n+ * \\param[in,out] eglImage EGL image containing texture to attach to FBO\n+ *\n+ * Helper function to make attachment of texture to FBO easy to reuse.\n+ *\n+ * \\return 0 on success, or -ENODEV on failure\n+ */\n+int eGL::attachTextureToFBO(eGLImage &eglImage)\n+{\n+\tint ret = 0;\n+\n+\t// Generate a framebuffer from our texture direct to dma-buf handle buffer\n+\tglBindFramebuffer(GL_FRAMEBUFFER, eglImage.fbo_);\n+\tglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, eglImage.texture_, 0);\n+\n+\tGLenum err = glCheckFramebufferStatus(GL_FRAMEBUFFER);\n+\tif (err != GL_FRAMEBUFFER_COMPLETE) {\n+\t\tLOG(eGL, Error) << \"glFrameBufferTexture2D error \" << err;\n+\t\tret = -ENODEV;\n+\t}\n+\n+\treturn ret;\n+}\n+\n /**\n * \\brief Create a DMA-BUF backed 2D texture\n * \\param[in,out] eglImage EGL image to associate with the DMA-BUF\n@@ -127,6 +153,7 @@ void eGL::flushOutput()\n int eGL::createDMABufTexture2D(eGLImage &eglImage, int fd, bool output)\n {\n \tEGLint drm_format;\n+\tint ret = 0;\n \n \tASSERT(tid_ == Thread::currentId());\n \n@@ -186,19 +213,10 @@ int eGL::createDMABufTexture2D(eGLImage &eglImage, int fd, bool output)\n \tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n \tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n \n-\tif (output) {\n-\t\t// Generate a framebuffer from our texture direct to dma-buf handle buffer\n-\t\tglBindFramebuffer(GL_FRAMEBUFFER, eglImage.fbo_);\n-\t\tglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, eglImage.texture_, 0);\n+\tif (output)\n+\t\tret = attachTextureToFBO(eglImage);\n \n-\t\tGLenum err = glCheckFramebufferStatus(GL_FRAMEBUFFER);\n-\t\tif (err != GL_FRAMEBUFFER_COMPLETE) {\n-\t\t\tLOG(eGL, Error) << \"glFrameBufferTexture2D error \" << err;\n-\t\t\treturn -ENODEV;\n-\t\t}\n-\t}\n-\n-\treturn 0;\n+\treturn ret;\n }\n \n /**\n", "prefixes": [ "v5", "2/7" ] }