Show a patch.

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

{
    "id": 12496,
    "url": "https://patchwork.libcamera.org/api/patches/12496/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12496/",
    "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": "<20210607011402.55331-3-hiroh@chromium.org>",
    "date": "2021-06-07T01:13:59",
    "name": "[libcamera-devel,v7,3/6] libcamera: CameraSensorProperties: Add table of v4l2 index and test pattern",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "17379caaf9c35c4c4055475927fde14ff995f806",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12496/mbox/",
    "series": [
        {
            "id": 2105,
            "url": "https://patchwork.libcamera.org/api/series/2105/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2105",
            "date": "2021-06-07T01:13:57",
            "name": "[libcamera-devel,v7,1/6] libcamera: controls: Add sensor test pattern mode",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/2105/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12496/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12496/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 3AEFAC320B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 01:14:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EE7EC68935;\n\tMon,  7 Jun 2021 03:14:13 +0200 (CEST)",
            "from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com\n\t[IPv6:2607:f8b0:4864:20::52c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EE62A68932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 03:14:11 +0200 (CEST)",
            "by mail-pg1-x52c.google.com with SMTP id q15so12561975pgg.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 06 Jun 2021 18:14:11 -0700 (PDT)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:6eb1:2d91:79ee:2043])\n\tby smtp.gmail.com with ESMTPSA id\n\th12sm7303655pgn.54.2021.06.06.18.14.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 06 Jun 2021 18:14:10 -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=\"CY+1wYeS\"; 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=g7msIY4ZSNeR107C0dMkHU0ne5zKkI1ZRoSc6ZNH+C8=;\n\tb=CY+1wYeSmdq5SoDmd32SBdRgJQ8CO70/4rGDswE1vTjBXXl2XiSagrhvylfpASWUj9\n\tmkT9/YCNfX605zdMgKtXQQWMoS7z6JY4hgX0b+L8iUoWcnRsg/84QkekNYLVxW14jz3r\n\t92JlJes8YoHjeOcY08onbvWK3i/P70ksuEc74=",
        "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=g7msIY4ZSNeR107C0dMkHU0ne5zKkI1ZRoSc6ZNH+C8=;\n\tb=Uu+qOBkRuNIhm5/aI1JJECV/O4tEssN0//RY92n203bdPpIyhAjyCUNhTus9tsngK+\n\tYAE9AZBh+lI+m7Y295scR0EJa/3tg2XWj1U6qggWALkI+brQiXGEZ0suJ3oHIwzF4RK2\n\tpowus+FG+nOpJsLK8wGUkl8C7Dw4fokt6CDzOzbboHwbgpffuoR+MtqIsunHzwYCUeP+\n\td7Z/+GfMD5p8D+nDQYm1x8jvWvWkaKwxU49/zuUktKC+4tYVkNrwZB44U1F0AoBz4iW2\n\tLvnd6cj3HcHnnDQRMsJwWbdSGiEMUOAMadtcw15FKx3jxpZMFp00xUvSawW55j5EAtCN\n\tIGeQ==",
        "X-Gm-Message-State": "AOAM532wdGPsdRQ7zRWD2C19hSWtkDNyjzZdFQx1Xqugf39BsQU/xd77\n\tdWM7vEVHkb6gfanl/25YONRKJO1SCLa3NMBl",
        "X-Google-Smtp-Source": "ABdhPJwSzwkIXJz1NvAtiORtO3G8lWAfseYM6gEEXK12munH3hEFqFBOmyzmNEKMAZO5U7KFlVKwyA==",
        "X-Received": "by 2002:a63:dc03:: with SMTP id s3mr8993508pgg.354.1623028450403;\n\tSun, 06 Jun 2021 18:14:10 -0700 (PDT)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  7 Jun 2021 10:13:59 +0900",
        "Message-Id": "<20210607011402.55331-3-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.32.0.rc1.229.g3e70b5a671-goog",
        "In-Reply-To": "<20210607011402.55331-1-hiroh@chromium.org>",
        "References": "<20210607011402.55331-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 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    | 31 +++++++++++++++++++\n 2 files changed, 33 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h\nindex f5e242cb..67c77920 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<int32_t, int32_t> testPatternModes;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp\nindex a2c04009..14270ef9 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,11 @@ 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::testPatternModes\n+ * \\brief Map that associates the indexes of the sensor test pattern modes as\n+ * returned by V4L2_CID_TEST_PATTERN with the corresponding TestPattern\n+ * control value\n  */\n \n /**\n@@ -47,18 +54,42 @@ 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.testPatternModes = {\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{ \"imx258\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n \t\t} },\n \t\t{ \"ov5670\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModes = {\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.testPatternModes =  {\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{ \"ov5693\", {\n \t\t\t.unitCellSize = { 1400, 1400 },\n+\t\t\t.testPatternModes = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 2, controls::draft::TestPatternModeColorBars },\n+\t\t\t\t/*\n+\t\t\t\t * No corresponding test pattern mode for\n+\t\t\t\t * 1: \"Random data\" and 3: \"Colour Bars with\n+\t\t\t\t * Rolling Bar\".\n+\t\t\t\t */\n+\t\t\t},\n \t\t} },\n \t};\n \n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "3/6"
    ]
}