From patchwork Fri Nov 6 10:36:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 10364 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 26699BDB89 for ; Fri, 6 Nov 2020 10:37:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E469C62D37; Fri, 6 Nov 2020 11:37:57 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wZrkKOL4"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3582162D20 for ; Fri, 6 Nov 2020 11:37:57 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6EB9CB16; Fri, 6 Nov 2020 11:37:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1604659076; bh=HqJPpZYPanBud+SdVbPAlSo6TlkyoYl15X4lqV+HJnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wZrkKOL4bGHFBpNWm8oNvdkBrG4h7/2GQ9+wckp+d06+pmJ1+rvRCxCkQx0ivW4wO Q6D8/AwtxzRJNl904Gt5lNf4IeuhziqLo/JXus7gEFxm8ZJNw5/CsICIVbpiABst4t 1EAbWWgVf5wrO5/Qi4+W3FBHDQBtPwVTmlXaGqiA= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Nov 2020 19:36:46 +0900 Message-Id: <20201106103707.49660-17-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201106103707.49660-1-paul.elder@ideasonboard.com> References: <20201106103707.49660-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 16/37] libcamera: IPAProxy: Add isolate parameter to create() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Since IPAProxy implementations now always encapsulate IPA modules, add a parameter to create() to signal if the proxy should isolate the IPA or not. Signed-off-by: Paul Elder Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- No change in v4 No change in v3 Changes in v2: - document isolate argument --- include/libcamera/internal/ipa_proxy.h | 22 +++++++++++----------- src/libcamera/ipa_proxy.cpp | 4 +++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h index 59a5b841..195d2cb4 100644 --- a/include/libcamera/internal/ipa_proxy.h +++ b/include/libcamera/internal/ipa_proxy.h @@ -42,7 +42,7 @@ public: IPAProxyFactory(const char *name); virtual ~IPAProxyFactory() = default; - virtual std::unique_ptr create(IPAModule *ipam) = 0; + virtual std::unique_ptr create(IPAModule *ipam, bool isolate) = 0; const std::string &name() const { return name_; } @@ -53,16 +53,16 @@ private: std::string name_; }; -#define REGISTER_IPA_PROXY(proxy) \ -class proxy##Factory final : public IPAProxyFactory \ -{ \ -public: \ - proxy##Factory() : IPAProxyFactory(#proxy) {} \ - std::unique_ptr create(IPAModule *ipam) \ - { \ - return std::make_unique(ipam); \ - } \ -}; \ +#define REGISTER_IPA_PROXY(proxy) \ +class proxy##Factory final : public IPAProxyFactory \ +{ \ +public: \ + proxy##Factory() : IPAProxyFactory(#proxy) {} \ + std::unique_ptr create(IPAModule *ipam, bool isolate) \ + { \ + return std::make_unique(ipam, isolate); \ + } \ +}; \ static proxy##Factory global_##proxy##Factory; } /* namespace libcamera */ diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp index 23be24ad..ee5e6f3e 100644 --- a/src/libcamera/ipa_proxy.cpp +++ b/src/libcamera/ipa_proxy.cpp @@ -250,10 +250,12 @@ IPAProxyFactory::IPAProxyFactory(const char *name) * \fn IPAProxyFactory::create() * \brief Create an instance of the IPAProxy corresponding to the factory * \param[in] ipam The IPA module + * \param[in] isolate Flag to isolate the IPA module * * This virtual function is implemented by the REGISTER_IPA_PROXY() macro. * It creates a IPAProxy instance that isolates an IPA interface designated - * by the IPA module \a ipam. + * by the IPA module \a ipam. If \a isolate is true, then the IPA module will + * be isolated. * * \return A pointer to a newly constructed instance of the IPAProxy subclass * corresponding to the factory