Show a patch.

GET /api/patches/26621/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 26621,
    "url": "https://patchwork.libcamera.org/api/patches/26621/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26621/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20260504182658.590233-6-mzamazal@redhat.com>",
    "date": "2026-05-04T18:26:54",
    "name": "[RFC,v4,5/7] libcamera: shaders: Add LSC support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "0431305595414a5698c79e83947e38ad73bb4a07",
    "submitter": {
        "id": 177,
        "url": "https://patchwork.libcamera.org/api/people/177/?format=api",
        "name": "Milan Zamazal",
        "email": "mzamazal@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/26621/mbox/",
    "series": [
        {
            "id": 5903,
            "url": "https://patchwork.libcamera.org/api/series/5903/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5903",
            "date": "2026-05-04T18:26:49",
            "name": "LSC for SoftISP simple pipeline",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/5903/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26621/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26621/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 47D03C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 May 2026 18:27:35 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC66D6302E;\n\tMon,  4 May 2026 20:27:34 +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 1946763026\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 May 2026 20:27:32 +0200 (CEST)",
            "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-558-Aie4HOHnMcykW9PUwxn_jg-1;\n\tMon, 04 May 2026 14:27:25 -0400",
            "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.93])\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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id D630118005A8; Mon,  4 May 2026 18:27:23 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.69])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id A87B41800370; Mon,  4 May 2026 18:27:20 +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=\"RAvGEmHN\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777919250;\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=2rsZizSisUZJv1PcV/744BnSe5SnMGMSPYXMr4bGQKU=;\n\tb=RAvGEmHN2JZNUCK/FyliO779tOYmMWNkwgifMEaF6pxXf2m6jGzgWq+pDzyKk0LuryPQBt\n\tKNsx8F3f1TAsnoCXLUoOj5AbscRRj0QQNmvsQGkpURL1VgBRiOKV50TskfObymnXToXeN7\n\t+FWgJBMMNRP6Co1IXJALLISz39dKa9w=",
        "X-MC-Unique": "Aie4HOHnMcykW9PUwxn_jg-1",
        "X-Mimecast-MFC-AGG-ID": "Aie4HOHnMcykW9PUwxn_jg_1777919244",
        "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\tRick ten Wolde <rick_libcamera@wolde.info>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[RFC PATCH v4 5/7] libcamera: shaders: Add LSC support",
        "Date": "Mon,  4 May 2026 20:26:54 +0200",
        "Message-ID": "<20260504182658.590233-6-mzamazal@redhat.com>",
        "In-Reply-To": "<20260504182658.590233-1-mzamazal@redhat.com>",
        "References": "<20260504182658.590233-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "4HdZKiIody0Nl29rwgOBuaQhYezwv3ZbWk-8ODLlg7M_1777919244",
        "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\nLens shading correction should be applied after black level\nsubtraction (in order to make the computations with meaningful values)\nand before white balance (especially before white balance stats are\ncomputed).\n\nNote that lens shading correction depends on temperature, which is\ncomputed from the preceding, rather than current, frame (this is due to\nhow white balance is currently computed).\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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 src/libcamera/shaders/bayer_1x_packed.frag | 8 ++++++++\n src/libcamera/shaders/bayer_unpacked.frag  | 8 ++++++++\n 2 files changed, 16 insertions(+)",
    "diff": "diff --git a/src/libcamera/shaders/bayer_1x_packed.frag b/src/libcamera/shaders/bayer_1x_packed.frag\nindex 23747f78a..228c72309 100644\n--- a/src/libcamera/shaders/bayer_1x_packed.frag\n+++ b/src/libcamera/shaders/bayer_1x_packed.frag\n@@ -70,6 +70,10 @@ uniform vec3 blacklevel;\n uniform float gamma;\n uniform float contrastExp;\n \n+#if defined(APPLY_LSC)\n+uniform sampler2D lsc_tex;\n+#endif\n+\n float apply_contrast(float value)\n {\n \t// Apply simple S-curve\n@@ -227,6 +231,10 @@ void main(void)\n \n \trgb = rgb - blacklevel;\n \n+#if defined(APPLY_LSC)\n+\trgb = rgb * texture2D(lsc_tex, textureOut).rgb;\n+#endif\n+\n \t/*\n \t *   CCM is a 3x3 in the format\n \t *\ndiff --git a/src/libcamera/shaders/bayer_unpacked.frag b/src/libcamera/shaders/bayer_unpacked.frag\nindex 1b85196ae..af87bcc0f 100644\n--- a/src/libcamera/shaders/bayer_unpacked.frag\n+++ b/src/libcamera/shaders/bayer_unpacked.frag\n@@ -29,6 +29,10 @@ uniform vec3            blacklevel;\n uniform float           gamma;\n uniform float           contrastExp;\n \n+#if defined(APPLY_LSC)\n+uniform sampler2D lsc_tex;\n+#endif\n+\n float apply_contrast(float value)\n {\n     // Apply simple S-curve\n@@ -130,6 +134,10 @@ void main(void) {\n \n     rgb = rgb - blacklevel;\n \n+#if defined(APPLY_LSC)\n+    rgb = rgb * texture2D(lsc_tex, center.xy).rgb;\n+#endif\n+\n     /*\n      *   CCM is a 3x3 in the format\n      *\n",
    "prefixes": [
        "RFC",
        "v4",
        "5/7"
    ]
}