[{"id":17657,"web_url":"https://patchwork.libcamera.org/comment/17657/","msgid":"<306976d3-03ab-ecb8-3d31-7457229f5798@ideasonboard.com>","date":"2021-06-21T12:21:12","subject":"Re: [libcamera-devel] [PATCH v5 2/2] ipa: ipu3: Initialize\n\tCameraSensorHelper at IPU3 init stage","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Mmmmh, I missed a squash, this patch is not the correct one... :-(\n\nOn 21/06/2021 13:47, Jean-Michel Hautbois wrote:\n> In order for the CameraSensorHelper to be instantiated, we need to find\n> its factory using the camera sensor model name stored in\n> IPASettings::sensorModel. As we don't need to do it at each configure\n> call (the sensor is not changing in-between), implement the init call in\n> IPAIPU3 to do that.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 18 ++++++++++++++----\n>  1 file changed, 14 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 8b4c7351..e68e9bb3 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -23,6 +23,7 @@\n>  \n>  #include \"ipu3_agc.h\"\n>  #include \"ipu3_awb.h\"\n> +#include \"libipa/camera_sensor_helper.h\"\n>  \n>  static constexpr uint32_t kMaxCellWidthPerSet = 160;\n>  static constexpr uint32_t kMaxCellHeightPerSet = 56;\n> @@ -36,10 +37,7 @@ namespace ipa::ipu3 {\n>  class IPAIPU3 : public IPAIPU3Interface\n>  {\n>  public:\n> -\tint init([[maybe_unused]] const IPASettings &settings) override\n> -\t{\n> -\t\treturn 0;\n> -\t}\n> +\tint init(const IPASettings &settings) override;\n>  \tint start() override;\n>  \tvoid stop() override {}\n>  \n> @@ -78,6 +76,8 @@ private:\n>  \tstd::unique_ptr<IPU3Awb> awbAlgo_;\n>  \t/* Interface to the AEC/AGC algorithm */\n>  \tstd::unique_ptr<IPU3Agc> agcAlgo_;\n> +\t/* Interface to the Camera Helper */\n> +\tstd::unique_ptr<CameraSensorHelper> camHelper_;\n>  \n>  \t/* Local parameter storage */\n>  \tstruct ipu3_uapi_params params_;\n> @@ -85,6 +85,16 @@ private:\n>  \tstruct ipu3_uapi_grid_config bdsGrid_;\n>  };\n>  \n> +int IPAIPU3::init(const IPASettings &settings)\n> +{\n> +\tcamHelper_ = CameraSensorHelperFactory::create(settings.sensorModel);\n> +\tif (camHelper_ == nullptr) {\n> +\t\tLOG(IPAIPU3, Error) << \"Failed to create camera sensor helper for \" << settings.sensorModel;\n> +\t\treturn -1;\n> +\t}\n> +\treturn 0;\n> +}\n> +\n>  int IPAIPU3::start()\n>  {\n>  \tsetControls(0);\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 240FABE58C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Jun 2021 12:21:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A36F868935;\n\tMon, 21 Jun 2021 14:21:16 +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 3485F60295\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jun 2021 14:21:15 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:ed63:4e89:23b5:8ca8])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AD55C5A1;\n\tMon, 21 Jun 2021 14:21:14 +0200 (CEST)"],"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=\"rTsGfi2j\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624278074;\n\tbh=mcds9kDSCQvsEaTLW81WU0o4IGsUqx9s/6Zf5wyilNI=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=rTsGfi2jwQRLZixjnVMOti1xM5cpTbpgdT4pCYplDksfmU7+RZ9kxj/+PI01rnyJ8\n\t7GCl7l6gszxvgSnxARlKJBxeb49+sLMlIFb80W9Ff9R634lVW94qTEIIZg3afxuJIk\n\tAa/AG0ApXb8nDnE1M41nwlgpzO3IYTfeKJvj5r2E=","To":"libcamera-devel@lists.libcamera.org","References":"<20210621114738.52267-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210621114738.52267-3-jeanmichel.hautbois@ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<306976d3-03ab-ecb8-3d31-7457229f5798@ideasonboard.com>","Date":"Mon, 21 Jun 2021 14:21:12 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.8.1","MIME-Version":"1.0","In-Reply-To":"<20210621114738.52267-3-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v5 2/2] ipa: ipu3: Initialize\n\tCameraSensorHelper at IPU3 init stage","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]