[{"id":31674,"web_url":"https://patchwork.libcamera.org/comment/31674/","msgid":"<172851159391.532453.17064903672747536919@ping.linuxembedded.co.uk>","date":"2024-10-09T22:06:33","subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2024-10-09 20:33:17)\n> This patch introduces support for applying runtime controls to software\n> ISP.  It enables the contrast algorithm as the first control that can be\n> used.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  .../libcamera/internal/software_isp/software_isp.h    |  3 ++-\n>  include/libcamera/ipa/soft.mojom                      |  2 +-\n>  src/ipa/simple/algorithms/contrast.cpp                |  7 +++++++\n>  src/ipa/simple/algorithms/contrast.h                  |  2 ++\n>  src/ipa/simple/data/uncalibrated.yaml                 |  1 +\n>  src/ipa/simple/ipa_context.h                          |  1 +\n>  src/ipa/simple/soft_simple.cpp                        | 11 ++++++++---\n>  src/libcamera/pipeline/simple/simple.cpp              |  2 +-\n>  src/libcamera/software_isp/software_isp.cpp           |  8 ++++++--\n>  9 files changed, 29 insertions(+), 8 deletions(-)\n> \n> diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\n> index a3e3a9da4..d51b03fd6 100644\n> --- a/include/libcamera/internal/software_isp/software_isp.h\n> +++ b/include/libcamera/internal/software_isp/software_isp.h\n> @@ -46,7 +46,8 @@ LOG_DECLARE_CATEGORY(SoftwareIsp)\n>  class SoftwareIsp\n>  {\n>  public:\n> -       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor);\n> +       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n> +                   ControlInfoMap *ipaControls);\n>         ~SoftwareIsp();\n>  \n>         int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n> diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\n> index 347fd69b4..16e6a7071 100644\n> --- a/include/libcamera/ipa/soft.mojom\n> +++ b/include/libcamera/ipa/soft.mojom\n> @@ -17,7 +17,7 @@ interface IPASoftInterface {\n>              libcamera.SharedFD fdStats,\n>              libcamera.SharedFD fdParams,\n>              libcamera.ControlInfoMap sensorCtrlInfoMap)\n> -               => (int32 ret);\n> +               => (int32 ret, libcamera.ControlInfoMap ipaControls);\n>         start() => (int32 ret);\n>         stop();\n>         configure(IPAConfigInfo configInfo)\n> diff --git a/src/ipa/simple/algorithms/contrast.cpp b/src/ipa/simple/algorithms/contrast.cpp\n> index 1a2c14cf9..8d9997d81 100644\n> --- a/src/ipa/simple/algorithms/contrast.cpp\n> +++ b/src/ipa/simple/algorithms/contrast.cpp\n> @@ -19,6 +19,13 @@ LOG_DEFINE_CATEGORY(IPASoftContrast)\n>  \n>  namespace ipa::soft::algorithms {\n>  \n> +int Contrast::init(IPAContext &context,\n> +                  [[maybe_unused]] const YamlObject &tuningData)\n> +{\n> +       context.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 10.0f, 1.0f);\n> +       return 0;\n> +}\n> +\n>  int Contrast::configure(typename Module::Context &context,\n>                         [[maybe_unused]] const typename Module::Config &configInfo)\n>  {\n> diff --git a/src/ipa/simple/algorithms/contrast.h b/src/ipa/simple/algorithms/contrast.h\n> index 0b3933099..405345acc 100644\n> --- a/src/ipa/simple/algorithms/contrast.h\n> +++ b/src/ipa/simple/algorithms/contrast.h\n> @@ -21,6 +21,8 @@ public:\n>         Contrast() = default;\n>         ~Contrast() = default;\n>  \n> +       int init(IPAContext &context, const YamlObject &tuningData) override;\n> +\n>         int configure(typename Module::Context &context,\n>                       const typename Module::Config &configInfo)\n>                 override;\n> diff --git a/src/ipa/simple/data/uncalibrated.yaml b/src/ipa/simple/data/uncalibrated.yaml\n> index 3f1471121..c091e30fd 100644\n> --- a/src/ipa/simple/data/uncalibrated.yaml\n> +++ b/src/ipa/simple/data/uncalibrated.yaml\n> @@ -5,6 +5,7 @@ version: 1\n>  algorithms:\n>    - BlackLevel:\n>    - Awb:\n> +  - Contrast:\n>    - Lut:\n>    - Agc:\n>  ...\n> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> index 5118d6abf..095c83800 100644\n> --- a/src/ipa/simple/ipa_context.h\n> +++ b/src/ipa/simple/ipa_context.h\n> @@ -65,6 +65,7 @@ struct IPAContext {\n>         IPASessionConfiguration configuration;\n>         IPAActiveState activeState;\n>         FCQueue<IPAFrameContext> frameContexts;\n> +       ControlInfoMap::Map ctrlMap;\n>  };\n>  \n>  } /* namespace ipa::soft */\n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index b28c7039f..eb027d754 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -41,7 +41,7 @@ class IPASoftSimple : public ipa::soft::IPASoftInterface, public Module\n>  {\n>  public:\n>         IPASoftSimple()\n> -               : context_({ {}, {}, { kMaxFrameContexts } })\n> +               : context_({ {}, {}, { kMaxFrameContexts }, {} })\n\nCould you instead, preceed this patch with an equivalent of \nhttps://patchwork.libcamera.org/patch/21542/ for the simple pipeline\nhandler IPA?\n\nBonus points if you convert others too.\n\n>         {\n>         }\n>  \n> @@ -50,7 +50,8 @@ public:\n>         int init(const IPASettings &settings,\n>                  const SharedFD &fdStats,\n>                  const SharedFD &fdParams,\n> -                const ControlInfoMap &sensorInfoMap) override;\n> +                const ControlInfoMap &sensorInfoMap,\n> +                ControlInfoMap *ipaControls) override;\n>         int configure(const IPAConfigInfo &configInfo) override;\n>  \n>         int start() override;\n> @@ -87,7 +88,8 @@ IPASoftSimple::~IPASoftSimple()\n>  int IPASoftSimple::init(const IPASettings &settings,\n>                         const SharedFD &fdStats,\n>                         const SharedFD &fdParams,\n> -                       const ControlInfoMap &sensorInfoMap)\n> +                       const ControlInfoMap &sensorInfoMap,\n> +                       ControlInfoMap *ipaControls)\n>  {\n>         camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n>         if (!camHelper_) {\n> @@ -158,6 +160,9 @@ int IPASoftSimple::init(const IPASettings &settings,\n>                 stats_ = static_cast<SwIspStats *>(mem);\n>         }\n>  \n> +       ControlInfoMap::Map ctrlMap = context_.ctrlMap;\n> +       *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);\n\nAm I correct in reading that this is taking a copy of the ctrlMap first\nso that we can then construct the ControlInfoMap from it, without\ndestroying or losing the context_.ctrlMap?\n\nI think that's a good thing to do - but makes me think we should have a\nControlInfoMap(const &ControlInfoMap::Map, ...) version that wouldn't\nmove and would make a copy internally.\n\n\nWould\n\t*ipaControls = ControlInfoMap(std::copy(context_ctrlMap),\n\t\t\t\t      controls::controls);\n\nhave been equivalent / expressive in the same way ?\n\n\nBut I think that's just implementation detail so:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n> +\n>         /*\n>          * Check if the sensor driver supports the controls required by the\n>          * Soft IPA.\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 3ddce71d3..38868df66 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -530,7 +530,7 @@ int SimpleCameraData::init()\n>          * Instantiate Soft ISP if this is enabled for the given driver and no converter is used.\n>          */\n>         if (!converter_ && pipe->swIspEnabled()) {\n> -               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get());\n> +               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get(), &controlInfo_);\n>                 if (!swIsp_->isValid()) {\n>                         LOG(SimplePipeline, Warning)\n>                                 << \"Failed to create software ISP, disabling software debayering\";\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index 47677784d..3d3f956cb 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -13,6 +13,7 @@\n>  #include <sys/types.h>\n>  #include <unistd.h>\n>  \n> +#include <libcamera/controls.h>\n>  #include <libcamera/formats.h>\n>  #include <libcamera/stream.h>\n>  \n> @@ -60,9 +61,11 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n>   * \\brief Constructs SoftwareIsp object\n>   * \\param[in] pipe The pipeline handler in use\n>   * \\param[in] sensor Pointer to the CameraSensor instance owned by the pipeline\n> + * \\param[out] ipaControls The IPA controls to update\n>   * handler\n>   */\n> -SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n> +SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n> +                        ControlInfoMap *ipaControls)\n>         : dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap |\n>                    DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap |\n>                    DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf)\n> @@ -124,7 +127,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n>         int ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n>                              debayer_->getStatsFD(),\n>                              sharedParams_.fd(),\n> -                            sensor->controls());\n> +                            sensor->controls(),\n> +                            ipaControls);\n>         if (ret) {\n>                 LOG(SoftwareIsp, Error) << \"IPA init failed\";\n>                 debayer_.reset();\n> -- \n> 2.44.1\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 CA416C32E0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Oct 2024 22:06:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DD635618C5;\n\tThu, 10 Oct 2024 00:06:37 +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 7D782618C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Oct 2024 00:06:36 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C1B1C226;\n\tThu, 10 Oct 2024 00:04:58 +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=\"LfKWh1BU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728511498;\n\tbh=RdAdHGZYVeyctvuugEqTzCUQWmfxcYOj29fiSzjkikM=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=LfKWh1BUKznphfU5ic5dAFu7mNSV0Hf3qAA6bw6exuLtIxnJnelnPTjVvMp/1gdjb\n\tWiEaXu095CkDymUWaYwoSt5MAjHCqXr0dIATBsOEY2TeMkN8JJqG/+KVMixRF0E4x4\n\tBDSEnSzwCPS2AY4JIoouMEBJnLBTdIvTanTf14gI=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241009193318.2394762-3-mzamazal@redhat.com>","References":"<20241009193318.2394762-1-mzamazal@redhat.com>\n\t<20241009193318.2394762-3-mzamazal@redhat.com>","Subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Wed, 09 Oct 2024 23:06:33 +0100","Message-ID":"<172851159391.532453.17064903672747536919@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}},{"id":31697,"web_url":"https://patchwork.libcamera.org/comment/31697/","msgid":"<878quwqowq.fsf@redhat.com>","date":"2024-10-10T09:37:41","subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Quoting Milan Zamazal (2024-10-09 20:33:17)\n>> This patch introduces support for applying runtime controls to software\n>> ISP.  It enables the contrast algorithm as the first control that can be\n>\n>> used.\n>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>  .../libcamera/internal/software_isp/software_isp.h    |  3 ++-\n>>  include/libcamera/ipa/soft.mojom                      |  2 +-\n>>  src/ipa/simple/algorithms/contrast.cpp                |  7 +++++++\n>>  src/ipa/simple/algorithms/contrast.h                  |  2 ++\n>>  src/ipa/simple/data/uncalibrated.yaml                 |  1 +\n>>  src/ipa/simple/ipa_context.h                          |  1 +\n>>  src/ipa/simple/soft_simple.cpp                        | 11 ++++++++---\n>>  src/libcamera/pipeline/simple/simple.cpp              |  2 +-\n>>  src/libcamera/software_isp/software_isp.cpp           |  8 ++++++--\n>>  9 files changed, 29 insertions(+), 8 deletions(-)\n>> \n>> diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\n>> index a3e3a9da4..d51b03fd6 100644\n>> --- a/include/libcamera/internal/software_isp/software_isp.h\n>> +++ b/include/libcamera/internal/software_isp/software_isp.h\n>> @@ -46,7 +46,8 @@ LOG_DECLARE_CATEGORY(SoftwareIsp)\n>>  class SoftwareIsp\n>>  {\n>>  public:\n>> -       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor);\n>> +       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>> +                   ControlInfoMap *ipaControls);\n>>         ~SoftwareIsp();\n>>  \n>>         int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n>> diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\n>> index 347fd69b4..16e6a7071 100644\n>> --- a/include/libcamera/ipa/soft.mojom\n>> +++ b/include/libcamera/ipa/soft.mojom\n>> @@ -17,7 +17,7 @@ interface IPASoftInterface {\n>>              libcamera.SharedFD fdStats,\n>>              libcamera.SharedFD fdParams,\n>>              libcamera.ControlInfoMap sensorCtrlInfoMap)\n>> -               => (int32 ret);\n>> +               => (int32 ret, libcamera.ControlInfoMap ipaControls);\n>>         start() => (int32 ret);\n>>         stop();\n>>         configure(IPAConfigInfo configInfo)\n>> diff --git a/src/ipa/simple/algorithms/contrast.cpp b/src/ipa/simple/algorithms/contrast.cpp\n>> index 1a2c14cf9..8d9997d81 100644\n>> --- a/src/ipa/simple/algorithms/contrast.cpp\n>> +++ b/src/ipa/simple/algorithms/contrast.cpp\n>> @@ -19,6 +19,13 @@ LOG_DEFINE_CATEGORY(IPASoftContrast)\n>>  \n>>  namespace ipa::soft::algorithms {\n>>  \n>> +int Contrast::init(IPAContext &context,\n>> +                  [[maybe_unused]] const YamlObject &tuningData)\n>> +{\n>> +       context.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 10.0f, 1.0f);\n>> +       return 0;\n>> +}\n>> +\n>>  int Contrast::configure(typename Module::Context &context,\n>>                         [[maybe_unused]] const typename Module::Config &configInfo)\n>>  {\n>> diff --git a/src/ipa/simple/algorithms/contrast.h b/src/ipa/simple/algorithms/contrast.h\n>> index 0b3933099..405345acc 100644\n>> --- a/src/ipa/simple/algorithms/contrast.h\n>> +++ b/src/ipa/simple/algorithms/contrast.h\n>> @@ -21,6 +21,8 @@ public:\n>>         Contrast() = default;\n>>         ~Contrast() = default;\n>>  \n>> +       int init(IPAContext &context, const YamlObject &tuningData) override;\n>> +\n>>         int configure(typename Module::Context &context,\n>>                       const typename Module::Config &configInfo)\n>>                 override;\n>> diff --git a/src/ipa/simple/data/uncalibrated.yaml b/src/ipa/simple/data/uncalibrated.yaml\n>> index 3f1471121..c091e30fd 100644\n>> --- a/src/ipa/simple/data/uncalibrated.yaml\n>> +++ b/src/ipa/simple/data/uncalibrated.yaml\n>> @@ -5,6 +5,7 @@ version: 1\n>>  algorithms:\n>>    - BlackLevel:\n>>    - Awb:\n>> +  - Contrast:\n>>    - Lut:\n>>    - Agc:\n>>  ...\n>> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n>> index 5118d6abf..095c83800 100644\n>> --- a/src/ipa/simple/ipa_context.h\n>> +++ b/src/ipa/simple/ipa_context.h\n>> @@ -65,6 +65,7 @@ struct IPAContext {\n>>         IPASessionConfiguration configuration;\n>>         IPAActiveState activeState;\n>>         FCQueue<IPAFrameContext> frameContexts;\n>> +       ControlInfoMap::Map ctrlMap;\n>>  };\n>>  \n>>  } /* namespace ipa::soft */\n>> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n>> index b28c7039f..eb027d754 100644\n>> --- a/src/ipa/simple/soft_simple.cpp\n>> +++ b/src/ipa/simple/soft_simple.cpp\n>> @@ -41,7 +41,7 @@ class IPASoftSimple : public ipa::soft::IPASoftInterface, public Module\n>>  {\n>>  public:\n>>         IPASoftSimple()\n>> -               : context_({ {}, {}, { kMaxFrameContexts } })\n>> +               : context_({ {}, {}, { kMaxFrameContexts }, {} })\n>\n> Could you instead, preceed this patch with an equivalent of \n> https://patchwork.libcamera.org/patch/21542/ for the simple pipeline\n> handler IPA?\n\nYes, good idea.\n\n> Bonus points if you convert others too.\n\nOK. :-)\n\n>>         {\n>>         }\n>>  \n>> @@ -50,7 +50,8 @@ public:\n>>         int init(const IPASettings &settings,\n>>                  const SharedFD &fdStats,\n>>                  const SharedFD &fdParams,\n>> -                const ControlInfoMap &sensorInfoMap) override;\n>> +                const ControlInfoMap &sensorInfoMap,\n>> +                ControlInfoMap *ipaControls) override;\n>>         int configure(const IPAConfigInfo &configInfo) override;\n>>  \n>>         int start() override;\n>> @@ -87,7 +88,8 @@ IPASoftSimple::~IPASoftSimple()\n>>  int IPASoftSimple::init(const IPASettings &settings,\n>>                         const SharedFD &fdStats,\n>>                         const SharedFD &fdParams,\n>> -                       const ControlInfoMap &sensorInfoMap)\n>> +                       const ControlInfoMap &sensorInfoMap,\n>> +                       ControlInfoMap *ipaControls)\n>>  {\n>>         camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n>>         if (!camHelper_) {\n>> @@ -158,6 +160,9 @@ int IPASoftSimple::init(const IPASettings &settings,\n>>                 stats_ = static_cast<SwIspStats *>(mem);\n>>         }\n>>  \n>> +       ControlInfoMap::Map ctrlMap = context_.ctrlMap;\n>> +       *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);\n>\n> Am I correct in reading that this is taking a copy of the ctrlMap first\n> so that we can then construct the ControlInfoMap from it, without\n> destroying or losing the context_.ctrlMap?\n\nYes.\n\n> I think that's a good thing to do - but makes me think we should have a\n> ControlInfoMap(const &ControlInfoMap::Map, ...) version that wouldn't\n> move and would make a copy internally.\n>\n>\n> Would\n> \t*ipaControls = ControlInfoMap(std::copy(context_ctrlMap),\n> \t\t\t\t      controls::controls);\n>\n> have been equivalent / expressive in the same way ?\n\nI don't think there is a single-argument std::copy but\n\n  *ipaControls = ControlInfoMap(ControlInfoMap::Map(context_.ctrlMap), controls::controls);\n\nshould work.  The only question is whether the single line is better\nthan the two original lines.\n\n> But I think that's just implementation detail so:\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>\n>\n>> +\n>>         /*\n>>          * Check if the sensor driver supports the controls required by the\n>>          * Soft IPA.\n>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> index 3ddce71d3..38868df66 100644\n>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> @@ -530,7 +530,7 @@ int SimpleCameraData::init()\n>>          * Instantiate Soft ISP if this is enabled for the given driver and no converter is used.\n>>          */\n>>         if (!converter_ && pipe->swIspEnabled()) {\n>> -               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get());\n>> +               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get(), &controlInfo_);\n>>                 if (!swIsp_->isValid()) {\n>>                         LOG(SimplePipeline, Warning)\n>>                                 << \"Failed to create software ISP, disabling software debayering\";\n>> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n>> index 47677784d..3d3f956cb 100644\n>> --- a/src/libcamera/software_isp/software_isp.cpp\n>> +++ b/src/libcamera/software_isp/software_isp.cpp\n>> @@ -13,6 +13,7 @@\n>>  #include <sys/types.h>\n>>  #include <unistd.h>\n>>  \n>> +#include <libcamera/controls.h>\n>>  #include <libcamera/formats.h>\n>>  #include <libcamera/stream.h>\n>>  \n>> @@ -60,9 +61,11 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n>>   * \\brief Constructs SoftwareIsp object\n>>   * \\param[in] pipe The pipeline handler in use\n>>   * \\param[in] sensor Pointer to the CameraSensor instance owned by the pipeline\n>> + * \\param[out] ipaControls The IPA controls to update\n>>   * handler\n>>   */\n>> -SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n>> +SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>> +                        ControlInfoMap *ipaControls)\n>>         : dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap |\n>>                    DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap |\n>>                    DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf)\n>> @@ -124,7 +127,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n>>         int ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n>>                              debayer_->getStatsFD(),\n>>                              sharedParams_.fd(),\n>> -                            sensor->controls());\n>> +                            sensor->controls(),\n>> +                            ipaControls);\n>>         if (ret) {\n>>                 LOG(SoftwareIsp, Error) << \"IPA init failed\";\n>>                 debayer_.reset();\n>> -- \n>> 2.44.1\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 6B63EC32E0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Oct 2024 09:37:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 520AC65369;\n\tThu, 10 Oct 2024 11:37:49 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 57D0763536\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Oct 2024 11:37:47 +0200 (CEST)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-633-36pILU7GOBaQwYPc_c3xSA-1; Thu, 10 Oct 2024 05:37:44 -0400","by mail-wm1-f71.google.com with SMTP id\n\t5b1f17b1804b1-43057565db5so4022805e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Oct 2024 02:37:44 -0700 (PDT)","from nuthatch (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-37d4b9180adsm1011880f8f.112.2024.10.10.02.37.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Oct 2024 02:37:42 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"TsS34eW0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1728553066;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=jULuCPBs0hUf9ZDx4X+fncGMjyN6T8SFCUUmggvv0XE=;\n\tb=TsS34eW0GOH8rlrdk/PrmyAujp5McslbGKLHaf6H8FLyciqBEPItB91LNv1ovlFggGDKP9\n\tUuDy8L/vPqpE9uiRgFXXIgl8E1S4L/foyurPmkbI4frRA/AIOnih1XJzj5e85Bm7IdfKh6\n\t2FC5VfZra7NlOIqjbkBT3aR+YZIqdFI=","X-MC-Unique":"36pILU7GOBaQwYPc_c3xSA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1728553063; x=1729157863;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=jULuCPBs0hUf9ZDx4X+fncGMjyN6T8SFCUUmggvv0XE=;\n\tb=b0KjR3utmw5PQb5Vm5l7TC/HdhAS6+JGK9Sq3CouJbicxZLPOgPcU9cJ7T2B0u4LGI\n\tW678oNgwfT8H95PJP9n3fyw9Kt8WpMQ1GIXydjO6+DMRngEFMldbcra2BDMvuaHiwI2+\n\tem3m9X2oik6uYQu5/hlhF5oSQKszu4dmialTzbbU4OjkiCGzqImFJ0nP3VkGthAmA8in\n\tIk/4N2Sjf9i1WCKrvqluIz2GPHaYoJIXBHdNjKk68+522alBU+RbcHVetUzDrm1omGfq\n\tdKuX75uOtnAEbONlGUkUNmsXWiywn8Z+C8zVcEPjrZ3oQQ8dT1ZvR2i1jwLwu2dQdvQ0\n\teV1w==","X-Gm-Message-State":"AOJu0YxGFr36jdgv9hgEex5BQDK1YUbg8b/m7q0nDvBjJaPvwQ3Kw1B8\n\txdKI3hwaFS7YXM8mM/OVJQGMHzAJuSRNImSpSYiaFX0D4ST2jRygw75l+/5d3LG8K45/VR+Rd0n\n\twFqHGpajNQazApe8XvTprADx/vbEhntBwSY/lsNgaKLDUrUZ6Rj03BHf04Yo6H/o0UcqTsqLn7Q\n\t+neJaW4ybyixM9GOD1sJDz9MUKNeADHD8Xoblzj0UTyrkWFjm0S+B5UPs=","X-Received":["by 2002:a05:600c:6992:b0:426:64c1:8388 with SMTP id\n\t5b1f17b1804b1-43115ade735mr21504435e9.17.1728553063073; \n\tThu, 10 Oct 2024 02:37:43 -0700 (PDT)","by 2002:a05:600c:6992:b0:426:64c1:8388 with SMTP id\n\t5b1f17b1804b1-43115ade735mr21504125e9.17.1728553062462; \n\tThu, 10 Oct 2024 02:37:42 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IHo+ZsBhrjPZwB2hU04eQ1YJwauAlwgy2c7E47l3YAL0sv2t6/Wqz+0c+VT8eUGyXYvm6orLQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","In-Reply-To":"<172851159391.532453.17064903672747536919@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Wed, 09 Oct 2024 23:06:33 +0100\")","References":"<20241009193318.2394762-1-mzamazal@redhat.com>\n\t<20241009193318.2394762-3-mzamazal@redhat.com>\n\t<172851159391.532453.17064903672747536919@ping.linuxembedded.co.uk>","Date":"Thu, 10 Oct 2024 11:37:41 +0200","Message-ID":"<878quwqowq.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":31698,"web_url":"https://patchwork.libcamera.org/comment/31698/","msgid":"<172855893272.532453.6497137808784912537@ping.linuxembedded.co.uk>","date":"2024-10-10T11:15:32","subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2024-10-10 10:37:41)\n> Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n> \n> > Quoting Milan Zamazal (2024-10-09 20:33:17)\n> >> This patch introduces support for applying runtime controls to software\n> >> ISP.  It enables the contrast algorithm as the first control that can be\n> >\n> >> used.\n> >> \n> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> >> ---\n> >>  .../libcamera/internal/software_isp/software_isp.h    |  3 ++-\n> >>  include/libcamera/ipa/soft.mojom                      |  2 +-\n> >>  src/ipa/simple/algorithms/contrast.cpp                |  7 +++++++\n> >>  src/ipa/simple/algorithms/contrast.h                  |  2 ++\n> >>  src/ipa/simple/data/uncalibrated.yaml                 |  1 +\n> >>  src/ipa/simple/ipa_context.h                          |  1 +\n> >>  src/ipa/simple/soft_simple.cpp                        | 11 ++++++++---\n> >>  src/libcamera/pipeline/simple/simple.cpp              |  2 +-\n> >>  src/libcamera/software_isp/software_isp.cpp           |  8 ++++++--\n> >>  9 files changed, 29 insertions(+), 8 deletions(-)\n> >> \n> >> diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\n> >> index a3e3a9da4..d51b03fd6 100644\n> >> --- a/include/libcamera/internal/software_isp/software_isp.h\n> >> +++ b/include/libcamera/internal/software_isp/software_isp.h\n> >> @@ -46,7 +46,8 @@ LOG_DECLARE_CATEGORY(SoftwareIsp)\n> >>  class SoftwareIsp\n> >>  {\n> >>  public:\n> >> -       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor);\n> >> +       SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n> >> +                   ControlInfoMap *ipaControls);\n> >>         ~SoftwareIsp();\n> >>  \n> >>         int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n> >> diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom\n> >> index 347fd69b4..16e6a7071 100644\n> >> --- a/include/libcamera/ipa/soft.mojom\n> >> +++ b/include/libcamera/ipa/soft.mojom\n> >> @@ -17,7 +17,7 @@ interface IPASoftInterface {\n> >>              libcamera.SharedFD fdStats,\n> >>              libcamera.SharedFD fdParams,\n> >>              libcamera.ControlInfoMap sensorCtrlInfoMap)\n> >> -               => (int32 ret);\n> >> +               => (int32 ret, libcamera.ControlInfoMap ipaControls);\n> >>         start() => (int32 ret);\n> >>         stop();\n> >>         configure(IPAConfigInfo configInfo)\n> >> diff --git a/src/ipa/simple/algorithms/contrast.cpp b/src/ipa/simple/algorithms/contrast.cpp\n> >> index 1a2c14cf9..8d9997d81 100644\n> >> --- a/src/ipa/simple/algorithms/contrast.cpp\n> >> +++ b/src/ipa/simple/algorithms/contrast.cpp\n> >> @@ -19,6 +19,13 @@ LOG_DEFINE_CATEGORY(IPASoftContrast)\n> >>  \n> >>  namespace ipa::soft::algorithms {\n> >>  \n> >> +int Contrast::init(IPAContext &context,\n> >> +                  [[maybe_unused]] const YamlObject &tuningData)\n> >> +{\n> >> +       context.ctrlMap[&controls::Contrast] = ControlInfo(0.0f, 10.0f, 1.0f);\n> >> +       return 0;\n> >> +}\n> >> +\n> >>  int Contrast::configure(typename Module::Context &context,\n> >>                         [[maybe_unused]] const typename Module::Config &configInfo)\n> >>  {\n> >> diff --git a/src/ipa/simple/algorithms/contrast.h b/src/ipa/simple/algorithms/contrast.h\n> >> index 0b3933099..405345acc 100644\n> >> --- a/src/ipa/simple/algorithms/contrast.h\n> >> +++ b/src/ipa/simple/algorithms/contrast.h\n> >> @@ -21,6 +21,8 @@ public:\n> >>         Contrast() = default;\n> >>         ~Contrast() = default;\n> >>  \n> >> +       int init(IPAContext &context, const YamlObject &tuningData) override;\n> >> +\n> >>         int configure(typename Module::Context &context,\n> >>                       const typename Module::Config &configInfo)\n> >>                 override;\n> >> diff --git a/src/ipa/simple/data/uncalibrated.yaml b/src/ipa/simple/data/uncalibrated.yaml\n> >> index 3f1471121..c091e30fd 100644\n> >> --- a/src/ipa/simple/data/uncalibrated.yaml\n> >> +++ b/src/ipa/simple/data/uncalibrated.yaml\n> >> @@ -5,6 +5,7 @@ version: 1\n> >>  algorithms:\n> >>    - BlackLevel:\n> >>    - Awb:\n> >> +  - Contrast:\n> >>    - Lut:\n> >>    - Agc:\n> >>  ...\n> >> diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h\n> >> index 5118d6abf..095c83800 100644\n> >> --- a/src/ipa/simple/ipa_context.h\n> >> +++ b/src/ipa/simple/ipa_context.h\n> >> @@ -65,6 +65,7 @@ struct IPAContext {\n> >>         IPASessionConfiguration configuration;\n> >>         IPAActiveState activeState;\n> >>         FCQueue<IPAFrameContext> frameContexts;\n> >> +       ControlInfoMap::Map ctrlMap;\n> >>  };\n> >>  \n> >>  } /* namespace ipa::soft */\n> >> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> >> index b28c7039f..eb027d754 100644\n> >> --- a/src/ipa/simple/soft_simple.cpp\n> >> +++ b/src/ipa/simple/soft_simple.cpp\n> >> @@ -41,7 +41,7 @@ class IPASoftSimple : public ipa::soft::IPASoftInterface, public Module\n> >>  {\n> >>  public:\n> >>         IPASoftSimple()\n> >> -               : context_({ {}, {}, { kMaxFrameContexts } })\n> >> +               : context_({ {}, {}, { kMaxFrameContexts }, {} })\n> >\n> > Could you instead, preceed this patch with an equivalent of \n> > https://patchwork.libcamera.org/patch/21542/ for the simple pipeline\n> > handler IPA?\n> \n> Yes, good idea.\n> \n> > Bonus points if you convert others too.\n> \n> OK. :-)\n> \n> >>         {\n> >>         }\n> >>  \n> >> @@ -50,7 +50,8 @@ public:\n> >>         int init(const IPASettings &settings,\n> >>                  const SharedFD &fdStats,\n> >>                  const SharedFD &fdParams,\n> >> -                const ControlInfoMap &sensorInfoMap) override;\n> >> +                const ControlInfoMap &sensorInfoMap,\n> >> +                ControlInfoMap *ipaControls) override;\n> >>         int configure(const IPAConfigInfo &configInfo) override;\n> >>  \n> >>         int start() override;\n> >> @@ -87,7 +88,8 @@ IPASoftSimple::~IPASoftSimple()\n> >>  int IPASoftSimple::init(const IPASettings &settings,\n> >>                         const SharedFD &fdStats,\n> >>                         const SharedFD &fdParams,\n> >> -                       const ControlInfoMap &sensorInfoMap)\n> >> +                       const ControlInfoMap &sensorInfoMap,\n> >> +                       ControlInfoMap *ipaControls)\n> >>  {\n> >>         camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n> >>         if (!camHelper_) {\n> >> @@ -158,6 +160,9 @@ int IPASoftSimple::init(const IPASettings &settings,\n> >>                 stats_ = static_cast<SwIspStats *>(mem);\n> >>         }\n> >>  \n> >> +       ControlInfoMap::Map ctrlMap = context_.ctrlMap;\n> >> +       *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);\n> >\n> > Am I correct in reading that this is taking a copy of the ctrlMap first\n> > so that we can then construct the ControlInfoMap from it, without\n> > destroying or losing the context_.ctrlMap?\n> \n> Yes.\n> \n> > I think that's a good thing to do - but makes me think we should have a\n> > ControlInfoMap(const &ControlInfoMap::Map, ...) version that wouldn't\n> > move and would make a copy internally.\n> >\n> >\n> > Would\n> >       *ipaControls = ControlInfoMap(std::copy(context_ctrlMap),\n> >                                     controls::controls);\n> >\n> > have been equivalent / expressive in the same way ?\n> \n> I don't think there is a single-argument std::copy but\n> \n>   *ipaControls = ControlInfoMap(ControlInfoMap::Map(context_.ctrlMap), controls::controls);\n> \n> should work.  The only question is whether the single line is better\n> than the two original lines.\n> \n\nI don't object to the two lines - I thought the current constructor was\nforcing you to make a copy and then move that copy...\n\nIf the current constructors can do the right thing too then there's no\nreal action /change required here ...\n\n\n> > But I think that's just implementation detail so:\n> >\n> >\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> >\n> >\n> >> +\n> >>         /*\n> >>          * Check if the sensor driver supports the controls required by the\n> >>          * Soft IPA.\n> >> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> >> index 3ddce71d3..38868df66 100644\n> >> --- a/src/libcamera/pipeline/simple/simple.cpp\n> >> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> >> @@ -530,7 +530,7 @@ int SimpleCameraData::init()\n> >>          * Instantiate Soft ISP if this is enabled for the given driver and no converter is used.\n> >>          */\n> >>         if (!converter_ && pipe->swIspEnabled()) {\n> >> -               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get());\n> >> +               swIsp_ = std::make_unique<SoftwareIsp>(pipe, sensor_.get(), &controlInfo_);\n> >>                 if (!swIsp_->isValid()) {\n> >>                         LOG(SimplePipeline, Warning)\n> >>                                 << \"Failed to create software ISP, disabling software debayering\";\n> >> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> >> index 47677784d..3d3f956cb 100644\n> >> --- a/src/libcamera/software_isp/software_isp.cpp\n> >> +++ b/src/libcamera/software_isp/software_isp.cpp\n> >> @@ -13,6 +13,7 @@\n> >>  #include <sys/types.h>\n> >>  #include <unistd.h>\n> >>  \n> >> +#include <libcamera/controls.h>\n> >>  #include <libcamera/formats.h>\n> >>  #include <libcamera/stream.h>\n> >>  \n> >> @@ -60,9 +61,11 @@ LOG_DEFINE_CATEGORY(SoftwareIsp)\n> >>   * \\brief Constructs SoftwareIsp object\n> >>   * \\param[in] pipe The pipeline handler in use\n> >>   * \\param[in] sensor Pointer to the CameraSensor instance owned by the pipeline\n> >> + * \\param[out] ipaControls The IPA controls to update\n> >>   * handler\n> >>   */\n> >> -SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n> >> +SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n> >> +                        ControlInfoMap *ipaControls)\n> >>         : dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap |\n> >>                    DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap |\n> >>                    DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf)\n> >> @@ -124,7 +127,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor)\n> >>         int ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n> >>                              debayer_->getStatsFD(),\n> >>                              sharedParams_.fd(),\n> >> -                            sensor->controls());\n> >> +                            sensor->controls(),\n> >> +                            ipaControls);\n> >>         if (ret) {\n> >>                 LOG(SoftwareIsp, Error) << \"IPA init failed\";\n> >>                 debayer_.reset();\n> >> -- \n> >> 2.44.1\n> >>\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 64F62C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Oct 2024 11:15:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 036426536B;\n\tThu, 10 Oct 2024 13:15:36 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0940F6353A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Oct 2024 13:15:36 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D55865B2;\n\tThu, 10 Oct 2024 13:13:57 +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=\"ZUW9/BCg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728558837;\n\tbh=lGhHKOi5jwApTa59QSCVtStso/V5b7GiF73Ynsa6660=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ZUW9/BCghUCJX3rQDzTZcu662RJtJy90tpTsV06hIXUuDvdoRLZyPArYq4I5sFmBl\n\t2sJDp7g6W1/yJAoqPrTVqQ++fKKpoGYv6QEoajnVA8+xPjy9wPEsIOjSAnUyrG55t3\n\tXwJrLSZs91cQa7DOcr2H/sMySiml7GeNghoYuO7s=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<878quwqowq.fsf@redhat.com>","References":"<20241009193318.2394762-1-mzamazal@redhat.com>\n\t<20241009193318.2394762-3-mzamazal@redhat.com>\n\t<172851159391.532453.17064903672747536919@ping.linuxembedded.co.uk>\n\t<878quwqowq.fsf@redhat.com>","Subject":"Re: [PATCH v2 2/2] libcamera: software_isp: Add contrast control","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Milan Zamazal <mzamazal@redhat.com>","Date":"Thu, 10 Oct 2024 12:15:32 +0100","Message-ID":"<172855893272.532453.6497137808784912537@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]