From patchwork Sun Oct 27 12:59:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 2230 X-Patchwork-Delegate: jacopo@jmondi.org Return-Path: Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6FAF561376 for ; Sun, 27 Oct 2019 13:57:34 +0100 (CET) X-Originating-IP: 93.2.121.143 Received: from uno.localdomain (143.121.2.93.rev.sfr.net [93.2.121.143]) (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C9E4920004; Sun, 27 Oct 2019 12:57:33 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sun, 27 Oct 2019 13:59:22 +0100 Message-Id: <20191027125922.12219-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] ipa: Allow forcing usage of C API though environment 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: , X-List-Received-Date: Sun, 27 Oct 2019 12:57:34 -0000 Parse the 'LIBCAMERA_IPA_FORCE_C_API' environment variable that allows forcing the usage of the IPA C API even if it's possible to short-circuit it through the ipa_context_ops get_interface() operation. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/ipa_context_wrapper.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp index 736082e9b068..b178418eb9b8 100644 --- a/src/libcamera/ipa_context_wrapper.cpp +++ b/src/libcamera/ipa_context_wrapper.cpp @@ -9,6 +9,8 @@ #include +#include "utils.h" + /** * \file ipa_context_wrapper.h * \brief Image Processing Algorithm context wrapper @@ -41,7 +43,13 @@ namespace libcamera { IPAContextWrapper::IPAContextWrapper(struct ipa_context *context) : ctx_(context) { - if (ctx_ && ctx_->ops->get_interface) { + int skipIntf = 0; + const char *skipIntfEnv = + utils::secure_getenv("LIBCAMERA_IPA_FORCE_C_API"); + if (skipIntfEnv) + skipIntf = !!atoi(skipIntfEnv); + + if (!skipIntf && ctx_ && ctx_->ops->get_interface) { intf_ = reinterpret_cast(ctx_->ops->get_interface(ctx_)); intf_->queueFrameAction.connect(this, &IPAContextWrapper::queueFrameAction); } else {