Show a patch.

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

{
    "id": 12317,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12317/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12317/",
    "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": "<20210519075941.1337388-3-hiroh@chromium.org>",
    "date": "2021-05-19T07:59:38",
    "name": "[libcamera-devel,v5,3/6] libcamera: CameraSensorProperties: Add table of v4l2 index and test pattern",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "61581a53d024f7963c72441afa0d6d29537404dd",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12317/mbox/",
    "series": [
        {
            "id": 2037,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2037/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2037",
            "date": "2021-05-19T07:59:36",
            "name": "[libcamera-devel,v5,1/6] libcamera: controls: Add sensor test pattern mode",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2037/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12317/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12317/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 E97D1C31FF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 May 2021 07:59:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A294168924;\n\tWed, 19 May 2021 09:59:53 +0200 (CEST)",
            "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 13EA068924\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 May 2021 09:59:52 +0200 (CEST)",
            "by mail-pj1-x1029.google.com with SMTP id ot16so4986529pjb.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 May 2021 00:59:52 -0700 (PDT)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:3948:91a2:b8ec:1976])\n\tby smtp.gmail.com with ESMTPSA id\n\t80sm1160847pfw.200.2021.05.19.00.59.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 19 May 2021 00:59:50 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"SnIzc8Fo\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=/E0wEK/zI0Rft4ntRt5zbETRBVUgI5OUGySgUQg3I+s=;\n\tb=SnIzc8FoV+9xv0uwlt6aIZ9RkUfwNFCcMzwLMklggyXugr+pOFhtifiHfdFhGS6kgx\n\tZJh5ogO/7AiKXE4QNRvQusIuG9t1BhgDtBmZ8ZzZW7sLKT6NBgqsilUYm4XDJsyWCxTl\n\tsOKkx63PCibv1yXhiD2dPWTzBiJynunMa2Ldg=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=/E0wEK/zI0Rft4ntRt5zbETRBVUgI5OUGySgUQg3I+s=;\n\tb=MUx8AIDmBAmKIesCshmi7VZPLwP3txrpG8FkUIyKtomZcnB+EM82pGe+HSgVa5loh2\n\tx4H+6nNchshVq2Nz61GBfHG3vnJmRazXsunBi1Pk2PiLGh+TAeHevo325E98rWqmkOCG\n\tCwFMyUtQ3RADwsc5nCuXUY3zpsRxSTQvbI7EP1VB56WafbebUPu6+Cr98UGxhquaf5jJ\n\tyG+Ijxb7fNmbaxw10g4wjNJ128olzUXTwBYRMQfhj0rj8ltm7p9zBETGs8clvBLxQd1x\n\tuiEki1fS/0D1E7vGv99reGjf5+VUXPph8sdXE42S1/rZugd+J1UfaezCqnsvsmexYWOJ\n\tIdaw==",
        "X-Gm-Message-State": "AOAM5319pA993G4tM73Va5iZMgUwlsuXnTgu4AjpHvOz9iK94LWV/ZsV\n\trV3tojHpPUVDbYv2NbiFlULrgPs3fZlb+Q==",
        "X-Google-Smtp-Source": "ABdhPJxAmvyVUuMqW8F5WbuEHc+cqglEVPYBQJDmHmjN5PZLaZNy9NtmPfUYaQnDFseT5AzDBsAKpA==",
        "X-Received": "by 2002:a17:902:b412:b029:ef:1737:ed with SMTP id\n\tx18-20020a170902b412b02900ef173700edmr9682110plr.43.1621411190514; \n\tWed, 19 May 2021 00:59:50 -0700 (PDT)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 19 May 2021 16:59:38 +0900",
        "Message-Id": "<20210519075941.1337388-3-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.31.1.751.gd2f1c929bd-goog",
        "In-Reply-To": "<20210519075941.1337388-1-hiroh@chromium.org>",
        "References": "<20210519075941.1337388-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 3/6] libcamera: CameraSensorProperties:\n\tAdd table of v4l2 index and test pattern",
        "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 V4L2 specification defines the sensor test pattern modes\nthrough a menu control, where a numerical index is associated to\na string that describes the test pattern. The index-to-pattern\nmapping is driver specific and requires a corresponding representation\nin the library.\n\nAdd to the static list of CameraSensorProperties a map of indexes to\nlibcamera::controls::TestPatternModes values to be able to map the\nindexes returned by the driver to the corresponding test pattern mode.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n .../internal/camera_sensor_properties.h       |  2 ++\n src/libcamera/camera_sensor_properties.cpp    | 22 +++++++++++++++++++\n 2 files changed, 24 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h\nindex f5e242cb..88ec7261 100644\n--- a/include/libcamera/internal/camera_sensor_properties.h\n+++ b/include/libcamera/internal/camera_sensor_properties.h\n@@ -7,6 +7,7 @@\n #ifndef __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__\n #define __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__\n \n+#include <map>\n #include <string>\n \n #include <libcamera/geometry.h>\n@@ -17,6 +18,7 @@ struct CameraSensorProperties {\n \tstatic const CameraSensorProperties *get(const std::string &sensor);\n \n \tSize unitCellSize;\n+\tstd::map<uint8_t, uint8_t> testPatternModeMap;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp\nindex 6ded31dc..3bf8e500 100644\n--- a/src/libcamera/camera_sensor_properties.cpp\n+++ b/src/libcamera/camera_sensor_properties.cpp\n@@ -9,6 +9,8 @@\n \n #include <map>\n \n+#include <libcamera/control_ids.h>\n+\n #include \"libcamera/internal/log.h\"\n \n /**\n@@ -34,6 +36,10 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties)\n  *\n  * \\var CameraSensorProperties::unitCellSize\n  * \\brief The physical size of a pixel, including pixel edges, in nanometers.\n+ *\n+ * \\var CameraSensorProperties::testPatternModeMap\n+ * \\brief The table from a v4l2 menu index for V4L2_CID_TEST_PATTERN to the\n+ * control value of libcamera test pattern mode.\n  */\n \n /**\n@@ -47,12 +53,28 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n \tstatic const std::map<std::string, const CameraSensorProperties> sensorProps = {\n \t\t{ \"imx219\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModeMap = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t\t{ 2, controls::draft::TestPatternModeSolidColor },\n+\t\t\t\t{ 3, controls::draft::TestPatternModeColorBarsFadeToGray },\n+\t\t\t\t{ 4, controls::draft::TestPatternModePn9 },\n+\t\t\t},\n \t\t} },\n \t\t{ \"ov5670\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModeMap = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t},\n \t\t} },\n \t\t{ \"ov13858\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModeMap =  {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t\t{ 2, controls::draft::TestPatternModeColorBarsFadeToGray },\n+\t\t\t},\n \t\t} },\n \t};\n \n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "3/6"
    ]
}