[{"id":2976,"web_url":"https://patchwork.libcamera.org/comment/2976/","msgid":"<20191028105045.GC20198@bigcity.dyn.berto.se>","date":"2019-10-28T10:50:45","subject":"Re: [libcamera-devel] [PATCH v2] ipa: Allow forcing usage of C API\n\tthough environment","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2019-10-27 13:59:22 +0100, Jacopo Mondi wrote:\n> Parse the 'LIBCAMERA_IPA_FORCE_C_API' environment variable that allows\n> forcing the usage of the IPA C API even if it's possible to short-circuit\n> it through the ipa_context_ops get_interface() operation.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/ipa_context_wrapper.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> index 736082e9b068..b178418eb9b8 100644\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ b/src/libcamera/ipa_context_wrapper.cpp\n> @@ -9,6 +9,8 @@\n> \n>  #include <libcamera/controls.h>\n> \n> +#include \"utils.h\"\n> +\n>  /**\n>   * \\file ipa_context_wrapper.h\n>   * \\brief Image Processing Algorithm context wrapper\n> @@ -41,7 +43,13 @@ namespace libcamera {\n>  IPAContextWrapper::IPAContextWrapper(struct ipa_context *context)\n>  \t: ctx_(context)\n>  {\n> -\tif (ctx_ && ctx_->ops->get_interface) {\n> +\tint skipIntf = 0;\n> +\tconst char *skipIntfEnv =\n> +\t\t\tutils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n> +\tif (skipIntfEnv)\n> +\t\tskipIntf = !!atoi(skipIntfEnv);\n> +\n> +\tif (!skipIntf && ctx_ && ctx_->ops->get_interface) {\n>  \t\tintf_ = reinterpret_cast<IPAInterface *>(ctx_->ops->get_interface(ctx_));\n>  \t\tintf_->queueFrameAction.connect(this, &IPAContextWrapper::queueFrameAction);\n>  \t} else {\n> --\n> 2.23.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC16D6017E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 11:50:46 +0100 (CET)","by mail-lf1-x143.google.com with SMTP id q28so7424693lfa.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 03:50:46 -0700 (PDT)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\td16sm4899763ljh.74.2019.10.28.03.50.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 28 Oct 2019 03:50:45 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=y4CiQXWYy7XAlmRSyXeyqM2P0HLKGgGVd18oEpRsIl4=;\n\tb=A3d6+hOKOfpAhWunAMZ33gtWQ+bbvaiC4gG/gUXVHmlAwspSTKnmhB31dSad1sxrc+\n\tPhF07p8IbYpJJ+ePBt/PDgFbguROTGylYoMFa3jspBa/g/NT86+GOGi02a6jRpaXXgX0\n\tCdxdcQEBxO54v1Z/yDbzhBVlUbRMBGbu72YWuTPBkqyGgEugoMSbFsCjo81S3Lhp1eR/\n\t1sfUIILCQD9bJ880Hbh4iEalQS8dwin2pdHOWAjMVUjLuDkzSsCpTK9i029FM4fQ8KIw\n\tkHO6lN/quVis5hNTUkQwLigR88rNmBLQnrHDZ77eV0LyM6tK3NyXdHkEJt8hClUVwPo+\n\tD5rA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=y4CiQXWYy7XAlmRSyXeyqM2P0HLKGgGVd18oEpRsIl4=;\n\tb=KFh5JDc9lyHtDfNFFUUoNoZun0BvvCOylwZhWtpHxhoJv1z2oxhH4pj+uEymHt/OCh\n\t23NYgtfDdnm4NHQPcE+GgRWaujHue5vUDgpmwp/iXfXoVC2XIHcilpaqA9B6VvOTsNVk\n\tC/QBWW7WapAlhb17eM5RiSHmrKdPu+ff3kkmZIRXHhi4aY9z8OPJETf8aCcz6RuMKqY0\n\tAwed1AfzHLI+YkM/eGFnpuLHC5FWvOGb1O3tU/pMMuazj0WBtY362gFvJ6nLCZUt1pSe\n\ttJF4M59LclfUKR2hDtetEp9xEI3tdXxtd5/GSl+O+IfGfXdcKlh1g+keBR5Xfm64R1gs\n\tHnWA==","X-Gm-Message-State":"APjAAAVLpVNFzw/yqVai3iTH06pusxc8zwsa5pG7SdKd7FuzgefYVAso\n\tBdk9cY7/KIEPiUtNqTPivGgCb555sz8=","X-Google-Smtp-Source":"APXvYqxVZzIusZZkrcP2vkWJDkmINJyuSfcP/kLUsQx5G9ljmx6u7oqkGGCLLKE4y1S7ytA6KOldSA==","X-Received":"by 2002:a19:3f0a:: with SMTP id\n\tm10mr11428971lfa.67.1572259846220; \n\tMon, 28 Oct 2019 03:50:46 -0700 (PDT)","Date":"Mon, 28 Oct 2019 11:50:45 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191028105045.GC20198@bigcity.dyn.berto.se>","References":"<20191027125922.12219-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191027125922.12219-1-jacopo@jmondi.org>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2] ipa: Allow forcing usage of C API\n\tthough environment","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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, 28 Oct 2019 10:50:46 -0000"}}]