From patchwork Wed Mar 17 10:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11602 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 38350BD80C for ; Wed, 17 Mar 2021 10:02:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CEA6268D79; Wed, 17 Mar 2021 11:02:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="L/W8joOr"; dkim-atps=neutral Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A56546084D for ; Wed, 17 Mar 2021 11:02:21 +0100 (CET) Received: by mail-ed1-x52d.google.com with SMTP id bf3so1476120edb.6 for ; Wed, 17 Mar 2021 03:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3j3E0s8hAbb5lYiPxB6D4ErMchd8R4yQ+P49/lrs8E8=; b=L/W8joOr+171BsPkLV1GrjR6sRpaJ5TeW9PzBIHQyZT1qIw/2dOJfnDCSKI0tShkH1 W+kYwbXwQ2kkP9eympQ9+JXN+OoUszurkJPTVj+yR3Od04G7wKWYkxluNufyyal24XDa Yq5Osf9eq4X+0X5vpi1Race7THK2bjEHd2FCnQXvdIIY5tgN4R3MibQ7r3vKJ4YzZjyl RvoRxVtlaIFYP2smmXxIXXpUwHZ8lP6V/EyFXWzO4pcxWcL5Tq4m/AIQv1rCUlFSA/wl NBuesZ/RHkurZIRNDWCpwHQWPHpYq+rCeCMSdadTLBju9ERB+uRUY34Z64MwoAAwdtyq WH2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3j3E0s8hAbb5lYiPxB6D4ErMchd8R4yQ+P49/lrs8E8=; b=svDnp5nQKjewr3DJlQL8HOnOJ+LYlhahsu7qdcOViEGC/q18/NetjLVAX2kZj95EnN McIzxvgQ46B6EmdMjchToIWp4yR+vlGwwy+Jipdu1OMliZXOF1UcXTxGhQ9O73TxN4gL Ykku+Wfese+hWzC1oR6XqZ5lUW7Ci8d9WwJpvvBSR3/leGnlY+MFkkcNwna5RrqGaH4+ mj2ZCYs60kZHd6apLbiMPjg/6K5JJ9YAraFbdVKR2zovHpwa5Xx4PGJk5ps/Vc2r3+lD usfg4ftLtIWdefYulJ/HOWciLKTlJddyj6zGorA62tIAr6xUt/E/RC4pm0bFhRS6t8Pm rwNg== X-Gm-Message-State: AOAM532jIfIy3/XczdfF7gsklheL8k7SWPRQoLIY9m92LPSs/9wjFAWK SZ3UggcCuVtbrnfmGe4IF845pB7/p54ReA== X-Google-Smtp-Source: ABdhPJwa8C/GCAiUcp0NH1ZGwCD6xGy9DIeYCJnp5tDCaxBro3vtmR1LgnAI10VRTPLmvq1j4ux0/Q== X-Received: by 2002:aa7:dbd3:: with SMTP id v19mr40613258edt.314.1615975341096; Wed, 17 Mar 2021 03:02:21 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id p24sm12061179edt.5.2021.03.17.03.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 03:02:20 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Mar 2021 10:02:08 +0000 Message-Id: <20210317100211.1067585-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210317100211.1067585-1-naush@raspberrypi.com> References: <20210317100211.1067585-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/7] ipa: raspberrypi: Move the controller initialise to ipa::init() 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The controller initialise is a one-off operation, so move it from ipa::configure() to ipa::init(). Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/raspberrypi.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 8a9eb92b39ec..e2db0716b84b 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -127,9 +127,6 @@ private: ControlInfoMap ispCtrls_; ControlList libcameraMetadata_; - /* IPA configuration. */ - std::string tuningFile_; - /* Camera sensor params. */ CameraMode mode_; CameraMode lastMode_; @@ -166,8 +163,6 @@ private: int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConfig) { - tuningFile_ = settings.configurationFile; - /* * Load the "helper" for this sensor. This tells us all the device specific stuff * that the kernel driver doesn't. We only do this the first time; we don't need @@ -193,6 +188,10 @@ int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConf sensorConfig->vblankDelay = vblankDelay; sensorConfig->sensorMetadata = sensorMetadata; + /* Load the tuning file for this sensor. */ + controller_.Read(settings.configurationFile.c_str()); + controller_.Initialise(); + return 0; } @@ -374,12 +373,7 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo, /* Pass the camera mode to the CamHelper to setup algorithms. */ helper_->SetCameraMode(mode_); - if (!controllerInit_) { - /* Load the tuning file for this sensor. */ - controller_.Read(tuningFile_.c_str()); - controller_.Initialise(); - controllerInit_ = true; - + if (firstStart_) { /* Supply initial values for frame durations. */ applyFrameDurations(defaultMinFrameDuration, defaultMaxFrameDuration);