Show a patch.

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

{
    "id": 11906,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11906/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11906/",
    "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": "<20210413101439.14659-3-jacopo@jmondi.org>",
    "date": "2021-04-13T10:14:38",
    "name": "[libcamera-devel,v5,2/3] libcamera: camera_sensor: Register static properties",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "153e8b46a8fc0fc9b7123c0bea29ab589b80bbf2",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/1.1/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/11906/mbox/",
    "series": [
        {
            "id": 1917,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1917/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1917",
            "date": "2021-04-13T10:14:36",
            "name": "Introduce sensor database",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/1917/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11906/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11906/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 F1192BD22F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 10:14:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 74B7C68808;\n\tTue, 13 Apr 2021 12:14:09 +0200 (CEST)",
            "from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C9A2687D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 12:14:07 +0200 (CEST)",
            "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 4F83D24000B;\n\tTue, 13 Apr 2021 10:14:06 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.118.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 13 Apr 2021 12:14:38 +0200",
        "Message-Id": "<20210413101439.14659-3-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210413101439.14659-1-jacopo@jmondi.org>",
        "References": "<20210413101439.14659-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v5 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, retrieved inspecting the sensor\ndatabase, in the CameraSensor class.\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 f7ed91d990f7..f218dc5e8a55 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -20,6 +20,7 @@\n \n #include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/formats.h\"\n+#include \"libcamera/internal/sensor_database.h\"\n #include \"libcamera/internal/sysfs.h\"\n #include \"libcamera/internal/utils.h\"\n \n@@ -407,6 +408,16 @@ void CameraSensor::initVimcDefaultProperties()\n \tactiveArea_ = Rectangle(pixelArraySize_);\n }\n \n+void CameraSensor::initStaticProperties()\n+{\n+\tconst CameraSensorProperties *props = SensorDatabase::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",
        "v5",
        "2/3"
    ]
}