Show a patch.

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

{
    "id": 25576,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/25576/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25576/",
    "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": "<20251217100138.82525-4-bryan.odonoghue@linaro.org>",
    "date": "2025-12-17T10:01:15",
    "name": "[v9,03/26] qcam: viewfinder_gl: Set no-op Bayer shader values",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3f9972b6de79f66d65a6b6f500f9c1f1cb887b51",
    "submitter": {
        "id": 175,
        "url": "https://patchwork.libcamera.org/api/1.1/people/175/?format=api",
        "name": "Bryan O'Donoghue",
        "email": "bryan.odonoghue@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25576/mbox/",
    "series": [
        {
            "id": 5669,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5669/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5669",
            "date": "2025-12-17T10:01:12",
            "name": "Add GLES 2.0 GPUISP to libcamera",
            "version": 9,
            "mbox": "https://patchwork.libcamera.org/series/5669/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25576/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25576/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 4D74CC326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Dec 2025 10:01:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 779BF61A5D;\n\tWed, 17 Dec 2025 11:01:50 +0100 (CET)",
            "from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 14E6861A4E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Dec 2025 11:01:46 +0100 (CET)",
            "by mail-wm1-x333.google.com with SMTP id\n\t5b1f17b1804b1-47118259fd8so55703995e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Dec 2025 02:01:46 -0800 (PST)",
            "from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie.\n\t[188.141.3.146]) by smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47bdc1583fbsm32292585e9.0.2025.12.17.02.01.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 17 Dec 2025 02:01:44 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"H45ZxNTw\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765965705; x=1766570505;\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=fs424H+/NHXIDhotX6BbcvYwsUeY8sQ6tmxWMohUjl4=;\n\tb=H45ZxNTwADrQOY9CRzNgFmWrzQc2sFHyBxvsaxWE9C5ycWMiOZ48v4NiM1YJpl041o\n\t3sb0YWvLyyhY/48n/jDfRu9HOZFeM5Kl85RFPMsVbHxWcV8rSe1Ni91q5rKGIx2PZ3+T\n\tb1fux7Rt49o99u0bU6Ww6rg2moqqRHSZ7+IO8ZQn8TbZGMhO1tOddcQbzq+mVam4WQIQ\n\tYnqFx6sWsJdZwCsUfL/VjJ7hpQ0aMS0L0kpp3Lz0gY5s3lPkyTwLYFtCK4ylGnJS2CqQ\n\tDJ7M5IDoEPtz1eVn2C/UMSPy5qUHnLD488QPKxBm0DDF2323QN7g8EAUwGW+M/Rs9YPK\n\ty8zw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765965705; x=1766570505;\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=fs424H+/NHXIDhotX6BbcvYwsUeY8sQ6tmxWMohUjl4=;\n\tb=Ib5WTiYDa7iLruPSAMoeKvZVZXVEUtW8Bn3pgBBlGQ8h8Ivy0+FvdT+vKAoQlbfJbz\n\t5S0Q8fkgsJ19KvXidAGAw6ueS3yGal1eI6+BXO0GT/UQ2pQ4CfUdcCvgbwJZRoZRJfr9\n\tHgXTnHaflxEa5ncpad0cmeJZHpEFFzFKy+cV5CyCawoGOxeI2Qh7bE7Pr7dxn4UkUvUo\n\txu695Avo5tZWFUQMRwtZm497NCtrxDWetyB3TOZuGPwS6e6EJZ1B3RRxVKbQOm8mQoa0\n\tEwQaHRHuu19umZ33AAcRzIxaRFC+DPiIq8yl2hNvEix38zgkDFvRTu8m+PLsxoXFAgkh\n\tWZqQ==",
        "X-Gm-Message-State": "AOJu0YzNTizj1E7no0T65DuqmkghGVToXbDjZggFQoDifOgyNKY42psB\n\t1EWWukw7G1CMov+cJQFb0jExZYZv7xVytZBirAGz1Hooer9ZPNbtIKxdwoJvXqnz6gpN7+/1l1T\n\tsaHrm",
        "X-Gm-Gg": "AY/fxX7SlqyGoaq4BCC1yYzH4qZkU2PphbTA8YAPqBcEepBPn6P4WdF+COvGAKP4VqZ\n\tSsLEBktRxrmWrZH2gJ1MgD5uokc6wWKRY8jsmSTFOHlvpbYeACW60gVYw3GuK2/mizLny+HFB7X\n\tqPRMCEs7JH6RnRXdt/y58PEALhm/e06W+/h1oWnGtOReVEf5SAWa3QvlmwkEL0qElklKAsZk2RE\n\tSjna82I7QA7N5ikMjXSQDmGHacC7apKu3Dcom13EtQeH/oF9eTw9gUXezxc+wXSlVDX091r7RE2\n\tSi16VWnJH83hvSCab9Spcrkwa25KBsdqjIILlo9rXiMXr7XrHPpzgux2NE9E0boIL1a8epXweCQ\n\twcY8JoZQZvPCcsDpjow3yWWin3LIuq0NjWNHsUKBzrWy14u9RlScoOxLAKKG+tlLKW0PN/vhsTX\n\tTpz6V/cwL+S4UrZXBVbPX56giPeSucxAmBscql5LO180CphCeqlABq5tYJJkz+tuUMPRpZ1g5bg\n\tWS75Q==",
        "X-Google-Smtp-Source": "AGHT+IGiegwlJ9BiUeMiyHvDqNL0Wb8/5hwgYfciYdFiBiCZzsS0V/8yzpVWpiGeOUqV8jrh9lQ2Og==",
        "X-Received": "by 2002:a05:600c:5487:b0:47b:deb9:f8a with SMTP id\n\t5b1f17b1804b1-47bdeb91a35mr8922175e9.30.1765965705124; \n\tWed, 17 Dec 2025 02:01:45 -0800 (PST)",
        "From": "Bryan O'Donoghue <bryan.odonoghue@linaro.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "pavel@ucw.cz, Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH v9 03/26] qcam: viewfinder_gl: Set no-op Bayer shader values",
        "Date": "Wed, 17 Dec 2025 10:01:15 +0000",
        "Message-ID": "<20251217100138.82525-4-bryan.odonoghue@linaro.org>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20251217100138.82525-1-bryan.odonoghue@linaro.org>",
        "References": "<20251217100138.82525-1-bryan.odonoghue@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Populate qcam viewfinder_gl to set default Bayer values so that the\nshaders can be used in their original mode without conditional compilation.\n\nSet an identity CCM, identity Black Level and set Gamma and Contrast to\n1.0f respectively.\n\nOnce this change is made we can use the Bayer shaders in their original\nformat in qcam with raw streams.\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\nSigned-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n---\n src/apps/qcam/viewfinder_gl.cpp | 26 ++++++++++++++++++++++++++\n src/apps/qcam/viewfinder_gl.h   | 12 ++++++++++++\n 2 files changed, 38 insertions(+)",
    "diff": "diff --git a/src/apps/qcam/viewfinder_gl.cpp b/src/apps/qcam/viewfinder_gl.cpp\nindex 1554c94d5..4698c5aac 100644\n--- a/src/apps/qcam/viewfinder_gl.cpp\n+++ b/src/apps/qcam/viewfinder_gl.cpp\n@@ -473,6 +473,10 @@ bool ViewFinderGL::createFragmentShader()\n \ttextureUniformSize_ = shaderProgram_.uniformLocation(\"tex_size\");\n \ttextureUniformStrideFactor_ = shaderProgram_.uniformLocation(\"stride_factor\");\n \ttextureUniformBayerFirstRed_ = shaderProgram_.uniformLocation(\"tex_bayer_first_red\");\n+\tccmUniformDataIn_ = shaderProgram_.uniformLocation(\"ccm\");\n+\tblackLevelUniformDataIn_ = shaderProgram_.uniformLocation(\"blacklevel\");\n+\tgammaUniformDataIn_ = shaderProgram_.uniformLocation(\"gamma\");\n+\tcontrastUniformDataIn_ = shaderProgram_.uniformLocation(\"contrast\");\n \n \t/* Create the textures. */\n \tfor (std::unique_ptr<QOpenGLTexture> &texture : textures_) {\n@@ -542,6 +546,16 @@ void ViewFinderGL::doRender()\n \t/* Stride of the first plane, in pixels. */\n \tunsigned int stridePixels;\n \n+\t/* Identity CCM */\n+\tfloat ccm[] = { 1.0f, 0.0f, 0.0f,\n+\t\t\t0.0f, 1.0f, 0.0f,\n+\t\t\t0.0f, 0.0f, 1.0f };\n+\n+\tQMatrix3x3 qCcmMat(ccm);\n+\n+\t/* Black Level */\n+\tQVector3D qBlackLevelVec(0.0f, 0.0f, 0.0f);\n+\n \tswitch (format_) {\n \tcase libcamera::formats::NV12:\n \tcase libcamera::formats::NV21:\n@@ -788,6 +802,18 @@ void ViewFinderGL::doRender()\n \t\t * the generic stride factor to 1.0.\n \t\t */\n \t\tstridePixels = size_.width();\n+\n+\t\t/* Colour Correction Matrix */\n+\t\tshaderProgram_.setUniformValue(ccmUniformDataIn_, qCcmMat);\n+\n+\t\t/* Black Level */\n+\t\tshaderProgram_.setUniformValue(blackLevelUniformDataIn_, qBlackLevelVec);\n+\n+\t\t/* Gamma */\n+\t\tshaderProgram_.setUniformValue(gammaUniformDataIn_, 1.0f);\n+\n+\t\t/* Contrast */\n+\t\tshaderProgram_.setUniformValue(contrastUniformDataIn_, 1.0f);\n \t\tbreak;\n \n \tdefault:\ndiff --git a/src/apps/qcam/viewfinder_gl.h b/src/apps/qcam/viewfinder_gl.h\nindex 23c657bcf..59f122217 100644\n--- a/src/apps/qcam/viewfinder_gl.h\n+++ b/src/apps/qcam/viewfinder_gl.h\n@@ -103,5 +103,17 @@ private:\n \tGLuint textureUniformBayerFirstRed_;\n \tQPointF firstRed_;\n \n+\t/* Represent per-frame CCM as a uniform vector of floats 3 x 3 */\n+\tGLint ccmUniformDataIn_;\n+\n+\t/* Black Level compensation */\n+\tGLint blackLevelUniformDataIn_;\n+\n+\t/* Gamma */\n+\tGLint gammaUniformDataIn_;\n+\n+\t/* Contrast */\n+\tGLint contrastUniformDataIn_;\n+\n \tQMutex mutex_; /* Prevent concurrent access to image_ */\n };\n",
    "prefixes": [
        "v9",
        "03/26"
    ]
}