[{"id":15803,"web_url":"https://patchwork.libcamera.org/comment/15803/","msgid":"<YFkJU8VOF7vt+SFY@pendragon.ideasonboard.com>","date":"2021-03-22T21:17:07","subject":"Re: [libcamera-devel] [PATCH 4/7] ipa: raspberrypi: Move the\n\tcontroller initialise to ipa::init()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Wed, Mar 17, 2021 at 10:02:08AM +0000, Naushir Patuck wrote:\n> The controller initialise is a one-off operation, so move it from\n> ipa::configure() to ipa::init().\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/raspberrypi/raspberrypi.cpp | 16 +++++-----------\n>  1 file changed, 5 insertions(+), 11 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 8a9eb92b39ec..e2db0716b84b 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -127,9 +127,6 @@ private:\n>  \tControlInfoMap ispCtrls_;\n>  \tControlList libcameraMetadata_;\n>  \n> -\t/* IPA configuration. */\n> -\tstd::string tuningFile_;\n> -\n>  \t/* Camera sensor params. */\n>  \tCameraMode mode_;\n>  \tCameraMode lastMode_;\n> @@ -166,8 +163,6 @@ private:\n>  \n>  int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConfig)\n>  {\n> -\ttuningFile_ = settings.configurationFile;\n> -\n>  \t/*\n>  \t * Load the \"helper\" for this sensor. This tells us all the device specific stuff\n>  \t * that the kernel driver doesn't. We only do this the first time; we don't need\n> @@ -193,6 +188,10 @@ int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConf\n>  \tsensorConfig->vblankDelay = vblankDelay;\n>  \tsensorConfig->sensorMetadata = sensorMetadata;\n>  \n> +\t/* Load the tuning file for this sensor. */\n> +\tcontroller_.Read(settings.configurationFile.c_str());\n> +\tcontroller_.Initialise();\n> +\n>  \treturn 0;\n>  }\n>  \n> @@ -374,12 +373,7 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t/* Pass the camera mode to the CamHelper to setup algorithms. */\n>  \thelper_->SetCameraMode(mode_);\n>  \n> -\tif (!controllerInit_) {\n> -\t\t/* Load the tuning file for this sensor. */\n> -\t\tcontroller_.Read(tuningFile_.c_str());\n> -\t\tcontroller_.Initialise();\n> -\t\tcontrollerInit_ = true;\n> -\n> +\tif (firstStart_) {\n>  \t\t/* Supply initial values for frame durations. */\n>  \t\tapplyFrameDurations(defaultMinFrameDuration, defaultMaxFrameDuration);\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 225F1BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 Mar 2021 21:17:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 510ED68D62;\n\tMon, 22 Mar 2021 22:17:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8AB4F68D50\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Mar 2021 22:17:49 +0100 (CET)","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 142D7ED;\n\tMon, 22 Mar 2021 22:17:49 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"R5XWt4tT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1616447869;\n\tbh=fTiSpnoECaHXfYvaUhhqaJH/coUm3nhI0jkdJ+EymQ8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=R5XWt4tTqMjV5XjBMutImRahqOevR91LaUiW4hrbD4EL/UoGzWRlrI/i2Q1pql8cN\n\tr7psRpB3W0ZFmg1pSBqmkt+bjNkFj/LZJFUy5Trg0CO8XSSBCl4j6MiaFgLm87Q+6z\n\tNWRTnoGNnnLs0aqDD3rWD2XBdpD58VGFtjv3oRUE=","Date":"Mon, 22 Mar 2021 23:17:07 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YFkJU8VOF7vt+SFY@pendragon.ideasonboard.com>","References":"<20210317100211.1067585-1-naush@raspberrypi.com>\n\t<20210317100211.1067585-5-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210317100211.1067585-5-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 4/7] ipa: raspberrypi: Move the\n\tcontroller initialise to ipa::init()","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]