Show a patch.

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

{
    "id": 26131,
    "url": "https://patchwork.libcamera.org/api/patches/26131/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/26131/",
    "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": "<20260211131728.96413-2-mzamazal@redhat.com>",
    "date": "2026-02-11T13:17:27",
    "name": "[1/2] ipa: simple: Limit the black level value",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "98828599bb83138d17bb0cff1c107ea7a0444e5d",
    "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/26131/mbox/",
    "series": [
        {
            "id": 5784,
            "url": "https://patchwork.libcamera.org/api/series/5784/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5784",
            "date": "2026-02-11T13:17:26",
            "name": "Fix black level handling in GPU ISP",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5784/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/26131/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/26131/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 87C86BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Feb 2026 13:17:50 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2923D621AB;\n\tWed, 11 Feb 2026 14:17:50 +0100 (CET)",
            "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 8A5F7621A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Feb 2026 14:17:48 +0100 (CET)",
            "from mx-prod-mc-01.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-R7OVeE5nPtu2bWCe4fdxzQ-1;\n\tWed, 11 Feb 2026 08:17:45 -0500",
            "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.12])\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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 6193B195609F; Wed, 11 Feb 2026 13:17:44 +0000 (UTC)",
            "from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.45.226.74])\n\tby mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 520D019560A3; Wed, 11 Feb 2026 13:17:42 +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=\"gpJ6NpyY\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1770815867;\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=WPk1K/IdOSge/OcmzVdWPq8Ni5XtNG11l5wnfhNyd8M=;\n\tb=gpJ6NpyYPRtyPGGwdnIbcVVSk9dilWs97HsBhzvdY9NDBdXVYc57NQSlFFnw8maRybQAQw\n\tWeHbUlfqqfEwcKvmKDkwE6iL9t0lVBzDC0TsOrVp+6Lfto5LhXmzAX0qUQkg5f25XC2Att\n\tilWRQhWlYWZQLjFpcARiljRi3+Xjpsc=",
        "X-MC-Unique": "R7OVeE5nPtu2bWCe4fdxzQ-1",
        "X-Mimecast-MFC-AGG-ID": "R7OVeE5nPtu2bWCe4fdxzQ_1770815864",
        "From": "Milan Zamazal <mzamazal@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Milan Zamazal <mzamazal@redhat.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "Subject": "[PATCH 1/2] ipa: simple: Limit the black level value",
        "Date": "Wed, 11 Feb 2026 14:17:27 +0100",
        "Message-ID": "<20260211131728.96413-2-mzamazal@redhat.com>",
        "In-Reply-To": "<20260211131728.96413-1-mzamazal@redhat.com>",
        "References": "<20260211131728.96413-1-mzamazal@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "29MFmCD8UmfZsCKL-lVM5nUxiq-J8PXARyPKbG__eho_1770815864",
        "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": "The black level value is passed to image processing, where it's used in\npixel value computations.  To avoid troubles with weird black level\nvalues (which are mostly theoretical but we should be still safe against\ne.g. crazy values in testing tuning files) like division by zero, let's\nmake sure the black level passed to the image processing is lower than\nthe maximum pixel value.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/ipa/simple/algorithms/blc.cpp | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/ipa/simple/algorithms/blc.cpp b/src/ipa/simple/algorithms/blc.cpp\nindex 464e43c27..b318d0354 100644\n--- a/src/ipa/simple/algorithms/blc.cpp\n+++ b/src/ipa/simple/algorithms/blc.cpp\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: LGPL-2.1-or-later */\n /*\n- * Copyright (C) 2024-2025, Red Hat Inc.\n+ * Copyright (C) 2024-2026, Red Hat Inc.\n  *\n  * Black level handling\n  */\n@@ -52,8 +52,9 @@ void BlackLevel::prepare(IPAContext &context,\n \t\t\t [[maybe_unused]] IPAFrameContext &frameContext,\n \t\t\t DebayerParams *params)\n {\n-\t/* Latch the blacklevel gain so GPUISP can apply. */\n-\tparams->blackLevel = RGB<float>(context.activeState.blc.level / 255.0f);\n+\t/* Make sure the black level is sane, i.e. below maximum pixel value. */\n+\tparams->blackLevel = RGB<float>(context.activeState.blc.level / 255.0f)\n+\t\t\t\t     .min(0.99);\n }\n \n void BlackLevel::process(IPAContext &context,\n",
    "prefixes": [
        "1/2"
    ]
}