Patch Detail
Show a patch.
GET /api/1.1/patches/26132/?format=api
{ "id": 26132, "url": "https://patchwork.libcamera.org/api/1.1/patches/26132/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26132/", "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": "<20260211131728.96413-3-mzamazal@redhat.com>", "date": "2026-02-11T13:17:28", "name": "[2/2] libcamera: software_isp: Fix black level application in GPU ISP", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "91de7374c8f7dc2b5ff47f929d2cdb0351062c3f", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/26132/mbox/", "series": [ { "id": 5784, "url": "https://patchwork.libcamera.org/api/1.1/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/26132/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26132/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 2C8ADBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Feb 2026 13:17:55 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CDE1B621B8;\n\tWed, 11 Feb 2026 14:17:54 +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 838EF621A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Feb 2026 14:17:53 +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-280-fupWz5erPDuLWJIMKhwY9A-1;\n\tWed, 11 Feb 2026 08:17:48 -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 74AAC1956053; Wed, 11 Feb 2026 13:17:47 +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 8BA5419560A3; Wed, 11 Feb 2026 13:17:45 +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=\"S6YdA+uk\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1770815872;\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=63ssZNW64TKNF2J3VStxrqh3P1OnX3XVYMKB/7MzO4w=;\n\tb=S6YdA+ukh9A04pkazDLmM9v8BW8WZmlqHIYxUsZRnZirSHzbAkY0Dn+woh2Ct5JVuXbkFP\n\tbkcOZFnNnfSqwPv4lZemcCli/rLzJnh6oFxGs44YMLsmYME5qae2xNL5ofCgczCXZitDID\n\tk34fLNYQXS5rFw9vz91d/cuLVs8osVc=", "X-MC-Unique": "fupWz5erPDuLWJIMKhwY9A-1", "X-Mimecast-MFC-AGG-ID": "fupWz5erPDuLWJIMKhwY9A_1770815867", "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 2/2] libcamera: software_isp: Fix black level application in\n\tGPU ISP", "Date": "Wed, 11 Feb 2026 14:17:28 +0100", "Message-ID": "<20260211131728.96413-3-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": "pRhNPUPcz98_IecSN3vPiTzQV8uFkJz63HyKeKCq56c_1770815867", "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": "In GPU ISP fragment shaders, the black level is simply subtracted from\nthe pixel value. This means the highest pixel values can never be\nreached, possibly resulting in wrong brightness or colour shifts. Fix\nthis by spreading the resulting value to the whole 0.0..1.0 range.\n\nThe preceding simple pipeline IPA patch ensures `blacklevel' is less\nthan 1.0, preventing division by zero here.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/shaders/bayer_1x_packed.frag | 2 +-\n src/libcamera/shaders/bayer_unpacked.frag | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/shaders/bayer_1x_packed.frag b/src/libcamera/shaders/bayer_1x_packed.frag\nindex 23747f78a..06ddc040b 100644\n--- a/src/libcamera/shaders/bayer_1x_packed.frag\n+++ b/src/libcamera/shaders/bayer_1x_packed.frag\n@@ -225,7 +225,7 @@ void main(void)\n \t\t\tvec3(patterns.y, C, patterns.x) :\n \t\t\tvec3(patterns.wz, C));\n \n-\trgb = rgb - blacklevel;\n+\trgb = (rgb - blacklevel) / (1.0 - blacklevel);\n \n \t/*\n \t * CCM is a 3x3 in the format\ndiff --git a/src/libcamera/shaders/bayer_unpacked.frag b/src/libcamera/shaders/bayer_unpacked.frag\nindex 1b85196ae..98dea512c 100644\n--- a/src/libcamera/shaders/bayer_unpacked.frag\n+++ b/src/libcamera/shaders/bayer_unpacked.frag\n@@ -128,7 +128,7 @@ void main(void) {\n vec3(PATTERN.w, C, PATTERN.z) :\n vec3(PATTERN.yx, C));\n \n- rgb = rgb - blacklevel;\n+ rgb = (rgb - blacklevel) / (1.0 - blacklevel);\n \n /*\n * CCM is a 3x3 in the format\n", "prefixes": [ "2/2" ] }