Patch Detail
Show a patch.
GET /api/1.1/patches/12736/?format=api
{ "id": 12736, "url": "https://patchwork.libcamera.org/api/1.1/patches/12736/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12736/", "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": "<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>", "date": "2021-06-28T20:22:49", "name": "[libcamera-devel,v1,1/7] ipa: libipa: Fixups in CameraSensorHelpers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cca12ddbe5e152dcdb885d078443c418f6f528e1", "submitter": { "id": 75, "url": "https://patchwork.libcamera.org/api/1.1/people/75/?format=api", "name": "Jean-Michel Hautbois", "email": "jeanmichel.hautbois@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12736/mbox/", "series": [ { "id": 2190, "url": "https://patchwork.libcamera.org/api/1.1/series/2190/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2190", "date": "2021-06-28T20:22:48", "name": "ipa: Introduce a new open AGC", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2190/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12736/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12736/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 BDE1CC321F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Jun 2021 20:23:03 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BEE5684D8;\n\tMon, 28 Jun 2021 22:23:03 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EAFC96028C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 22:22:59 +0200 (CEST)", "from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:c3ad:78d0:405e:fc33])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 850C42469;\n\tMon, 28 Jun 2021 22:22:59 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ecW4Ei0D\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624911779;\n\tbh=HLV5ikFkBJGLKW4IBLAbblWhbwLbX0j/IMpYingacCM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ecW4Ei0DCgoJEAAs5XXnX69Euzk9dSwRrbS3BTdWqn4ivc8iC1hXuKSgMdb7RzPw5\n\tXYx6gCFCgG7Keligw7Ijrp8iKKzCzCnlwFcBf+LoKi3SUszjifAamYOeLkow4cRGZV\n\tFQjgkn6Yz6flnaJ1OLzJyjaPRUoNYinfkce+KzUE=", "From": "Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 28 Jun 2021 22:22:49 +0200", "Message-Id": "<20210628202255.138874-2-jeanmichel.hautbois@ideasonboard.com>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com>", "References": "<20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1 1/7] ipa: libipa: Fixups in\n\tCameraSensorHelpers", "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": "A few lines needed to be wrapped under 80 lines.\nRemove some uneeded documentation and minor typos.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/libipa/camera_sensor_helper.cpp | 79 +++++++++++++------------\n src/ipa/libipa/camera_sensor_helper.h | 32 +++++-----\n 2 files changed, 58 insertions(+), 53 deletions(-)", "diff": "diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\nindex 23335ed6..848842ce 100644\n--- a/src/ipa/libipa/camera_sensor_helper.cpp\n+++ b/src/ipa/libipa/camera_sensor_helper.cpp\n@@ -2,11 +2,12 @@\n /*\n * Copyright (C) 2021, Google Inc.\n *\n- * camera_sensor_helper.cpp - Helper class that performs sensor-specific parameter computations\n+ * camera_sensor_helper.cpp - Helper class that performs sensor-specific\n+ * parameter computations\n */\n #include \"camera_sensor_helper.h\"\n \n-#include \"libcamera/base/log.h\"\n+#include <libcamera/base/log.h>\n \n /**\n * \\file camera_sensor_helper.h\n@@ -29,17 +30,18 @@ namespace ipa {\n \n /**\n * \\class CameraSensorHelper\n- * \\brief Base class for computing sensor tuning parameters using sensor-specific constants\n+ * \\brief Base class for computing sensor tuning parameters using\n+ * sensor-specific constants\n *\n- * Instances derived from CameraSensorHelper class are sensor specific.\n+ * Instances derived from CameraSensorHelper class are sensor-specific.\n * Each supported sensor will have an associated base class defined.\n */\n \n /**\n * \\brief Construct a CameraSensorHelper instance\n *\n- * CameraSensorHelper derived class instances shall never be constructed manually\n- * but always through the CameraSensorHelperFactory::create() method.\n+ * CameraSensorHelper derived class instances shall never be constructed\n+ * manually but always through the CameraSensorHelperFactory::create() method.\n */\n \n /**\n@@ -52,11 +54,11 @@ namespace ipa {\n * The parameters come from the MIPI Alliance Camera Specification for\n * Camera Command Set (CCS).\n *\n- * \\return The gain code to pass to V4l2\n+ * \\return The gain code to pass to V4L2\n */\n uint32_t CameraSensorHelper::gainCode(double gain) const\n {\n-\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n+\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n \n \treturn (analogueGainConstants_.c0 - analogueGainConstants_.c1 * gain) /\n@@ -64,8 +66,8 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n }\n \n /**\n- * \\brief Compute the real gain from the V4l2 subdev control gain code\n- * \\param[in] gainCode The V4l2 subdev control gain\n+ * \\brief Compute the real gain from the V4L2 subdev control gain code\n+ * \\param[in] gainCode The V4L2 subdev control gain\n *\n * This function aims to abstract the calculation of the gain letting the IPA\n * use the real gain for its estimations. It is the counterpart of the function\n@@ -78,7 +80,7 @@ uint32_t CameraSensorHelper::gainCode(double gain) const\n */\n double CameraSensorHelper::gain(uint32_t gainCode) const\n {\n-\tASSERT((analogueGainConstants_.m0 == 0) || (analogueGainConstants_.m1 == 0));\n+\tASSERT(analogueGainConstants_.m0 == 0 || analogueGainConstants_.m1 == 0);\n \tASSERT(analogueGainConstants_.type == AnalogueGainLinear);\n \n \treturn (analogueGainConstants_.m0 * static_cast<double>(gainCode) + analogueGainConstants_.c0) /\n@@ -90,7 +92,7 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n * \\brief The gain calculation modes as defined by the MIPI CCS\n *\n * Describes the image sensor analogue gain capabilities.\n- * Two modes are possible, depending on the sensor: Global and Alternate.\n+ * Two modes are possible, depending on the sensor: Linear and Exponential.\n */\n \n /**\n@@ -114,11 +116,12 @@ double CameraSensorHelper::gain(uint32_t gainCode) const\n \n /**\n * \\var CameraSensorHelper::AnalogueGainExponential\n- * \\brief Gain is computed using exponential gain estimation (introduced in CCS v1.1)\n+ * \\brief Gain is computed using exponential gain estimation\n+ * (introduced in CCS v1.1)\n *\n * Starting with CCS v1.1, Alternate Global Analogue Gain is also available.\n- * If the image sensor supports it, then the global analogue gain can be controlled\n- * by linear and exponential gain formula:\n+ * If the image sensor supports it, then the global analogue gain can be\n+ * controlled by linear and exponential gain formula:\n *\n * \\f$gain = analogLinearGainGlobal * 2^{analogExponentialGainGlobal}\\f$\n * \\todo not implemented in libipa\n@@ -194,11 +197,13 @@ CameraSensorHelperFactory::CameraSensorHelperFactory(const std::string name)\n }\n \n /**\n- * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n+ * \\brief Create an instance of the CameraSensorHelper corresponding to\n+ * a named factory\n * \\param[in] name Name of the factory\n *\n * \\return A unique pointer to a new instance of the CameraSensorHelper subclass\n- * corresponding to the factory\n+ * corresponding to the named factory or a null pointer if no such factory\n+ * exists\n */\n std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std::string &name)\n {\n@@ -220,33 +225,35 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std:\n * \\brief Add a camera sensor helper class to the registry\n * \\param[in] factory Factory to use to construct the camera sensor helper\n *\n- * The caller is responsible to guarantee the uniqueness of the camera sensor helper\n- * name.\n+ * The caller is responsible to guarantee the uniqueness of the camera sensor\n+ * helper name.\n */\n void CameraSensorHelperFactory::registerType(CameraSensorHelperFactory *factory)\n {\n-\tstd::vector<CameraSensorHelperFactory *> &factories = CameraSensorHelperFactory::factories();\n+\tstd::vector<CameraSensorHelperFactory *> &factories =\n+\t\tCameraSensorHelperFactory::factories();\n \n \tfactories.push_back(factory);\n }\n \n /**\n * \\brief Retrieve the list of all camera sensor helper factories\n- *\n- * The static factories map is defined inside the function to ensures it gets\n- * initialized on first use, without any dependency on link order.\n- *\n * \\return The list of camera sensor helper factories\n */\n std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n {\n+\t/* The static factories map is defined inside the function to ensures\n+\t * it gets initialized on first use, without any dependency on link\n+\t * order.\n+\t */\n \tstatic std::vector<CameraSensorHelperFactory *> factories;\n \treturn factories;\n }\n \n /**\n * \\fn CameraSensorHelperFactory::createInstance()\n- * \\brief Create an instance of the CameraSensorHelper corresponding to the factory\n+ * \\brief Create an instance of the CameraSensorHelper corresponding to the\n+ * factory\n *\n * This virtual function is implemented by the REGISTER_CAMERA_SENSOR_HELPER()\n * macro. It creates a camera sensor helper instance associated with the camera\n@@ -267,14 +274,16 @@ std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n * \\param[in] name Sensor model name used to register the class\n * \\param[in] helper Class name of CameraSensorHelper derived class to register\n *\n- * Register a CameraSensorHelper subclass with the factory and make it available to\n- * try and match devices.\n+ * Register a CameraSensorHelper subclass with the factory and make it available\n+ * to try and match sensors.\n */\n \n-/**\n- * \\class CameraSensorHelperImx219\n- * \\brief Create and give helpers for the imx219 sensor\n+/* -----------------------------------------------------------------------------\n+ * Sensor-specific subclasses\n */\n+\n+#ifndef __DOXYGEN__\n+\n class CameraSensorHelperImx219 : public CameraSensorHelper\n {\n public:\n@@ -285,10 +294,6 @@ public:\n };\n REGISTER_CAMERA_SENSOR_HELPER(\"imx219\", CameraSensorHelperImx219)\n \n-/**\n- * \\class CameraSensorHelperOv5670\n- * \\brief Create and give helpers for the ov5670 sensor\n- */\n class CameraSensorHelperOv5670 : public CameraSensorHelper\n {\n public:\n@@ -299,10 +304,6 @@ public:\n };\n REGISTER_CAMERA_SENSOR_HELPER(\"ov5670\", CameraSensorHelperOv5670)\n \n-/**\n- * \\class CameraSensorHelperOv5693\n- * \\brief Create and give helpers for the ov5693 sensor\n- */\n class CameraSensorHelperOv5693 : public CameraSensorHelper\n {\n public:\n@@ -313,6 +314,8 @@ public:\n };\n REGISTER_CAMERA_SENSOR_HELPER(\"ov5693\", CameraSensorHelperOv5693)\n \n+#endif /* __DOXYGEN__ */\n+\n } /* namespace ipa */\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h\nindex 1c47e8d5..a7e4ab3b 100644\n--- a/src/ipa/libipa/camera_sensor_helper.h\n+++ b/src/ipa/libipa/camera_sensor_helper.h\n@@ -30,8 +30,8 @@ public:\n \n protected:\n \tenum AnalogueGainType {\n-\t\tAnalogueGainLinear = 0,\n-\t\tAnalogueGainExponential = 2,\n+\t\tAnalogueGainLinear,\n+\t\tAnalogueGainExponential,\n \t};\n \n \tstruct AnalogueGainConstants {\n@@ -60,24 +60,26 @@ public:\n \tstatic std::vector<CameraSensorHelperFactory *> &factories();\n \n protected:\n-\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n \tvirtual CameraSensorHelper *createInstance() = 0;\n \n+private:\n+\tLIBCAMERA_DISABLE_COPY_AND_MOVE(CameraSensorHelperFactory)\n+\n \tstd::string name_;\n };\n \n-#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t \\\n-class helper##Factory final : public CameraSensorHelperFactory\t \\\n-{ \\\n-public: \\\n-\thelper##Factory() : CameraSensorHelperFactory(name) {}\t \\\n-\t\t\t\t\t\t\t\t \\\n-private: \\\n-\tCameraSensorHelper *createInstance()\t\t\t \\\n-\t{\t\t\t\t\t\t\t \\\n-\t\treturn new helper();\t\t\t\t \\\n-\t}\t\t\t\t\t\t\t \\\n-};\t\t\t\t\t\t\t\t \\\n+#define REGISTER_CAMERA_SENSOR_HELPER(name, helper)\t\t\\\n+class helper##Factory final : public CameraSensorHelperFactory\t\\\n+{\t\t\t\t\t\t\t\t\\\n+public: \t\t\t\t\t\t\t\\\n+\thelper##Factory() : CameraSensorHelperFactory(name) {}\t\\\n+\t\t\t\t\t\t\t\t\\\n+private:\t\t\t\t\t\t\t\\\n+\tCameraSensorHelper *createInstance()\t\t\t\\\n+\t{\t\t\t\t\t\t\t\\\n+\t\treturn new helper();\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+};\t\t\t\t\t\t\t\t\\\n static helper##Factory global_##helper##Factory;\n \n } /* namespace ipa */\n", "prefixes": [ "libcamera-devel", "v1", "1/7" ] }