{"id":27379,"url":"https://patchwork.libcamera.org/api/patches/27379/?format=json","web_url":"https://patchwork.libcamera.org/patch/27379/","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":"<20260720095951.49979-2-mzamazal@redhat.com>","date":"2026-07-20T09:59:45","name":"[RFC,v9,1/6] libcamera: software_isp: egl: Add filter parameter to createTexture2D()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d75a77efe1799d15cc8c33597109c6c1aee267b6","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/27379/mbox/","series":[{"id":6062,"url":"https://patchwork.libcamera.org/api/series/6062/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=6062","date":"2026-07-20T09:59:44","name":"LSC for SoftISP simple pipeline","version":9,"mbox":"https://patchwork.libcamera.org/series/6062/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/27379/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/27379/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 A2C26BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Jul 2026 10:00:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 432C566122;\n\tMon, 20 Jul 2026 12:00:12 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA45566137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Jul 2026 12:00:09 +0200 (CEST)","from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-658-_rtIKrDWPCu3dns5dvZEVw-1;\n\tMon, 20 Jul 2026 06:00:04 -0400","from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 2768B195E90F; Mon, 20 Jul 2026 10:00:02 +0000 (UTC)","from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.33.73])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id E694D30002D6; Mon, 20 Jul 2026 09:59:58 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"GIlB/b4q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1784541609;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=4NbgSXicJ8fdZv812b+IZvsdLkImFs3E9nWaFrHqESA=;\n\tb=GIlB/b4qWnJvvzpXQnB9TCVM+g5iwUR3PC8Y2tkSbVEZR6z8Fh/GlNA9LaVaCwq4tHEgNa\n\tNZkQDQCPTIHhJIjpnRKXeUn9ruUFBuXKKrenKoHV3daae0NG6cxrbu+8KvlIpIJYuSJPZ8\n\t6KsN2MQ0ZZMJQQxw3BFlvFkSyKJ3rIQ=","X-MC-Unique":"_rtIKrDWPCu3dns5dvZEVw-1","X-Mimecast-MFC-AGG-ID":"_rtIKrDWPCu3dns5dvZEVw_1784541602","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Xander Pronk <xander.c.pronk@gmail.com>,\n\tBryan O'Donoghue <bod.linux@nxsw.ie>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tRick ten Wolde <rick_libcamera@wolde.info>,\n\tMilan Zamazal <mzamazal@redhat.com>","Subject":"[RFC PATCH v9 1/6] libcamera: software_isp: egl: Add filter\n\tparameter to createTexture2D()","Date":"Mon, 20 Jul 2026 11:59:45 +0200","Message-ID":"<20260720095951.49979-2-mzamazal@redhat.com>","In-Reply-To":"<20260720095951.49979-1-mzamazal@redhat.com>","References":"<20260720095951.49979-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.4","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"64SvPwKhl1B5VjEeTtnBmSvLPxiUHUxShIQFKbNQvKg_1784541602","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","content-type":"text/plain; charset=\"US-ASCII\"; x-default=true","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":"From: Xander Pronk <xander.c.pronk@gmail.com>\n\nAdd `filter' parameter to createTexture2D() to allow overriding\nthe currently hardcoded GL_NEAREST value.  This is needed for\ngrid-based lens shading interpolation, which is implemented in followup\npatches.\n\nReviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\nCo-developed-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Rick ten Wolde <rick_libcamera@wolde.info>\nSigned-off-by: Xander Pronk <xander.c.pronk@gmail.com>\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n include/libcamera/internal/egl.h           |  2 +-\n src/libcamera/egl.cpp                      | 11 ++++++-----\n src/libcamera/software_isp/debayer_egl.cpp |  2 +-\n 3 files changed, 8 insertions(+), 7 deletions(-)","diff":"diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h\nindex 1e31d490b..9edc28ea4 100644\n--- a/include/libcamera/internal/egl.h\n+++ b/include/libcamera/internal/egl.h\n@@ -107,7 +107,7 @@ public:\n \n \tint createInputDMABufTexture2D(eGLImage &eglImage, int fd);\n \tint createOutputDMABufTexture2D(eGLImage &eglImage, int fd);\n-\tvoid createTexture2D(eGLImage &eglImage, void *data);\n+\tvoid createTexture2D(eGLImage &eglImage, void *data, GLint filter);\n \tvoid updateTexture2D(eGLImage &eglImage, void *data);\n \tvoid createOutputTexture2D(eGLImage &eglImage);\n \ndiff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp\nindex 7ec7a654d..53390f370 100644\n--- a/src/libcamera/egl.cpp\n+++ b/src/libcamera/egl.cpp\n@@ -275,13 +275,14 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd)\n  * \\brief Create a 2D texture from a memory buffer\n  * \\param[in,out] eglImage EGL image to associate with the texture\n  * \\param[in] data Pointer to pixel data, or nullptr for uninitialised texture\n+ * \\param[in] filter GL texture filter setting\n  *\n  * Creates a 2D texture from a CPU-accessible memory buffer. The texture\n- * is configured with nearest filtering and clamp-to-edge wrapping. This\n+ * is configured the specified filtering and clamp-to-edge wrapping. This\n  * is useful for uploading static data like lookup tables or uniform color\n  * matrices to the GPU.\n  */\n-void eGL::createTexture2D(eGLImage &eglImage, void *data)\n+void eGL::createTexture2D(eGLImage &eglImage, void *data, GLint filter)\n {\n \tASSERT(tid_ == Thread::currentId());\n \n@@ -291,8 +292,8 @@ void eGL::createTexture2D(eGLImage &eglImage, void *data)\n \tglTexImage2D(GL_TEXTURE_2D, 0, eglImage.format_, eglImage.width_, eglImage.height_, 0, eglImage.format_, GL_UNSIGNED_BYTE, data);\n \n \t// Nearest filtering\n-\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n-\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n+\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);\n+\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);\n \n \t// Wrap to edge to avoid edge artifacts\n \tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n@@ -369,7 +370,7 @@ void eGL::updateTexture2D(eGLImage &eglImage, void *data)\n  */\n void eGL::createOutputTexture2D(eGLImage &eglImage)\n {\n-\tcreateTexture2D(eglImage, NULL);\n+\tcreateTexture2D(eglImage, NULL, GL_NEAREST);\n \tattachTextureToFBO(eglImage);\n }\n \ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex 02651fe87..7e08cae71 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -549,7 +549,7 @@ eGLImage *DebayerEGL::getCachedInputFrameBuffer(FrameBuffer *input, std::optiona\n \t\treturn nullptr;\n \t}\n \tif (cache_miss)\n-\t\tegl_.createTexture2D(*eglImageIn, inMapped->value().planes()[0].data());\n+\t\tegl_.createTexture2D(*eglImageIn, inMapped->value().planes()[0].data(), GL_NEAREST);\n \telse\n \t\tegl_.updateTexture2D(*eglImageIn, inMapped->value().planes()[0].data());\n \n","prefixes":["RFC","v9","1/6"]}