Patch Detail
Show a patch.
GET /api/1.1/patches/11723/?format=api
{ "id": 11723, "url": "https://patchwork.libcamera.org/api/1.1/patches/11723/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11723/", "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": "<20210325134325.21098-3-jacopo@jmondi.org>", "date": "2021-03-25T13:43:24", "name": "[libcamera-devel,v3,2/3] libcamera: camera_sensor: Register static properties", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "6288120c11f6aad0a78f1443552c1c650e65a29f", "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/11723/mbox/", "series": [ { "id": 1836, "url": "https://patchwork.libcamera.org/api/1.1/series/1836/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1836", "date": "2021-03-25T13:43:22", "name": "libcamera: Add sensor database", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1836/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11723/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11723/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 ED4C0C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Mar 2021 13:42:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B1FE668D9F;\n\tThu, 25 Mar 2021 14:42:59 +0100 (CET)", "from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6775168D7F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Mar 2021 14:42:57 +0100 (CET)", "from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id F0435FF814;\n\tThu, 25 Mar 2021 13:42:56 +0000 (UTC)" ], "X-Originating-IP": "93.61.96.190", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 25 Mar 2021 14:43:24 +0100", "Message-Id": "<20210325134325.21098-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.30.0", "In-Reply-To": "<20210325134325.21098-1-jacopo@jmondi.org>", "References": "<20210325134325.21098-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "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\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/internal/camera_sensor.h | 1 +\n src/libcamera/camera_sensor.cpp | 24 +++++++++++++++++++++-\n 2 files changed, 24 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..c012385ff056 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@@ -266,6 +267,9 @@ int CameraSensor::init()\n \tif (ret)\n \t\treturn ret;\n \n+\t/* Initialize the static properties from the sensor database. */\n+\tinitStaticProperties();\n+\n \tret = initProperties();\n \tif (ret)\n \t\treturn ret;\n@@ -407,6 +411,21 @@ void CameraSensor::initVimcDefaultProperties()\n \tactiveArea_ = Rectangle(pixelArraySize_);\n }\n \n+void CameraSensor::initStaticProperties()\n+{\n+\tconst SensorInfo *info = SensorDatabase::get(model_);\n+\tif (!info) {\n+\t\tLOG(CameraSensor, Warning)\n+\t\t\t<< \"No static properties available for '\" << model_ << \"'\";\n+\t\tLOG(CameraSensor, Warning)\n+\t\t\t<< \"Please consider updating the sensor database\";\n+\t\treturn;\n+\t}\n+\n+\t/* Register the properties retrieved from the sensor database. */\n+\tproperties_.set(properties::UnitCellSize, info->unitCellSize);\n+}\n+\n int CameraSensor::initProperties()\n {\n \t/*\n@@ -444,7 +463,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", "v3", "2/3" ] }