Show a patch.

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

{
    "id": 25518,
    "url": "https://patchwork.libcamera.org/api/patches/25518/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25518/",
    "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": "<20251212002937.3118-4-bryan.odonoghue@linaro.org>",
    "date": "2025-12-12T00:29:14",
    "name": "[v8,03/26] qcam: viewfinder_gl: Set no-op Bayer shader values",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "170eeda9364142f9a709f1c7d0a1ee87405c3636",
    "submitter": {
        "id": 175,
        "url": "https://patchwork.libcamera.org/api/people/175/?format=api",
        "name": "Bryan O'Donoghue",
        "email": "bryan.odonoghue@linaro.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25518/mbox/",
    "series": [
        {
            "id": 5657,
            "url": "https://patchwork.libcamera.org/api/series/5657/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5657",
            "date": "2025-12-12T00:29:11",
            "name": "Add GLES 2.0 GPUISP to libcamera",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/5657/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25518/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25518/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 68F0EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Dec 2025 00:33:34 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EEAC61637;\n\tFri, 12 Dec 2025 01:33:34 +0100 (CET)",
            "from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA7F461613\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Dec 2025 01:33:32 +0100 (CET)",
            "by mail-pj1-x1029.google.com with SMTP id\n\t98e67ed59e1d1-3438d4ae152so757924a91.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 16:33:32 -0800 (PST)",
            "from inspiron14p-linux (p99250-ipoefx.ipoe.ocn.ne.jp.\n\t[153.246.134.249]) by smtp.gmail.com with ESMTPSA id\n\t41be03b00d2f7-c0c26eb0f6bsm3317282a12.14.2025.12.11.16.33.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 11 Dec 2025 16:33:30 -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=\"T6s16xEI\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1765499611; x=1766104411;\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=II6CNKAdf/lZ/qp3rhzbc8QP/zzmnb1ppQZ/htfgUOs=;\n\tb=T6s16xEI61eN7a9mHZq0uRApXIvZNRcHI+hjm1dgnUlyprrsbIdIxKevcdhfGhrEmo\n\tSRAAIJrR1R4RZZM8+/u27puzEtLu+eaZaiwTXr49L7J4em/PIaAXGDG73y0aJLmriW8+\n\tXHqzTUbpvSoY6MhmpTmJ18Zw/giTqmstIzmEFHNvGtmhDiMcBkrxXs/VR/s2pRZd30aq\n\tjsJGbeGziGinvdgAEpWEGIfXp3EhmkT6ct/yut9F+7/cRRUBCk/1ZM7mwZAJSLb4YuqX\n\tOwgLV+QnqWQyP5kfWLMe8371Yb01K8TgTpbkSGPJzVhepyspl4jy4123V0yXA9IsrF6r\n\tjm3Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765499611; x=1766104411;\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=II6CNKAdf/lZ/qp3rhzbc8QP/zzmnb1ppQZ/htfgUOs=;\n\tb=i/gbXGYrLtUKFmzegP8mzaZqyQliVPAN2siQeKsUXe7qb6+LaiBJp3d8Zp9Vke+IY3\n\tJqgAj+tRwlmFyJTqwLs7kUhcRHdB/67H5iFhm4ZD5bKoZoxJ63MA+OVwDR83Wy7CKU7h\n\tsqDCX24YZqCVxNPhjOFi9dfUN3NWTMtwcF6oamiI5HzzVMN4WC5sxYuFlQ2BSudEMmcJ\n\tEp4V0dcCSNvG/P9FhlsQzgge5DnQEpbOgS6xZukMlxz8LzyoAWNdvxvrqi/UWqtcxMz9\n\t9n+RAXp2bbRN6pwDGKzrrH1sxtRQ38eiUWGNXxBrKnEgNhRU56Qp2tzIgTQBSAyndwaF\n\tp9OA==",
        "X-Gm-Message-State": "AOJu0YzYNs9VigsTzASyt6O9AOg2DT5u78cvG7XAPyXp6EFCkRsiah9U\n\t5/vEmll4fSG1hfKLgYGClZEjF68Vz4fksDUEGD3kwEGnbja+W6y2XgaY53p1d9M/v83fQB68VOh\n\tnuYWD",
        "X-Gm-Gg": "AY/fxX7U0q226wnwTV2SP1IwcNL0agnQBan3qzNVbJxM59Lvfo/6HnauAKyLtY24WUs\n\toUeoi4BZf0WYaOBK+5H25e2S+lFZbuaxs7D0UT+DmESgQniCvpsVN0xM92428QoxbHjamnKHxyB\n\tnZAOH0mQDqe2LGRBinjf5VzYKxh+vV5yMZOz3v6kWNoD/UGwmB4pEfP182skznyEXFmg2NF1Yk1\n\tfR9w0ELVet8vzJSprDqIppavRlGMsAuofFcGJ/V+tl1n1Jv6UbIRQfd7KCQT5LwMbLxbdCnbwqI\n\tipCxV78k7hxT3Uk12UyqNHi7+6NgmUTDX/AdKyf/S6sko6lpM3yswCe4mCOYO4WXdBNG3lsl7T3\n\tR+wuGaj1jptpT6zA4Lg3wYiyC5cyGzXcOufyIENl3OqEdRmRk5nUdRYCZjlf8smYsqv5gQh+zif\n\teNdFXdf7PUsYKkQKDlLLgW+7vlEOkr1W1xruwyr66nF1+nJ1UNUjyvhiLaqKA=",
        "X-Google-Smtp-Source": "AGHT+IFCrsq9Mnvc2KoWoBOxjvbj/0sIvnK4eglh1u1FvXFLkSz4CojcbdV6XRJWgPa+5W5bm1VlEQ==",
        "X-Received": "by 2002:a17:90b:2b4d:b0:32d:f352:f764 with SMTP id\n\t98e67ed59e1d1-34abe3e0134mr173771a91.2.1765499611114; \n\tThu, 11 Dec 2025 16:33:31 -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 v8 03/26] qcam: viewfinder_gl: Set no-op Bayer shader values",
        "Date": "Fri, 12 Dec 2025 00:29:14 +0000",
        "Message-ID": "<20251212002937.3118-4-bryan.odonoghue@linaro.org>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20251212002937.3118-1-bryan.odonoghue@linaro.org>",
        "References": "<20251212002937.3118-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 | 25 +++++++++++++++++++++++++\n src/apps/qcam/viewfinder_gl.h   | 12 ++++++++++++\n 2 files changed, 37 insertions(+)",
    "diff": "diff --git a/src/apps/qcam/viewfinder_gl.cpp b/src/apps/qcam/viewfinder_gl.cpp\nindex 1554c94d5..69b7c6e59 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,15 @@ 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       0.0f, 1.0f, 0.0f,\n+\t\t       0.0f, 0.0f, 1.0f };\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 +801,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": [
        "v8",
        "03/26"
    ]
}