[{"id":23150,"web_url":"https://patchwork.libcamera.org/comment/23150/","msgid":"<Yo62o4Zt0vLTSZhv@pendragon.ideasonboard.com>","date":"2022-05-25T23:07:15","subject":"Re: [libcamera-devel] [libcamera-devel 1/5] pipeline: rkisp1:\n\tSupport sensor tuning file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Florian,\n\nThank you for the patch.\n\nNitpicking a bit on the naming, I'd write \"Support IPA tuning file\" in\nthe subject line, as the tuning isn't just about the camera sensor.\n\nOn Mon, May 23, 2022 at 11:24:31AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> Allow the usage of a Yaml configuration file that is either defined by\n\nLikewise, here, you can write \"YAML IPA tuning file\".\n\n> the sensor name (sensor_name.yaml) or defined by\n> LIBCAMERA_RKISP1_TUNING_FILE environment variable.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 ++++++++++++-\n>  1 file changed, 12 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 4b3d2cf7..865c4ab0 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -322,7 +322,18 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n>  \tipa_->paramsBufferReady.connect(this, &RkISP1CameraData::paramFilled);\n>  \tipa_->metadataReady.connect(this, &RkISP1CameraData::metadataReady);\n>  \n> -\tint ret = ipa_->init(IPASettings{ \"\", sensor_->model() }, hwRevision);\n> +\t/*\n> +\t * The configuration (tuning file) is made from the sensor name unless\n\nAnd \"The IPA tuning file is made ...\".\n\n> +\t * the environment variable overrides it.\n> +\t */\n> +\tstd::string configurationFile;\n\nI'll let you continue :-)\n\nWith this small issue addressed,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RKISP1_TUNING_FILE\");\n> +\tif (!configFromEnv || *configFromEnv == '\\0')\n> +\t\tconfigurationFile = ipa_->configurationFile(sensor_->model() + \".yaml\");\n> +\telse\n> +\t\tconfigurationFile = std::string(configFromEnv);\n> +\n> +\tint ret = ipa_->init({ configurationFile, sensor_->model() }, hwRevision);\n>  \tif (ret < 0) {\n>  \t\tLOG(RkISP1, Error) << \"IPA initialization failure\";\n>  \t\treturn ret;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 10489BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 May 2022 23:07:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3754865665;\n\tThu, 26 May 2022 01:07:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B1CD460422\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 01:07:21 +0200 (CEST)","from pendragon.ideasonboard.com (ip-109-40-242-63.web.vodafone.de\n\t[109.40.242.63])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0DFEA563;\n\tThu, 26 May 2022 01:07:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653520043;\n\tbh=yC3O6FHkQbpRnAJe58xUn71QmCvNfraN53rznS8aDdQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Pv5NSppdYZzd/wSVjSTw4TpZ0jRbrKy755TMvXwSzbmBO8xgiahzTNHy+6RA8jcf8\n\tZQ/mgbRAHngonHp7OBZ8Sy+Qr3fGI0FAqyODueW90q+EkSzaZuzaj2mCRfiGrKm3bs\n\t4PARPDFhqfMtINx8mWjtHIuHHRwL4tVoFqS9KTd57x17cbK+JOp4AamDTmK51+Tt9t\n\tXyUc1XRsxoc9Ak3nILwf9M7UWrTa+YMIF2arJnwTnVFkLJCGE4eSneGW4SEhpNlISX\n\tXkv03vNuY7ZZFsYDQY0ccjlUg9Fa86YHX23FPQWexUUjltG0uXR1WFqDgyYnF2dQgY\n\t4037g7ok5rbmw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653520041;\n\tbh=yC3O6FHkQbpRnAJe58xUn71QmCvNfraN53rznS8aDdQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QsjrPJvSCX3sDgptxw5PQRuFDkGnLX8AZBEjYoziJpvRHSvwCp91OZqQU5yqlbSt1\n\tFLPCnmIvet+mS0UYEpNlGOLCDe37UIZ54Bxqc5sqSDRPQQIa4p1QERWmxTOEXuW7VI\n\tnjSgmWorMzwJOc7awXyIZGLpofMDCGHWI9XW7yPo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QsjrPJvS\"; dkim-atps=neutral","Date":"Thu, 26 May 2022 02:07:15 +0300","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<Yo62o4Zt0vLTSZhv@pendragon.ideasonboard.com>","References":"<20220523092435.475510-1-fsylvestre@baylibre.com>\n\t<20220523092435.475510-2-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220523092435.475510-2-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [libcamera-devel 1/5] pipeline: rkisp1:\n\tSupport sensor tuning file","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23172,"web_url":"https://patchwork.libcamera.org/comment/23172/","msgid":"<20220527055245.GG4117012@pyrite.rasen.tech>","date":"2022-05-27T05:52:45","subject":"Re: [libcamera-devel] [libcamera-devel 1/5] pipeline: rkisp1:\n\tSupport sensor tuning file","submitter":{"id":97,"url":"https://patchwork.libcamera.org/api/people/97/","name":"Nicolas Dufresne via libcamera-devel","email":"libcamera-devel@lists.libcamera.org"},"content":"Hi Florian,\n\nOn Mon, May 23, 2022 at 11:24:31AM +0200, Florian Sylvestre via libcamera-devel wrote:\n> Allow the usage of a Yaml configuration file that is either defined by\n> the sensor name (sensor_name.yaml) or defined by\n> LIBCAMERA_RKISP1_TUNING_FILE environment variable.\n> \n> Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\n\nLooks good.\n\nWith the changes suggested by Laurent,\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 ++++++++++++-\n>  1 file changed, 12 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 4b3d2cf7..865c4ab0 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -322,7 +322,18 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n>  \tipa_->paramsBufferReady.connect(this, &RkISP1CameraData::paramFilled);\n>  \tipa_->metadataReady.connect(this, &RkISP1CameraData::metadataReady);\n>  \n> -\tint ret = ipa_->init(IPASettings{ \"\", sensor_->model() }, hwRevision);\n> +\t/*\n> +\t * The configuration (tuning file) is made from the sensor name unless\n> +\t * the environment variable overrides it.\n> +\t */\n> +\tstd::string configurationFile;\n> +\tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RKISP1_TUNING_FILE\");\n> +\tif (!configFromEnv || *configFromEnv == '\\0')\n> +\t\tconfigurationFile = ipa_->configurationFile(sensor_->model() + \".yaml\");\n> +\telse\n> +\t\tconfigurationFile = std::string(configFromEnv);\n> +\n> +\tint ret = ipa_->init({ configurationFile, sensor_->model() }, hwRevision);\n>  \tif (ret < 0) {\n>  \t\tLOG(RkISP1, Error) << \"IPA initialization failure\";\n>  \t\treturn ret;\n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B9A06BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 May 2022 05:52:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 026CB633A1;\n\tFri, 27 May 2022 07:52:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9C2261FB6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 May 2022 07:52:53 +0200 (CEST)","from pyrite.rasen.tech (softbank036240126034.bbtec.net\n\t[36.240.126.34])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5E29C31A;\n\tFri, 27 May 2022 07:52:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653630776;\n\tbh=ePnF06XDbEtbXcPPvkr5Nb7xa6Rcr4Z/AWXxYbssE3Q=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Kqe4y+fs2kHTTT48iw/jWZpu35P9SAkp/eSpJrUpgfBcsO64BvpYgjGXAA03tTHy3\n\th983ZeIPonXbnot8RzSP3rTeiMmQlkx/a/esAAygKKo9NVBd9bPGdk03sxV7sPPtTP\n\t6NopZ+Dbr3H6zJhva++V7VeVYdAB1bAID7xcxa6UrVOAtnrljWb31h7aw0++HIwCqC\n\tZo536CstHaS9EO/EFvqcaTLIP5Gcc+cVWxTZXQ+2aUk/8eF+g4f5fjG17o3Pfxef/M\n\tmGWnUbtSPbI7+6KJspvcIAd6/04nWh9v23FD0DCMORDLfP/C4nEpbyDJruaKEzNXu0\n\tcE1zy9TwyzB4w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653630773;\n\tbh=ePnF06XDbEtbXcPPvkr5Nb7xa6Rcr4Z/AWXxYbssE3Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QszOH4rtyYF77zN7QVqMOeRcjakXJgMZ3q74pbtHm0RnNoIXECUk1u08W2gnAYI58\n\tbA1bpFLPodXZu2ofs+9t46p9MuWUwz4l+wMwX4sSuDDf9OODRRVtRhSVOkAxZEpU6C\n\tdcWU0Q8hHbCRlRvn1/1fplwLz/Xqt/BvODXlBBDk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QszOH4rt\"; dkim-atps=neutral","Date":"Fri, 27 May 2022 14:52:45 +0900","To":"Florian Sylvestre <fsylvestre@baylibre.com>","Message-ID":"<20220527055245.GG4117012@pyrite.rasen.tech>","References":"<20220523092435.475510-1-fsylvestre@baylibre.com>\n\t<20220523092435.475510-2-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20220523092435.475510-2-fsylvestre@baylibre.com>","Subject":"Re: [libcamera-devel] [libcamera-devel 1/5] pipeline: rkisp1:\n\tSupport sensor tuning file","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>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"paul.elder@ideasonboard.com","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]