Patch Detail
Show a patch.
GET /api/1.1/patches/1321/?format=api
{ "id": 1321, "url": "https://patchwork.libcamera.org/api/1.1/patches/1321/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1321/", "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": "<20190527223540.21855-4-paul.elder@ideasonboard.com>", "date": "2019-05-27T22:35:35", "name": "[libcamera-devel,3/8] libcamera: ipa_module_info: update struct to allow IPA matching", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c8232dae003fc74f1c4eadcc837ebba637ebadbd", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1321/mbox/", "series": [ { "id": 330, "url": "https://patchwork.libcamera.org/api/1.1/series/330/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=330", "date": "2019-05-27T22:35:32", "name": "Add IPAManager and IPAInterface", "version": 1, "mbox": "https://patchwork.libcamera.org/series/330/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1321/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1321/checks/", "tags": {}, "headers": { "Return-Path": "<paul.elder@ideasonboard.com>", "Received": [ "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 C849261900\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 May 2019 00:35:49 +0200 (CEST)", "from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1BDAFE3A;\n\tTue, 28 May 2019 00:35:49 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1558996549;\n\tbh=3Eu9etsIboKB6nzpduE0D+OcfjXtT9Fg2CDoIPgbnjM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=NNjghaz8Yxb8JLEfxYQlWYTTpbW4WPVhGVwHyABLB2mn2yihx+1+gk6xjQKUGAApG\n\trxbV3I8pbxGeq0E+aG0lbKKk+HF2dtCkhVAsSUf2vmo3ZPdZmei1O4TuGw366d5Vv9\n\tPfYy4/BDPjSB0Rzb/2a0ublp1BRSWtk1h4/ehURY=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 27 May 2019 18:35:35 -0400", "Message-Id": "<20190527223540.21855-4-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190527223540.21855-1-paul.elder@ideasonboard.com>", "References": "<20190527223540.21855-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 3/8] libcamera: ipa_module_info: update\n\tstruct to allow IPA matching", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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>", "X-List-Received-Date": "Mon, 27 May 2019 22:35:51 -0000" }, "content": "We need a way to match pipelines with IPA modules, so add fields in\nIPAModuleInfo to hold the IPA API version number, the pipeline name, and\nthe pipeline major and minor version.\n\nAlso update IPA module tests and Doxygen accordingly. Doxygen needs to\nbe updated to accomodate __attribute__((packed)).\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n Documentation/Doxyfile.in | 7 ++--\n include/libcamera/ipa/ipa_module_info.h | 11 ++++--\n src/libcamera/ipa_module.cpp | 48 +++++++++++++++++++++----\n test/ipa/ipa_test.cpp | 45 ++++++++++++++++++-----\n test/ipa/shared_test.cpp | 4 ++-\n 5 files changed, 94 insertions(+), 21 deletions(-)", "diff": "diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in\nindex 67eaded..ac70efb 100644\n--- a/Documentation/Doxyfile.in\n+++ b/Documentation/Doxyfile.in\n@@ -2016,7 +2016,7 @@ ENABLE_PREPROCESSING = YES\n # The default value is: NO.\n # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n \n-MACRO_EXPANSION = NO\n+MACRO_EXPANSION = YES\n \n # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n # the macro expansion is limited to the macros specified with the PREDEFINED and\n@@ -2024,7 +2024,7 @@ MACRO_EXPANSION = NO\n # The default value is: NO.\n # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n \n-EXPAND_ONLY_PREDEF = NO\n+EXPAND_ONLY_PREDEF = YES\n \n # If the SEARCH_INCLUDES tag is set to YES, the include files in the\n # INCLUDE_PATH will be searched if a #include is found.\n@@ -2057,7 +2057,8 @@ INCLUDE_FILE_PATTERNS = *.h\n # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n \n PREDEFINED = __DOXYGEN__ \\\n- __cplusplus\n+ __cplusplus \\\n+ __attribute__(x)=\n \n # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n # tag can be used to specify a list of macro names that should be expanded. The\ndiff --git a/include/libcamera/ipa/ipa_module_info.h b/include/libcamera/ipa/ipa_module_info.h\nindex 4e0d668..84492ed 100644\n--- a/include/libcamera/ipa/ipa_module_info.h\n+++ b/include/libcamera/ipa/ipa_module_info.h\n@@ -7,14 +7,21 @@\n #ifndef __LIBCAMERA_IPA_MODULE_INFO_H__\n #define __LIBCAMERA_IPA_MODULE_INFO_H__\n \n+#include <stdint.h>\n+\n+#define IPA_MODULE_API_VERSION 1\n+\n #ifdef __cplusplus\n namespace libcamera {\n #endif\n \n struct IPAModuleInfo {\n+\tint moduleAPIVersion;\n+\tint pipelineVersionMajor;\n+\tint pipelineVersionMinor;\n+\tchar pipelineName[256];\n \tchar name[256];\n-\tunsigned int version;\n-};\n+} __attribute__((packed));\n \n #ifdef __cplusplus\n extern \"C\" {\ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 86cbe71..6e68934 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -169,6 +169,17 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize,\n \n } /* namespace */\n \n+/**\n+ * \\def IPA_MODULE_API_VERSION\n+ * \\brief The IPA API version\n+ *\n+ * This version number specifies the version for the layout of\n+ * struct IPAModuleInfo, and the API between pipeline handlers and the IPA.\n+ * The IPA module should use this macro to define its moduleAPIVersion field.\n+ *\n+ * \\sa libcamera::IPAModuleInfo::moduleAPIVersion\n+ */\n+\n /**\n * \\struct IPAModuleInfo\n * \\brief Information of an IPA module\n@@ -176,14 +187,39 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize,\n * This structure contains the information of an IPA module. It is loaded,\n * read, and validated before anything else is loaded from the shared object.\n *\n- * \\var IPAModuleInfo::name\n- * \\brief The name of the IPA module\n+ * \\var IPAModuleInfo::moduleAPIVersion\n+ * \\brief The IPA API version that the IPA module was made with\n+ *\n+ * This version number specifies the version for the layout of\n+ * struct IPAModuleInfo, and the API between pipeline handlers and the IPA.\n+ * The IPA module shall report here the version that it was built for,\n+ * using the macro IPA_MODULE_API_VERSION.\n *\n- * \\var IPAModuleInfo::version\n- * \\brief The version of the IPA module\n+ * \\sa IPA_MODULE_API_VERSION\n *\n- * \\todo abi compatability version\n- * \\todo pipeline compatability matcher\n+ * \\var IPAModuleInfo::pipelineVersionMajor\n+ * \\brief The pipeline handler version (major) that the IPA module is for\n+ * \\todo actually match the pipeline handler against this\n+ *\n+ * The major version of the module and pipeline handler must be equal in\n+ * order for the pipeline handler and the module to be matched.\n+ *\n+ * \\var IPAModuleInfo::pipelineVersionMinor\n+ * \\brief The pipeline handler version (minor) that the IPA module is for\n+ *\n+ * The minor version of the module must be equal to or greater than\n+ * the pipeline handler minor version in order for the pipeline handler\n+ * and the module to be matched.\n+ *\n+ * \\var IPAModuleInfo::pipelineName\n+ * \\brief The name of the pipeline handler that the IPA module is for\n+ *\n+ * This name is used to match a pipeline handler with the module.\n+ * The name of the pipeline handler is declared in the pipeline handler\n+ * with the macro REGISTER_PIPELINE_HANDLER.\n+ *\n+ * \\var IPAModuleInfo::name\n+ * \\brief The name of the IPA module\n */\n \n /**\ndiff --git a/test/ipa/ipa_test.cpp b/test/ipa/ipa_test.cpp\nindex 2dbc702..f50880e 100644\n--- a/test/ipa/ipa_test.cpp\n+++ b/test/ipa/ipa_test.cpp\n@@ -33,20 +33,45 @@ protected:\n \n \t\tconst struct IPAModuleInfo &info = ll->info();\n \n-\t\tif (strcmp(info.name, testInfo.name)) {\n-\t\t\tcerr << \"test IPA module has incorrect name\" << endl;\n-\t\t\tcerr << \"expected \\\"\" << testInfo.name << \"\\\", got \\\"\"\n-\t\t\t << info.name << \"\\\"\" << endl;\n+\t\tstringstream errString;\n+\n+\t\tif (info.moduleAPIVersion != testInfo.moduleAPIVersion) {\n+\t\t\terrString << \"incorrect name: expected \\\"\"\n+\t\t\t\t << testInfo.moduleAPIVersion << \"\\\", got \\\"\"\n+\t\t\t\t << info.moduleAPIVersion << \"\\\"\" << endl;\n \t\t\tret = -1;\n \t\t}\n \n-\t\tif (info.version != testInfo.version) {\n-\t\t\tcerr << \"test IPA module has incorrect version\" << endl;\n-\t\t\tcerr << \"expected \\\"\" << testInfo.version << \"\\\", got \\\"\"\n-\t\t\t << info.version << \"\\\"\" << endl;\n+\t\tif (info.pipelineVersionMajor != testInfo.pipelineVersionMajor) {\n+\t\t\terrString << \"incorrect name: expected \\\"\"\n+\t\t\t\t << testInfo.pipelineVersionMajor << \"\\\", got \\\"\"\n+\t\t\t\t << info.pipelineVersionMajor << \"\\\"\" << endl;\n \t\t\tret = -1;\n \t\t}\n \n+\t\tif (info.pipelineVersionMinor != testInfo.pipelineVersionMinor) {\n+\t\t\terrString << \"incorrect name: expected \\\"\"\n+\t\t\t\t << testInfo.pipelineVersionMinor << \"\\\", got \\\"\"\n+\t\t\t\t << info.pipelineVersionMinor << \"\\\"\" << endl;\n+\t\t\tret = -1;\n+\t\t}\n+\n+\t\tif (strcmp(info.pipelineName, testInfo.pipelineName)) {\n+\t\t\terrString << \"incorrect name: expected \\\"\"\n+\t\t\t\t << testInfo.pipelineName << \"\\\", got \\\"\"\n+\t\t\t\t << info.pipelineName << \"\\\"\" << endl;\n+\t\t\tret = -1;\n+\t\t}\n+\n+\t\tif (strcmp(info.name, testInfo.name)) {\n+\t\t\terrString << \"incorrect name: expected \\\"\"\n+\t\t\t\t << testInfo.name << \"\\\", got \\\"\"\n+\t\t\t\t << info.name << \"\\\"\" << endl;\n+\t\t\tret = -1;\n+\t\t}\n+\n+\t\tcerr << errString.str();\n+\n \t\tdelete ll;\n \t\treturn ret;\n \t}\n@@ -56,8 +81,10 @@ protected:\n \t\tint count = 0;\n \n \t\tconst struct IPAModuleInfo testInfo = {\n+\t\t\t1,\n+\t\t\t0, 9001,\n+\t\t\t\"bleep\",\n \t\t\t\"It's over nine thousand!\",\n-\t\t\t9001,\n \t\t};\n \n \t\tcount += runTest(\"test/ipa/ipa-dummy-cpp.so\", testInfo);\ndiff --git a/test/ipa/shared_test.cpp b/test/ipa/shared_test.cpp\nindex 4e5c976..d932a9b 100644\n--- a/test/ipa/shared_test.cpp\n+++ b/test/ipa/shared_test.cpp\n@@ -4,8 +4,10 @@ namespace libcamera {\n \n extern \"C\" {\n const struct libcamera::IPAModuleInfo ipaModuleInfo = {\n+\t1,\n+\t0, 9001,\n+\t\"bleep\",\n \t\"It's over nine thousand!\",\n-\t9001,\n };\n };\n \n", "prefixes": [ "libcamera-devel", "3/8" ] }