{"id":13999,"url":"https://patchwork.libcamera.org/api/1.1/patches/13999/?format=json","web_url":"https://patchwork.libcamera.org/patch/13999/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210930095513.76213-4-jeanmichel.hautbois@ideasonboard.com>","date":"2021-09-30T09:54:58","name":"[libcamera-devel,03/18] ipa: ipu3: Document the IPAIPU3 class","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"f207bc8fda554f442de1554bb4da47f1a68a0174","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13999/mbox/","series":[{"id":2588,"url":"https://patchwork.libcamera.org/api/1.1/series/2588/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2588","date":"2021-09-30T09:54:55","name":"Document IPU3 IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/2588/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13999/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13999/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 9EFB1C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 30 Sep 2021 09:55:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1A261691AC;\n\tThu, 30 Sep 2021 11:55:24 +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 EE5DD69189\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 30 Sep 2021 11:55:17 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:bab4:22c5:662d:e478])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B9E92A8;\n\tThu, 30 Sep 2021 11:55:17 +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=\"SehyQ1Nw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632995717;\n\tbh=yOsB8XT62JX49W8dhh3QMzEYUCAFAnIt6NiUF1eqDns=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=SehyQ1Nwc31LLrYFBAlhr6tPdfrAPoL5P52BMmX7ABtUnNmjIHehnO00lEpfyeBgI\n\tVohZIfDIGRcxpv+6dJPJn2JrtnCxWVP9PGMcsq8ra6TW+h93KgoUYersJz4KGlBGJu\n\t8K7WEoHIO5ZYcTpmWw3NUNT/JQk78ybZVuJVPYwU=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 30 Sep 2021 11:54:58 +0200","Message-Id":"<20210930095513.76213-4-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20210930095513.76213-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20210930095513.76213-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 03/18] ipa: ipu3: Document the IPAIPU3\n\tclass","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":"Clarify the roles and interactions between the pipeline handler events\nand the algorithm calls by documenting all the remaining functions of\nthe class.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp | 65 +++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 62 insertions(+), 3 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex b4c889f1..147b40ab 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -274,7 +274,7 @@ private:\n };\n \n /**\n- * Initialize the IPA module and its controls.\n+ * \\brief Initialize the IPA module and its controls.\n  *\n  * This function receives the camera sensor information from the pipeline\n  * handler, computes the limits of the controls it handles and returns\n@@ -350,8 +350,15 @@ int IPAIPU3::init(const IPASettings &settings,\n \treturn 0;\n }\n \n+/**\n+ * \\brief Perform any processing required before the first frame.\n+ */\n int IPAIPU3::start()\n {\n+\t/*\n+\t * Set the sensors V4L2 controls before the first frame to ensure that\n+\t * we have an expected and known configuration from the start.\n+\t */\n \tsetControls(0);\n \n \treturn 0;\n@@ -491,6 +498,10 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo)\n \treturn 0;\n }\n \n+/**\n+ * \\brief Map the parameters and stats buffers allocated in the Pipeline Handler\n+ * \\param[out] buffers A vector with param and stat buffers\n+ */\n void IPAIPU3::mapBuffers(const std::vector<IPABuffer> &buffers)\n {\n \tfor (const IPABuffer &buffer : buffers) {\n@@ -500,6 +511,10 @@ void IPAIPU3::mapBuffers(const std::vector<IPABuffer> &buffers)\n \t}\n }\n \n+/**\n+ * \\brief Unmap the parameters and stats buffers\n+ * \\param[in] ids A list of buffer ids\n+ */\n void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n {\n \tfor (unsigned int id : ids) {\n@@ -511,6 +526,10 @@ void IPAIPU3::unmapBuffers(const std::vector<unsigned int> &ids)\n \t}\n }\n \n+/**\n+ * \\brief Process events generated by the Pipeline Handler\n+ * \\param[in] event An event sent from Pipeline Handler\n+ */\n void IPAIPU3::processEvent(const IPU3Event &event)\n {\n \tswitch (event.op) {\n@@ -552,12 +571,26 @@ void IPAIPU3::processEvent(const IPU3Event &event)\n \t}\n }\n \n+/**\n+ * \\brief Process a control list for a request from the application\n+ *\n+ * Parse the request to handle any IPA managed controls that were set from the\n+ * application such as manual sensor settings.\n+ */\n void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n \t\t\t      [[maybe_unused]] const ControlList &controls)\n {\n \t/* \\todo Start processing for 'frame' based on 'controls'. */\n }\n \n+/**\n+ * \\brief Fill the ImgU parameter buffer for the next frame\n+ * \\param[in] frame The current frame number\n+ * \\param[inout] params the parameter buffer to update\n+ *\n+ * Algorithms are expected to fill the IPU3 parameter buffer for the next\n+ * frame given their most recent processing of the ImgU statistics.\n+ */\n void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n {\n \t/*\n@@ -580,6 +613,16 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \tqueueFrameAction.emit(frame, op);\n }\n \n+/**\n+ * \\brief Process the statistics generated by the ImgU\n+ * \\param[in] frame The current frame number\n+ * \\param[in] frameTimestamp The current frame timestamp\n+ * \\param[in] stats The IPU3 statistics and ISP results\n+ *\n+ * Parse the most recently processed image statistics from the ImgU. The\n+ * statistics are passed to each algorithm module to run their calculations and\n+ * update their state accordingly.\n+ */\n void IPAIPU3::parseStatistics(unsigned int frame,\n \t\t\t      [[maybe_unused]] int64_t frameTimestamp,\n \t\t\t      [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n@@ -607,6 +650,13 @@ void IPAIPU3::parseStatistics(unsigned int frame,\n \tqueueFrameAction.emit(frame, op);\n }\n \n+/**\n+ * \\brief Handle V4L2 controls for a given \\a frame number\n+ * \\param[in] frame The frame on which the V4L2 controls should be set\n+ *\n+ * Send the desired sensor control values to the Pipeline handler to request\n+ * that they are applied on the Camera sensor.\n+ */\n void IPAIPU3::setControls(unsigned int frame)\n {\n \tIPU3Action op;\n@@ -625,10 +675,15 @@ void IPAIPU3::setControls(unsigned int frame)\n \n } /* namespace ipa::ipu3 */\n \n-/*\n+/**\n  * External IPA module interface\n+ *\n+ * The IPAModuleInfo is required to match an IPA module construction against the\n+ * intented pipeline handler with the module. The API and Pipeline handler\n+ * versions must match the corresponding IPA interface and pipeline handler.\n+ *\n+ * \\sa struct IPAModuleInfo\n  */\n-\n extern \"C\" {\n const struct IPAModuleInfo ipaModuleInfo = {\n \tIPA_MODULE_API_VERSION,\n@@ -637,6 +692,10 @@ const struct IPAModuleInfo ipaModuleInfo = {\n \t\"ipu3\",\n };\n \n+/**\n+ * When matched against with a pipeline handler, the IPAManager will construct\n+ * an IPA instance for each associated Camera.\n+ */\n IPAInterface *ipaCreate()\n {\n \treturn new ipa::ipu3::IPAIPU3();\n","prefixes":["libcamera-devel","03/18"]}