From patchwork Tue Jul 9 18:44:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 1634 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 52AC061570 for ; Tue, 9 Jul 2019 20:45:01 +0200 (CEST) Received: from neptunite.amanokami.net (softbank126163157105.bbtec.net [126.163.157.105]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EB748596; Tue, 9 Jul 2019 20:44:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1562697901; bh=iHO6yueEo51THISUS4htP8k32lxYxqjE7WqxHJ3r2MA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GCPumx3IWJA6+PlcRdGcem+0SiqqSVx3tbfyYYornwlf6Tk3I5dX0wX/zrMUb1lc7 pwfFRN9emOvHdf3mGLo03BbjrogfiSDE4CMOhXjuH3Py1KOqh9weEFfaVa8TNgt3Dz L7gytPvjF8ScSr7LSU6M0NiDLngPfYAsw6rLUVwg= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Jul 2019 03:44:44 +0900 Message-Id: <20190709184450.32023-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709184450.32023-1-paul.elder@ideasonboard.com> References: <20190709184450.32023-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/7] libcamera: ipa_module_info: add license field X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2019 18:45:01 -0000 Add a field to IPAModuleInfo to contain the license of the module. This license field will be used to determine whether the IPA module should be run in an isolated process or not. If the license is open source, then the IPA module will be allowed to run without process isolation, if the user enables it. If the license is not open source, then the IPA module will be run with process isolation. Update the dummy IPA and IPA test to conform to the new struct layout. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - make license field SPDX New patch in v2 - this replaces the isolate flag that was used in v1 include/libcamera/ipa/ipa_module_info.h | 1 + src/ipa/ipa_dummy.cpp | 1 + src/libcamera/ipa_module.cpp | 21 +++++++++++++++++++++ test/ipa/ipa_test.cpp | 1 + 4 files changed, 24 insertions(+) diff --git a/include/libcamera/ipa/ipa_module_info.h b/include/libcamera/ipa/ipa_module_info.h index 585f753..d9e33c1 100644 --- a/include/libcamera/ipa/ipa_module_info.h +++ b/include/libcamera/ipa/ipa_module_info.h @@ -18,6 +18,7 @@ struct IPAModuleInfo { uint32_t pipelineVersion; char pipelineName[256]; char name[256]; + char license[64]; } __attribute__((packed)); extern "C" { diff --git a/src/ipa/ipa_dummy.cpp b/src/ipa/ipa_dummy.cpp index ee7a3a8..4c8b665 100644 --- a/src/ipa/ipa_dummy.cpp +++ b/src/ipa/ipa_dummy.cpp @@ -34,6 +34,7 @@ const struct IPAModuleInfo ipaModuleInfo = { 0, "PipelineHandlerVimc", "Dummy IPA for Vimc", + "LGPL-2.1-or-later", }; IPAInterface *ipaCreate() diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index d2e3c36..06111c0 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -214,6 +214,27 @@ elfLoadSymbol(void *map, size_t soSize, const char *symbol) * * \var IPAModuleInfo::name * \brief The name of the IPA module + * + * \var IPAModuleInfo::license + * \brief License of the IPA module + * + * This license is used to determine whether to isolate the IPA in a + * separate process. If the license is "Proprietary", then the IPA will + * be isolated. The license should be an SPDX license string. The following + * licenses are currently available to allow the IPA to run unisolated: + * + * - GPL-2.0-only + * - GPL-2.0-or-later + * - GPL-3.0-only + * - GPL-3.0-or-later + * - LGPL-2.1-only + * - LGPL-2.1-or-later + * - LGPL-3.0-only + * - LGPL-3.0-or-later + * + * Any other license will cause the IPA to be run isolated. + * + * \todo Allow user to choose to isolated open source IPAs */ /** diff --git a/test/ipa/ipa_test.cpp b/test/ipa/ipa_test.cpp index bbef069..b9e1bd6 100644 --- a/test/ipa/ipa_test.cpp +++ b/test/ipa/ipa_test.cpp @@ -59,6 +59,7 @@ protected: 0, "PipelineHandlerVimc", "Dummy IPA for Vimc", + "GPL-2.0-or-later", }; count += runTest("src/ipa/ipa_dummy.so", testInfo);