Show a patch.

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

{
    "id": 12158,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12158/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12158/",
    "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": "<20210430173803.198220-3-jacopo@jmondi.org>",
    "date": "2021-04-30T17:38:02",
    "name": "[libcamera-devel,v6,2/3] libcamera: camera_sensor: Register static properties",
    "commit_ref": "cdfcb05bedd22670f42581188d9ffd07a283fb4c",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ecb83ad4fdda8c13a552bb2280d93ac259991fc5",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12158/mbox/",
    "series": [
        {
            "id": 1991,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1991/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1991",
            "date": "2021-04-30T17:38:00",
            "name": "Introduce CameraSensorProperties database",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/1991/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12158/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12158/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 141ACBDE4F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 30 Apr 2021 17:37:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C02868909;\n\tFri, 30 Apr 2021 19:37:30 +0200 (CEST)",
            "from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C0B62688E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Apr 2021 19:37:27 +0200 (CEST)",
            "from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id C6EA8200006;\n\tFri, 30 Apr 2021 17:37:26 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 30 Apr 2021 19:38:02 +0200",
        "Message-Id": "<20210430173803.198220-3-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210430173803.198220-1-jacopo@jmondi.org>",
        "References": "<20210430173803.198220-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v6 2/3] libcamera: camera_sensor: Register\n\tstatic properties",
        "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>",
        "Cc": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund+renesas@ragnatech.se>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Register static properties in the CameraSensor class by inspecting the\ncamera sensor properties database.\n\nStatic properties are overridden by properties retrieved from\nthe kernel interface at run-time if any overlap between the two\nsets occurs.\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/internal/camera_sensor.h |  1 +\n src/libcamera/camera_sensor.cpp            | 16 +++++++++++++++-\n 2 files changed, 16 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex 3e98f71b5e7f..3fa3a419f94a 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -77,6 +77,7 @@ private:\n \tint generateId();\n \tint validateSensorDriver();\n \tvoid initVimcDefaultProperties();\n+\tvoid initStaticProperties();\n \tint initProperties();\n \n \tconst MediaEntity *entity_;\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 2887bb69ca02..1db263cfae2d 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -19,6 +19,7 @@\n #include <libcamera/property_ids.h>\n \n #include \"libcamera/internal/bayer_format.h\"\n+#include \"libcamera/internal/camera_sensor_properties.h\"\n #include \"libcamera/internal/formats.h\"\n #include \"libcamera/internal/sysfs.h\"\n #include \"libcamera/internal/utils.h\"\n@@ -407,6 +408,16 @@ void CameraSensor::initVimcDefaultProperties()\n \tactiveArea_ = Rectangle(pixelArraySize_);\n }\n \n+void CameraSensor::initStaticProperties()\n+{\n+\tconst CameraSensorProperties *props = CameraSensorProperties::get(model_);\n+\tif (!props)\n+\t\treturn;\n+\n+\t/* Register the properties retrieved from the sensor database. */\n+\tproperties_.set(properties::UnitCellSize, props->unitCellSize);\n+}\n+\n int CameraSensor::initProperties()\n {\n \t/*\n@@ -444,7 +455,10 @@ int CameraSensor::initProperties()\n \tif (ret)\n \t\treturn ret;\n \n-\t/* Retrieve and store the camera sensor properties. */\n+\t/* Initialize the static properties from the sensor database. */\n+\tinitStaticProperties();\n+\n+\t/* Retrieve and register properties from the kernel interface. */\n \tconst ControlInfoMap &controls = subdev_->controls();\n \tint32_t propertyValue;\n \n",
    "prefixes": [
        "libcamera-devel",
        "v6",
        "2/3"
    ]
}