[{"id":17739,"web_url":"https://patchwork.libcamera.org/comment/17739/","msgid":"<f1ca2658-f04b-d38f-e018-59a5763c305d@ideasonboard.com>","date":"2021-06-24T12:48:58","subject":"Re: [libcamera-devel] [PATCH v6 2/2] ipa: ipu3: Initialize\n\tCameraSensorHelper at IPU3 init stage","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi JM,\n\nOn 22/06/2021 10:45, 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\nI assume something that will /use/ the cam helper will come later?\n\nSo\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/ipa/ipu3/ipu3.cpp | 19 +++++++++++++++----\n>  1 file changed, 15 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 8b4c7351..0a557825 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,17 @@ 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 -ENODEV;\n> +\t}\n> +\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 606F0C321B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Jun 2021 12:49:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6EC4368457;\n\tThu, 24 Jun 2021 14:49:03 +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 A597468447\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jun 2021 14:49:01 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 329DD501;\n\tThu, 24 Jun 2021 14:49:01 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"keg2n98h\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624538941;\n\tbh=tCYNNXOvXPLAK0DYb3ybAosoMpSh0WKNA3r5W4fh2gQ=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=keg2n98hos/AiDJv8kPyM+HE8if6WrG1joBtrg1b1nlA4VaJRsGOrwpsheJ4MQiNc\n\tlP6g8R1aY8ItDDOTHSUmeANbvYteTG962UCyUWq45obL4uohp4OjBdxBunWbf7IEpB\n\tbMqlAJyP4jFMU795DDjFZ1qFV1p3tgoEgMux7tTg=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210622094523.42915-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210622094523.42915-3-jeanmichel.hautbois@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<f1ca2658-f04b-d38f-e018-59a5763c305d@ideasonboard.com>","Date":"Thu, 24 Jun 2021 13:48:58 +0100","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":"<20210622094523.42915-3-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v6 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>"}}]