{"id":16895,"url":"https://patchwork.libcamera.org/api/1.1/patches/16895/?format=json","web_url":"https://patchwork.libcamera.org/patch/16895/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220802100955.1546-2-laurent.pinchart@ideasonboard.com>","date":"2022-08-02T10:09:52","name":"[libcamera-devel,RFC,1/4] pipeline: ipu3: Support IPA tuning file","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"853aba5375e7affcb09a373d2b67325469f87bab","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16895/mbox/","series":[{"id":3356,"url":"https://patchwork.libcamera.org/api/1.1/series/3356/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3356","date":"2022-08-02T10:09:51","name":"Add tuning data file support to the IPU3 IPA module","version":1,"mbox":"https://patchwork.libcamera.org/series/3356/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16895/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16895/checks/","tags":{},"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 B0319C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Aug 2022 10:10:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E04A6330F;\n\tTue,  2 Aug 2022 12:10:04 +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 07989603E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Aug 2022 12:10:01 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 86B0825B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Aug 2022 12:10:01 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659435004;\n\tbh=oWAkIFHOz/8cIGh+i21SzJWnGgMMwxg2/GO4mdnw/Vw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=rsw6aKPS78LYa/V+N6EZVJoN6bDCpINunDetFOlKJptG5IFd153kAHH+kMo58ihzw\n\tP7XYENM4leJW0Ol1QP+JV0UwlCLhIST729z5shEuyfQghAWukTqDCUf2hJ+cDkWTPP\n\t8G+EV6hoYLFGpx7OvzOMIvG3hXO/YjAje8r8R6Xrfz9BiXwosAzCTxbMh6JD00jKHX\n\tGcwaTX4ex+wzD1Lr+XPQrYhZ2xPVHivfMbU+POliylt8iCcmpjQbCybc5oOjscOv0Y\n\tRyl63T8ZOLTS7yvd+QPVTPSVd/0kwMORJlQYLOQLNkl6UqeG9R0GWtPJ1PkfsO9jzl\n\tgB4+5J7e1l5aQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659435001;\n\tbh=oWAkIFHOz/8cIGh+i21SzJWnGgMMwxg2/GO4mdnw/Vw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=uhD3/mRU8+WUobM2wvzde6v9E4SN+74bLiVzYXjC5hQUTxy+AWuRM4GXPgWHPuaGQ\n\toWTGcGyDwA7RWuEU/o6M5TYweI+WFc3pj9u6nd3ISgnv2sD0R2eeFu7lOcT/WPx84k\n\tO/oxB7IEuTpfEJ7jlWhJRpO+j4D/GhLhSwmLgk9o="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"uhD3/mRU\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  2 Aug 2022 13:09:52 +0300","Message-Id":"<20220802100955.1546-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20220802100955.1546-1-laurent.pinchart@ideasonboard.com>","References":"<20220802100955.1546-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 1/4] pipeline: ipu3: Support IPA\n\ttuning 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Pass the path name of the YAML IPA tuning file to the IPA module. The\nfile name is derived from the sensor name (\"${sensor_name}.yaml\"), with\na fallback to \"uncalibrated.yaml\".\n\nThe tuning file name can be manually overridden with the\nLIBCAMERA_IPU3_TUNING_FILE environment variable.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 22 ++++++++++++++++++++--\n 1 file changed, 20 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 4fe52f74a68c..5c4a0a567ff2 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1243,8 +1243,26 @@ int IPU3CameraData::loadIPA()\n \tif (ret)\n \t\treturn ret;\n \n-\tret = ipa_->init(IPASettings{ \"\", sensor->model() }, sensorInfo,\n-\t\t\t sensor->controls(), &ipaControls_);\n+\t/*\n+\t * The API tuning file is made from the sensor name unless the\n+\t * environment variable overrides it. If\n+\t */\n+\tstd::string ipaTuningFile;\n+\tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_IPU3_TUNING_FILE\");\n+\tif (!configFromEnv || *configFromEnv == '\\0') {\n+\t\tipaTuningFile = ipa_->configurationFile(sensor->model() + \".yaml\");\n+\t\t/*\n+\t\t * If the tuning file isn't found, fall back to the\n+\t\t * 'uncalibrated' configuration file.\n+\t\t */\n+\t\tif (ipaTuningFile.empty())\n+\t\t\tipaTuningFile = ipa_->configurationFile(\"uncalibrated.yaml\");\n+\t} else {\n+\t\tipaTuningFile = std::string(configFromEnv);\n+\t}\n+\n+\tret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n+\t\t\t sensorInfo, sensor->controls(), &ipaControls_);\n \tif (ret) {\n \t\tLOG(IPU3, Error) << \"Failed to initialise the IPU3 IPA\";\n \t\treturn ret;\n","prefixes":["libcamera-devel","RFC","1/4"]}