{"id":1661,"url":"https://patchwork.libcamera.org/api/1.1/patches/1661/?format=json","web_url":"https://patchwork.libcamera.org/patch/1661/","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":"<20190711185047.11671-3-paul.elder@ideasonboard.com>","date":"2019-07-11T18:50:41","name":"[libcamera-devel,v4,2/8] libcamera: ipa_module: add isOpenSource","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"73e6bd8fe7feef2958fe287f8f40cf4532992d4a","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1661/mbox/","series":[{"id":420,"url":"https://patchwork.libcamera.org/api/1.1/series/420/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=420","date":"2019-07-11T18:50:39","name":"Add IPA process isolation","version":4,"mbox":"https://patchwork.libcamera.org/series/420/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1661/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1661/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D793860BC8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Jul 2019 20:51:07 +0200 (CEST)","from neptunite.amanokami.net (softbank126163157105.bbtec.net\n\t[126.163.157.105])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 89D8B31C;\n\tThu, 11 Jul 2019 20:51:06 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1562871067;\n\tbh=o9wA7F2M8MqSKml05Uk3iGKZlmjeZKKBMDFS0trE3FI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qmKUkSjFAD0GkgNSYAivyOyFPPew7cE9C7Eh+QHsXGzb7Ej/7rBj7d1FhoLhZxtwm\n\tdxxWxNPCosOhwRKoDdp5eiu2bmWpa009mmVkkDid2rUiHmNa8a03EfFn2EcKEcYwSr\n\tErJSmw/ZlKZDz/seXCEWuV88HTuz9txGyfAtHiwY=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 12 Jul 2019 03:50:41 +0900","Message-Id":"<20190711185047.11671-3-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190711185047.11671-1-paul.elder@ideasonboard.com>","References":"<20190711185047.11671-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 2/8] libcamera: ipa_module: add\n\tisOpenSource","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":"Thu, 11 Jul 2019 18:51:08 -0000"},"content":"Add a method to IPAModule to check if the module is open source.\nThis uses the license field of the member IPAModuleInfo.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\nNew in v4\n\n src/libcamera/include/ipa_module.h |  2 ++\n src/libcamera/ipa_module.cpp       | 23 +++++++++++++++++++++++\n 2 files changed, 25 insertions(+)","diff":"diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h\nindex b88ae5d..18e9223 100644\n--- a/src/libcamera/include/ipa_module.h\n+++ b/src/libcamera/include/ipa_module.h\n@@ -35,6 +35,8 @@ public:\n \tbool match(PipelineHandler *pipe,\n \t\t   uint32_t minVersion, uint32_t maxVersion) const;\n \n+\tbool isOpenSource() const;\n+\n private:\n \tstruct IPAModuleInfo info_;\n \ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 9cead71..788915e 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -7,6 +7,7 @@\n \n #include \"ipa_module.h\"\n \n+#include <algorithm>\n #include <dlfcn.h>\n #include <elf.h>\n #include <errno.h>\n@@ -469,4 +470,26 @@ bool IPAModule::match(PipelineHandler *pipe,\n \t       !strcmp(info_.pipelineName, pipe->name());\n }\n \n+/**\n+ * \\brief Verify if the IPA module is open source\n+ *\n+ * \\sa IPAModuleInfo::license\n+ */\n+bool IPAModule::isOpenSource() const\n+{\n+\tstatic std::vector<const char *> osLicenses = {\n+\t\t\"GPL-2.0-only\",\n+\t\t\"GPL-2.0-or-later\",\n+\t\t\"GPL-3.0-only\",\n+\t\t\"GPL-3.0-or-later\",\n+\t\t\"LGPL-2.1-only\",\n+\t\t\"LGPL-2.1-or-later\",\n+\t\t\"LGPL-3.0-only\",\n+\t\t\"LGPL-3.0-or-later\",\n+\t};\n+\n+\treturn std::find(osLicenses.begin(), osLicenses.end(), info_.license)\n+\t       != osLicenses.end();\n+}\n+\n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v4","2/8"]}