Patch Detail
Show a patch.
GET /api/1.1/patches/25963/?format=api
{ "id": 25963, "url": "https://patchwork.libcamera.org/api/1.1/patches/25963/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25963/", "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": "<20260126104256.119697-6-rick.w.ten.wolde@gmail.com>", "date": "2026-01-26T10:42:53", "name": "[5/7] libcamera: software_isp: debayer_egl: Add LSC support", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "356ca5f637e126598b31794eca32048b8b1ebe16", "submitter": { "id": 257, "url": "https://patchwork.libcamera.org/api/1.1/people/257/?format=api", "name": "Rick ten Wolde", "email": "rick.w.ten.wolde@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25963/mbox/", "series": [ { "id": 5739, "url": "https://patchwork.libcamera.org/api/1.1/series/5739/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5739", "date": "2026-01-26T10:42:48", "name": "LSC for SoftISP simple pipeline", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5739/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25963/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25963/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 98C7EC328D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jan 2026 10:48:17 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3711F61FD0;\n\tMon, 26 Jan 2026 11:48:15 +0100 (CET)", "from mail-ej1-x632.google.com (mail-ej1-x632.google.com\n\t[IPv6:2a00:1450:4864:20::632])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2BCD661FC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jan 2026 11:43:07 +0100 (CET)", "by mail-ej1-x632.google.com with SMTP id\n\ta640c23a62f3a-b8845cb5862so655827066b.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jan 2026 02:43:07 -0800 (PST)", "from castortop.wolde.loc (195-240-110-192.fixed.kpn.net.\n\t[195.240.110.192]) by smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-b885b7661f7sm599220366b.54.2026.01.26.02.43.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 26 Jan 2026 02:43:05 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"O++7Y6JV\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20230601; t=1769424186; x=1770028986;\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=s9qGY5xhUN7J9aorua9sfoM5bJq/KrIFPoQOSqH6Ufk=;\n\tb=O++7Y6JViseowHgXOvwc1IlifyiBcQ2/d5mPvwvalLr0pqTUxwM8SFCskCKrJD2jld\n\t5T7OEMCHdbL/yeD2X81iiH9+aT/u0qzXKjspRzkTJ1TACAigGcNEsezPJqqB3onEkzp4\n\t8cpsU2R+ptfe37smCFxFMyTlyNK/8QRz8j/CWOH9HDh7PJTxZ72EQVGvmdP6yFeDdMq8\n\tvEQEMKRM7f2/dc4WGlk4pApAHNlZxNFG5LBNNhmiirGAEjHmGSJf7ZxL9bdpV5H8qr/M\n\tVoIfQImyUnDiQ8sOmAfSByC92hEFhKg36vPC8pydkKUwu3FoJdIDR8FHs1XISf9RVusf\n\tggLw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1769424186; x=1770028986;\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=s9qGY5xhUN7J9aorua9sfoM5bJq/KrIFPoQOSqH6Ufk=;\n\tb=OmZOjiySD+rUDPMgDA3dUEwKTBq82MSkb3K3H8Sp8uGJL8DOJZBZoot3n9lhzGyz1f\n\t4gseVuXGtGC8l8stJa3juRHMW/of0WZjHTbM4RhTttPx3FidsMJYmzNoKNFTisQ8CNxC\n\tGO+Y+KSI4yZXdh/DIhj7MWHmWhQmAvIxHaVoWoR7T/GRtFGZANIWTE74aWAN9kWvAEE4\n\tZhNTMkAedG81H3y8+knIQTGDsHg2mTuEoHSOggz2O8muUaCFdtf6cqIyoSUR4XIaWxrZ\n\tZeW6b8uxD/xp+SFRdjch1m96IJMwhLkZ+3CRhTUB4LkWSCGZSnEfa+jZgeD4/hSf5sLa\n\tqisw==", "X-Gm-Message-State": "AOJu0YyvNFEVrrVYykK6eGy7LKMY6lnqPoAqyLqLXVgr06UgOHkkUF3y\n\tIuqtw5tZSYcOtOSahaYyfc+ak1/lyr2ObIJf7cqOPu3hvfC6lj7GrsoTJFbNlg==", "X-Gm-Gg": "AZuq6aJEjTb48RixPOU132upIyGaGtTRqSuDloZFw8i71s7fHWyvzZU4qP2uYcYkWdS\n\tcK2bj9Nfu3LUNw7k6sQEkS656ViUc9L8MtUQmIhL/peSn3TnP3ISgcNTedTW83GzxXsBtM6sGdm\n\tNVB9JENVcE61vL8Zj3zk8ZGjOVUiu0m61ED5Z0ZJD9P7fhHlKOUy9aVLTZvIE3mQ6dVQR19h8s5\n\t7XhRlkGaam6aIxYZc2nZqklAARwmyJL0ljPZGPEtSkorZ2xU50B3P0LewLpIXakJBBbXSUAD1SV\n\teF/QOBxPXmiifQVTf2GvSuJSrQY1uisHvKp5sh7Ge6/AP3JOmo/iBWKATyjzGyeu4ZbY9VKWIdT\n\tVstYX+UFRC50O9C/Ljwuj/ugvOEDXIsqTtO+FciyTFXxsD9/zFP5N8IwZVx1j+5EOKa/Ie+pHS4\n\tOToP6nYiU0DUDoVqvfdOTB5gaLD+POa++sqwu1kzlKUwEV4MRa4iBq/XjAi/Bx2PA=", "X-Received": "by 2002:a17:907:868e:b0:b87:2f29:2060 with SMTP id\n\ta640c23a62f3a-b8d20d83807mr311882566b.26.1769424186118; \n\tMon, 26 Jan 2026 02:43:06 -0800 (PST)", "From": "Rick ten Wolde <rick.w.ten.wolde@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "xander.c.pronk@gmail.com, derekgielen@outlook.com,\n\t22012540@student.hhs.nl, \n\trick.w.ten.wolde@gmail.com, johannes.goede@oss.qualcomm.com,\n\tRick ten Wolde <rick_libcamera@wolde.info>", "Subject": "[PATCH 5/7] libcamera: software_isp: debayer_egl: Add LSC support", "Date": "Mon, 26 Jan 2026 11:42:53 +0100", "Message-ID": "<20260126104256.119697-6-rick.w.ten.wolde@gmail.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260126104256.119697-1-rick.w.ten.wolde@gmail.com>", "References": "<20260126104256.119697-1-rick.w.ten.wolde@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Mon, 26 Jan 2026 11:48:05 +0100", "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 support for passing the LSC tables from debayerParams to\nthe shaders.\n\nCo-authored-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>\n---\n src/libcamera/software_isp/debayer_egl.cpp | 21 +++++++++++++++++++++\n src/libcamera/software_isp/debayer_egl.h | 9 +++++++++\n 2 files changed, 30 insertions(+)", "diff": "diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex 8e089032..0f36b149 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -111,6 +111,10 @@ int DebayerEGL::getShaderVariableLocations(void)\n \ttextureUniformBayerFirstRed_ = glGetUniformLocation(programId_, \"tex_bayer_first_red\");\n \ttextureUniformProjMatrix_ = glGetUniformLocation(programId_, \"proj_matrix\");\n \n+\ttextureUniformLSCRed_ = glGetUniformLocation(programId_, \"lsc_tex_red\");\n+\ttextureUniformLSCGreen_ = glGetUniformLocation(programId_, \"lsc_tex_green\");\n+\ttextureUniformLSCBlue_ = glGetUniformLocation(programId_, \"lsc_tex_blue\");\n+\n \tLOG(Debayer, Debug) << \"vertexIn \" << attributeVertex_ << \" textureIn \" << attributeTexture_\n \t\t\t << \" tex_y \" << textureUniformBayerDataIn_\n \t\t\t << \" ccm \" << ccmUniformDataIn_\n@@ -140,6 +144,9 @@ int DebayerEGL::initBayerShaders(PixelFormat inputFormat, PixelFormat outputForm\n \t/* Specify GL_OES_EGL_image_external */\n \tegl_.pushEnv(shaderEnv, \"#extension GL_OES_EGL_image_external: enable\");\n \n+\t/* Always use LSC */\n+\tegl_.pushEnv(shaderEnv, \"#define DO_LSC\");\n+\n \t/*\n \t * Tell shaders how to re-order output taking account of how the\n \t * pixels are actually stored by GBM\n@@ -349,6 +356,12 @@ int DebayerEGL::configure(const StreamConfiguration &inputCfg,\n \t */\n \tstats_->setWindow(Rectangle(window_.size()));\n \n+\teglImageLSCLookupRed_ = new eGLImage(20, 20, sizeof(GLubyte), GL_TEXTURE5, 5);\n+\teglImageLSCLookupGreen_ = new eGLImage(20, 20, sizeof(GLubyte), GL_TEXTURE5, 5);\n+\teglImageLSCLookupBlue_ = new eGLImage(20, 20, sizeof(GLubyte), GL_TEXTURE5, 5);\n+\tif (!eglImageLSCLookupRed_ || !eglImageLSCLookupGreen_ || !eglImageLSCLookupBlue_)\n+\t\treturn -ENOMEM;\n+\n \treturn 0;\n }\n \n@@ -488,6 +501,14 @@ void DebayerEGL::setShaderVariableValues(DebayerParams ¶ms)\n \tglUniformMatrix3fv(ccmUniformDataIn_, 1, GL_FALSE, ccm);\n \tLOG(Debayer, Debug) << \" ccmUniformDataIn_ \" << ccmUniformDataIn_ << \" data \" << params.ccm;\n \n+\tegl_.createTexture2D(*eglImageLSCLookupRed_, GL_LUMINANCE, 16, 16, ¶ms.LSC_red, GL_LINEAR);\n+\tegl_.createTexture2D(*eglImageLSCLookupBlue_, GL_LUMINANCE, 16, 16, ¶ms.LSC_green, GL_LINEAR);\n+\tegl_.createTexture2D(*eglImageLSCLookupGreen_, GL_LUMINANCE, 16, 16, ¶ms.LSC_blue, GL_LINEAR);\n+\n+\tglUniform1i(textureUniformLSCRed_, eglImageLSCLookupRed_->texture_unit_uniform_id_);\n+\tglUniform1i(textureUniformLSCGreen_, eglImageLSCLookupGreen_->texture_unit_uniform_id_);\n+\tglUniform1i(textureUniformLSCBlue_, eglImageLSCLookupBlue_->texture_unit_uniform_id_);\n+\n \t/*\n \t * 0 = Red, 1 = Green, 2 = Blue\n \t */\ndiff --git a/src/libcamera/software_isp/debayer_egl.h b/src/libcamera/software_isp/debayer_egl.h\nindex a5033bc6..61feadab 100644\n--- a/src/libcamera/software_isp/debayer_egl.h\n+++ b/src/libcamera/software_isp/debayer_egl.h\n@@ -85,6 +85,11 @@ private:\n \tstd::unique_ptr<eGLImage> eglImageBayerIn_;\n \tstd::unique_ptr<eGLImage> eglImageBayerOut_;\n \n+\t/* Pointer to object representing input texture */\n+\teGLImage *eglImageLSCLookupRed_;\n+\teGLImage *eglImageLSCLookupBlue_;\n+\teGLImage *eglImageLSCLookupGreen_;\n+\n \t/* Shader parameters */\n \tfloat firstRed_x_;\n \tfloat firstRed_y_;\n@@ -98,6 +103,10 @@ private:\n \n \tGLint textureUniformBayerDataIn_;\n \n+\tGLint textureUniformLSCRed_;\n+\tGLint textureUniformLSCGreen_;\n+\tGLint textureUniformLSCBlue_;\n+\n \t/* Represent per-frame CCM as a uniform vector of floats 3 x 3 */\n \tGLint ccmUniformDataIn_;\n \n", "prefixes": [ "5/7" ] }