[{"id":2543,"web_url":"https://patchwork.libcamera.org/comment/2543/","msgid":"<64ade229-0de8-3c4e-f982-0643d1de33b4@ideasonboard.com>","date":"2019-08-29T13:52:28","subject":"Re: [libcamera-devel] [PATCH 02/13] libcamera: pipeline: Move IPA\n\tfrom pipeline to camera data","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Niklas,\n\nOn 28/08/2019 02:16, Niklas Söderlund wrote:\n> The IPA acts on a camera and not on a pipeline which can expose more\n> then once camera. Move the IPA reference to the CameraData and move the\n\ns/once/one/\n\n\n> loading of an IPA from the specific pipeline handler implementation to\n> base PipelineHandler.\n\nThis sounds like a good thing, and removes the code duplication for\nloading IPAs.\n\n> It's still possible to expose a camera without an IPA but if an IPA is\n> request the camera is not valid and will not be registered in the system\n> if a suiting IPA module can't be found.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/include/pipeline_handler.h | 12 ++++++--\n>  src/libcamera/pipeline/vimc.cpp          | 10 +-----\n>  src/libcamera/pipeline_handler.cpp       | 39 +++++++++++++++++++++++-\n>  3 files changed, 49 insertions(+), 12 deletions(-)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index 1fdef9cea40f1f0a..ffc7adb802215313 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -15,6 +15,7 @@\n>  #include <vector>\n>  \n>  #include <libcamera/controls.h>\n> +#include <libcamera/ipa/ipa_interface.h>\n>  #include <libcamera/stream.h>\n>  \n>  namespace libcamera {\n> @@ -33,8 +34,11 @@ class Request;\n>  class CameraData\n>  {\n>  public:\n> -\texplicit CameraData(PipelineHandler *pipe)\n> -\t\t: pipe_(pipe)\n> +\texplicit CameraData(PipelineHandler *pipe,\n> +\t\t\t    uint32_t minIPAVersion = 0,\n> +\t\t\t    uint32_t maxIPAVersion = 0)\n> +\t\t: pipe_(pipe), ipa_(nullptr), minIPAVersion_(minIPAVersion),\n> +\t\t  maxIPAVersion_(maxIPAVersion)\n>  \t{\n>  \t}\n>  \tvirtual ~CameraData() {}\n> @@ -44,6 +48,10 @@ public:\n>  \tstd::list<Request *> queuedRequests_;\n>  \tControlInfoMap controlInfo_;\n>  \n> +\tstd::unique_ptr<IPAInterface> ipa_;\n\nIs this ok to be public? Or should it be more restricted?\n\n> +\tconst uint32_t minIPAVersion_;\n> +\tconst uint32_t maxIPAVersion_;\n\nAnd these?\n\nHrm ... looking at CameraData - we treat it as an internal 'public'\nobject anyway, so I guess it's matching the existing precedence on that\nclass.\n\n\n> +\n>  private:\n>  \tCameraData(const CameraData &) = delete;\n>  \tCameraData &operator=(const CameraData &) = delete;\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index e5c4890501db71c8..be6507cd4bc0d1b9 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -38,7 +38,7 @@ class VimcCameraData : public CameraData\n>  {\n>  public:\n>  \tVimcCameraData(PipelineHandler *pipe)\n> -\t\t: CameraData(pipe), sensor_(nullptr), debayer_(nullptr),\n> +\t\t: CameraData(pipe, 1, 1), sensor_(nullptr), debayer_(nullptr),\n>  \t\t  scaler_(nullptr), video_(nullptr), raw_(nullptr)\n>  \t{\n>  \t}\n> @@ -100,8 +100,6 @@ private:\n>  \t\treturn static_cast<VimcCameraData *>(\n>  \t\t\tPipelineHandler::cameraData(camera));\n>  \t}\n> -\n> -\tstd::unique_ptr<IPAInterface> ipa_;\n>  };\n>  \n>  VimcCameraConfiguration::VimcCameraConfiguration()\n> @@ -361,12 +359,6 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n>  \tif (!media)\n>  \t\treturn false;\n>  \n> -\tipa_ = IPAManager::instance()->createIPA(this, 1, 1);\n> -\tif (ipa_ == nullptr)\n> -\t\tLOG(VIMC, Warning) << \"no matching IPA found\";\n> -\telse\n> -\t\tipa_->init();\n> -\n>  \tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n>  \n>  \t/* Locate and open the capture video node. */\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 3e54aa23d92b9a36..89b67806597728f9 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -12,6 +12,7 @@\n>  #include <libcamera/camera_manager.h>\n>  \n>  #include \"device_enumerator.h\"\n> +#include \"ipa_manager.h\"\n>  #include \"log.h\"\n>  #include \"media_device.h\"\n>  #include \"utils.h\"\n> @@ -49,13 +50,20 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>   */\n>  \n>  /**\n> - * \\fn CameraData::CameraData(PipelineHandler *pipe)\n> + * \\fn CameraData::CameraData(PipelineHandler *pipe, uint32_t minIPAVersion,\n> + * uint32_t maxIPAVersion)\n>   * \\brief Construct a CameraData instance for the given pipeline handler\n>   * \\param[in] pipe The pipeline handler\n> + * \\param[in] minIPAVersion Minimum acceptable version of IPA module\n> + * \\param[in] maxIPAVersion Maximum acceptable version of IPA module\n>   *\n>   * The reference to the pipeline handler is stored internally, the caller shall\n>   * guarantee that the pointer remains valid as long as the CameraData instance\n>   * exists.\n> + *\n> + * The IPA maximum and minimum version numbers are used to match with an IPA\n> + * interface that would be compatible with the Camera. If no IPA interface\n> + * is needed for the camera both parameters should be set to 0.\n>   */\n>  \n>  /**\n> @@ -96,6 +104,24 @@ LOG_DEFINE_CATEGORY(Pipeline)\n>   * creating the camera, and shall not be modified afterwards.\n>   */\n>  \n> +/**\n> + * \\var CameraData::ipa_\n> + * \\brief The IPA module used by the camera\n> + *\n> + * Reference to the Image Processing Algorithms (IPA) operating on the camera's\n> + * stream(s). If no IPA are in operation this should be set to nullptr.\n\nI'm not sure how to handle the pluralism there. I interpret \"IPA\" as\nsingular, which would mean this should read \"If no IPA is in operation...\"\n\nBut you do define IPA as \"...Algorithms\" ... but I'm not sure the\nacronym can convey the pluralism, so it would have to be \"If no IPAs are\nin operation...\"\n\nA bit of googling makes me believe we should pluralise the acronym,\nmaking it the \"If no IPAs are in operation...\" option.\n\n> + */\n> +\n> +/**\n> + * \\var CameraData::minIPAVersion_\n> + * \\brief Minimum acceptable version of IPA module\n> + */\n> +\n> +/**\n> + * \\var CameraData::maxIPAVersion_\n> + * \\brief Maximum acceptable version of IPA module\n> + */\n> +\n>  /**\n>   * \\class PipelineHandler\n>   * \\brief Create and manage cameras based on a set of media devices\n> @@ -424,6 +450,17 @@ void PipelineHandler::completeRequest(Camera *camera, Request *request)\n>  void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,\n>  \t\t\t\t     std::unique_ptr<CameraData> data)\n>  {\n> +\tif (data->minIPAVersion_ || data->maxIPAVersion_) {\n> +\t\tdata->ipa_ = IPAManager::instance()->createIPA(this,\n> +\t\t\t\t\t\t\t       data->minIPAVersion_,\n> +\t\t\t\t\t\t\t       data->maxIPAVersion_);\n> +\t\tif (!data->ipa_) {\n> +\t\t\tLOG(Pipeline, Warning) << \"Skipping \" << camera->name()\n> +\t\t\t\t\t       << \" no IPA found\";\n> +\t\t\treturn;\n> +\t\t}\n> +\t}\n> +\n\nThe code removed from VIMC calls:\n\n> -\t\tipa_->init();\n\nShouldn't that be added here somewhere?\nOr is that going to happen somewhere else?\n\n\nDo we need to manually init() an ipa? Can't that happen as part of\ncreateIPA() ?\n\n\nWith the correct resolution for the missing data->ipa_->init() call,\nwhich perhaps is handled elsewhere, or can be added if required:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n>  \tdata->camera_ = camera.get();\n>  \tcameraData_[camera.get()] = std::move(data);\n>  \tcameras_.push_back(camera);\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AD09860BB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2019 15:52:31 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DCD52E5;\n\tThu, 29 Aug 2019 15:52:31 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1567086751;\n\tbh=BZGXcYFQ+VHfzv1gqm3zDQp71cineEqTx3i+TmDBzT8=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=sSFdDucCrUIQpcd/UTbaynynDUcLrqwt6Jeubj59uob66W0e6dTnpZQWwp8B0yG3Q\n\tN/L2aniq/BS3O13yDbgkAfJYQ3vlSh69Warm+GRrl4TfI6/lYnZQ6nSZSjBXdFzKhc\n\t6dreT8u30Kg5fyTZDoRAg8XGc6wSZTN5hxqDnp5Y=","Reply-To":"kieran.bingham@ideasonboard.com","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190828011710.32128-1-niklas.soderlund@ragnatech.se>\n\t<20190828011710.32128-3-niklas.soderlund@ragnatech.se>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1x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MjYMk7kVvEAEQEAAYkCJQQYAQoADwIbDAUCWcOUawUJ\n\tB4D+AgAKCRChHkZyEKRh/XJhEACr5iidt/0MZ0rWRMCbZFMWD7D2g6nZeOp+F2zY8CEUW+sd\n\tCDVd9BH9QX9KN5SZo6YtJzMzSzpcx45VwTvtQW0n/6Eujg9EUqblfU9xqvqDmbjEapr5d/OL\n\t21GTALb0owKhA5qDUGEcKGCphpQffKhTNo/BP99jvmJUj7IPSKH97qPypi8/ym8bAxB+uY31\n\tgHTMHf1jMJJ1pRo2tYYPeIIHGDqXBI4sp5GHHF+JcIhgR/e/A6w/dgzHYmQPl2ix5eZYEZbV\n\tTRP+gkX4NV8oHqa/lR+xPOlWElGB57viOSOoWriqxQbFy8XbG1GR8cWlkNtGBGVWaJaSoORP\n\tiowD7irXL91bCyFIqL+7BVk3Jy4uzP744PzE80KwxOp5SQAp9sPzFbgsJrLev90PZySjFHG0\n\twP144DK7nBjOj/J0g9OHVASP1JjK+nw7SDoKnETDIdRC0XmiHXk7TXzPdkvO0UkpHdEPjZUp\n\tWyuc0MqehjR/hTTPt4m/Y14XzEcy6JREIjOrFfUZVho2QpOdv9CNryGdieRTNjUtz463CIaZ\n\tdPBiw9mOMBoNffkn9FIoCjLnAaj9gUAnEHWBZOEviQ5NuyqpeP0YtzI4iaRbSUkYZHej99X3\n\tVmHrdLlMqd/ZgYYbPGSL4AN3FVACb5CxuxEHwo029VcE5U3CSjzqtCoX12tm7A==","Organization":"Ideas on Board","Message-ID":"<64ade229-0de8-3c4e-f982-0643d1de33b4@ideasonboard.com>","Date":"Thu, 29 Aug 2019 14:52:28 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.8.0","MIME-Version":"1.0","In-Reply-To":"<20190828011710.32128-3-niklas.soderlund@ragnatech.se>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 02/13] libcamera: pipeline: Move IPA\n\tfrom pipeline to camera data","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 29 Aug 2019 13:52:31 -0000"}},{"id":2553,"web_url":"https://patchwork.libcamera.org/comment/2553/","msgid":"<20190829174953.GA8479@bigcity.dyn.berto.se>","date":"2019-08-29T17:49:53","subject":"Re: [libcamera-devel] [PATCH 02/13] libcamera: pipeline: Move IPA\n\tfrom pipeline to camera data","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Kieran,\n\nThanks for your feedback.\n\nOn 2019-08-29 14:52:28 +0100, Kieran Bingham wrote:\n> Hi Niklas,\n> \n> On 28/08/2019 02:16, Niklas Söderlund wrote:\n> > The IPA acts on a camera and not on a pipeline which can expose more\n> > then once camera. Move the IPA reference to the CameraData and move the\n> \n> s/once/one/\n> \n> \n> > loading of an IPA from the specific pipeline handler implementation to\n> > base PipelineHandler.\n> \n> This sounds like a good thing, and removes the code duplication for\n> loading IPAs.\n> \n> > It's still possible to expose a camera without an IPA but if an IPA is\n> > request the camera is not valid and will not be registered in the system\n> > if a suiting IPA module can't be found.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/libcamera/include/pipeline_handler.h | 12 ++++++--\n> >  src/libcamera/pipeline/vimc.cpp          | 10 +-----\n> >  src/libcamera/pipeline_handler.cpp       | 39 +++++++++++++++++++++++-\n> >  3 files changed, 49 insertions(+), 12 deletions(-)\n> > \n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index 1fdef9cea40f1f0a..ffc7adb802215313 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -15,6 +15,7 @@\n> >  #include <vector>\n> >  \n> >  #include <libcamera/controls.h>\n> > +#include <libcamera/ipa/ipa_interface.h>\n> >  #include <libcamera/stream.h>\n> >  \n> >  namespace libcamera {\n> > @@ -33,8 +34,11 @@ class Request;\n> >  class CameraData\n> >  {\n> >  public:\n> > -\texplicit CameraData(PipelineHandler *pipe)\n> > -\t\t: pipe_(pipe)\n> > +\texplicit CameraData(PipelineHandler *pipe,\n> > +\t\t\t    uint32_t minIPAVersion = 0,\n> > +\t\t\t    uint32_t maxIPAVersion = 0)\n> > +\t\t: pipe_(pipe), ipa_(nullptr), minIPAVersion_(minIPAVersion),\n> > +\t\t  maxIPAVersion_(maxIPAVersion)\n> >  \t{\n> >  \t}\n> >  \tvirtual ~CameraData() {}\n> > @@ -44,6 +48,10 @@ public:\n> >  \tstd::list<Request *> queuedRequests_;\n> >  \tControlInfoMap controlInfo_;\n> >  \n> > +\tstd::unique_ptr<IPAInterface> ipa_;\n> \n> Is this ok to be public? Or should it be more restricted?\n> \n> > +\tconst uint32_t minIPAVersion_;\n> > +\tconst uint32_t maxIPAVersion_;\n> \n> And these?\n> \n> Hrm ... looking at CameraData - we treat it as an internal 'public'\n> object anyway, so I guess it's matching the existing precedence on that\n> class.\n\nYes I think in the future we might strict up the access around \nCameraData, but for now I think this is sane. It follows what we already \ndo and it's not visible to the application.\n\n> \n> \n> > +\n> >  private:\n> >  \tCameraData(const CameraData &) = delete;\n> >  \tCameraData &operator=(const CameraData &) = delete;\n> > diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> > index e5c4890501db71c8..be6507cd4bc0d1b9 100644\n> > --- a/src/libcamera/pipeline/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc.cpp\n> > @@ -38,7 +38,7 @@ class VimcCameraData : public CameraData\n> >  {\n> >  public:\n> >  \tVimcCameraData(PipelineHandler *pipe)\n> > -\t\t: CameraData(pipe), sensor_(nullptr), debayer_(nullptr),\n> > +\t\t: CameraData(pipe, 1, 1), sensor_(nullptr), debayer_(nullptr),\n> >  \t\t  scaler_(nullptr), video_(nullptr), raw_(nullptr)\n> >  \t{\n> >  \t}\n> > @@ -100,8 +100,6 @@ private:\n> >  \t\treturn static_cast<VimcCameraData *>(\n> >  \t\t\tPipelineHandler::cameraData(camera));\n> >  \t}\n> > -\n> > -\tstd::unique_ptr<IPAInterface> ipa_;\n> >  };\n> >  \n> >  VimcCameraConfiguration::VimcCameraConfiguration()\n> > @@ -361,12 +359,6 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n> >  \tif (!media)\n> >  \t\treturn false;\n> >  \n> > -\tipa_ = IPAManager::instance()->createIPA(this, 1, 1);\n> > -\tif (ipa_ == nullptr)\n> > -\t\tLOG(VIMC, Warning) << \"no matching IPA found\";\n> > -\telse\n> > -\t\tipa_->init();\n> > -\n> >  \tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n> >  \n> >  \t/* Locate and open the capture video node. */\n> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > index 3e54aa23d92b9a36..89b67806597728f9 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -12,6 +12,7 @@\n> >  #include <libcamera/camera_manager.h>\n> >  \n> >  #include \"device_enumerator.h\"\n> > +#include \"ipa_manager.h\"\n> >  #include \"log.h\"\n> >  #include \"media_device.h\"\n> >  #include \"utils.h\"\n> > @@ -49,13 +50,20 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> >   */\n> >  \n> >  /**\n> > - * \\fn CameraData::CameraData(PipelineHandler *pipe)\n> > + * \\fn CameraData::CameraData(PipelineHandler *pipe, uint32_t minIPAVersion,\n> > + * uint32_t maxIPAVersion)\n> >   * \\brief Construct a CameraData instance for the given pipeline handler\n> >   * \\param[in] pipe The pipeline handler\n> > + * \\param[in] minIPAVersion Minimum acceptable version of IPA module\n> > + * \\param[in] maxIPAVersion Maximum acceptable version of IPA module\n> >   *\n> >   * The reference to the pipeline handler is stored internally, the caller shall\n> >   * guarantee that the pointer remains valid as long as the CameraData instance\n> >   * exists.\n> > + *\n> > + * The IPA maximum and minimum version numbers are used to match with an IPA\n> > + * interface that would be compatible with the Camera. If no IPA interface\n> > + * is needed for the camera both parameters should be set to 0.\n> >   */\n> >  \n> >  /**\n> > @@ -96,6 +104,24 @@ LOG_DEFINE_CATEGORY(Pipeline)\n> >   * creating the camera, and shall not be modified afterwards.\n> >   */\n> >  \n> > +/**\n> > + * \\var CameraData::ipa_\n> > + * \\brief The IPA module used by the camera\n> > + *\n> > + * Reference to the Image Processing Algorithms (IPA) operating on the camera's\n> > + * stream(s). If no IPA are in operation this should be set to nullptr.\n> \n> I'm not sure how to handle the pluralism there. I interpret \"IPA\" as\n> singular, which would mean this should read \"If no IPA is in operation...\"\n> \n> But you do define IPA as \"...Algorithms\" ... but I'm not sure the\n> acronym can convey the pluralism, so it would have to be \"If no IPAs are\n> in operation...\"\n> \n> A bit of googling makes me believe we should pluralise the acronym,\n> making it the \"If no IPAs are in operation...\" option.\n\nGood point.\n\nDo you still think the definition, 'Image Processing Algorithms (IPA)' \nis OK?\n\n> \n> > + */\n> > +\n> > +/**\n> > + * \\var CameraData::minIPAVersion_\n> > + * \\brief Minimum acceptable version of IPA module\n> > + */\n> > +\n> > +/**\n> > + * \\var CameraData::maxIPAVersion_\n> > + * \\brief Maximum acceptable version of IPA module\n> > + */\n> > +\n> >  /**\n> >   * \\class PipelineHandler\n> >   * \\brief Create and manage cameras based on a set of media devices\n> > @@ -424,6 +450,17 @@ void PipelineHandler::completeRequest(Camera *camera, Request *request)\n> >  void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,\n> >  \t\t\t\t     std::unique_ptr<CameraData> data)\n> >  {\n> > +\tif (data->minIPAVersion_ || data->maxIPAVersion_) {\n> > +\t\tdata->ipa_ = IPAManager::instance()->createIPA(this,\n> > +\t\t\t\t\t\t\t       data->minIPAVersion_,\n> > +\t\t\t\t\t\t\t       data->maxIPAVersion_);\n> > +\t\tif (!data->ipa_) {\n> > +\t\t\tLOG(Pipeline, Warning) << \"Skipping \" << camera->name()\n> > +\t\t\t\t\t       << \" no IPA found\";\n> > +\t\t\treturn;\n> > +\t\t}\n> > +\t}\n> > +\n> \n> The code removed from VIMC calls:\n> \n> > -\t\tipa_->init();\n> \n> Shouldn't that be added here somewhere?\n> Or is that going to happen somewhere else?\n> \n> \n> Do we need to manually init() an ipa? Can't that happen as part of\n> createIPA() ?\n> \n> \n> With the correct resolution for the missing data->ipa_->init() call,\n> which perhaps is handled elsewhere, or can be added if required:\n\nThe IPAInterface::init() function is removed in patch 10/13. As it never \npreformed anything useful (other then printing hello world) it was not \nnoticed when testing. I will create a separate patch where it's removed \nbefore this patch in the series to make things clear, thanks for \nspotting this!\n\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> \n> >  \tdata->camera_ = camera.get();\n> >  \tcameraData_[camera.get()] = std::move(data);\n> >  \tcameras_.push_back(camera);\n> > \n> \n> -- \n> Regards\n> --\n> Kieran","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 156DA60BE5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2019 19:49:55 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id h27so3238379lfp.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2019 10:49:55 -0700 (PDT)","from localhost (h-177-236.A463.priv.bahnhof.se. [217.31.177.236])\n\tby smtp.gmail.com with ESMTPSA id\n\ts4sm581453lfd.77.2019.08.29.10.49.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 29 Aug 2019 10:49:53 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=H5tnPrSdgwm5yKISUMCp4oNIoTWDRZjXpfqtfqn7isQ=;\n\tb=01MaN0nqnVzb7ysdZtAdeWJPlPKZUetiEIq/glk0Ryr8A11p/QC2lCWVY6rPhVHk5g\n\t7KAwtN0pGXjZgrZQ9lGYBQqIibzpZ+KpWGDkna/jQarbvefEpwwyGS/d56e3bKfJRUqb\n\tJCfOCrye18OCbuFVqvlghqJL+0VKgnaimZ/DcL3m8bCNytbiJP9ooyrTJiC7T/EO97iI\n\tEGUTecbvJ00QBJ4EVBmeysxHdmveRBFxBd7Q/PhTqZxHc9TJzW870ihMYVd0YHqq6IrO\n\tC5p2LSFapQZvT91/nyG0FSeBBm4j1za29/UY2trojMb2MeECJ7mSyKtEsC0ms/TD+wVs\n\twqjg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=H5tnPrSdgwm5yKISUMCp4oNIoTWDRZjXpfqtfqn7isQ=;\n\tb=gfBojsHheYgxxeq0oFvhy+wy34XMKda0ZNcvvkgETqLaJCRrkiVLzeDRMS+sHf3AXZ\n\tWJ2KjRofL7QdBb3tH4LSjSM0Irm4MfJ9vbqCLiMtyJJpsFLFW/ubSKwhjji1O+OzwqCq\n\t0nav+YxohmrUhjVB2VSndnqwnMyQ9WCSYUwGhkn5McqG702rEl2tzx8zZxZ2cAF9uk5T\n\tacoWXYYbKPZjOomc0uDjc2sUKS7Slw72b/zJTviwgouaLJYq2E6h8WK3m+8eBN0nwrgD\n\tz3vjzBj+NY6H5OG/Pcq6LCbQ0RG6UfsZRpVggmWK7qb4PdTKQ0w5S6AWEnqEjte+DAQ7\n\toDsw==","X-Gm-Message-State":"APjAAAXVxVkiQ7FvopGZEpwwZLOVMS0LFxzuyKFdx8t3uL2qaWarWjxN\n\thCmnwOT2crEi0PkeEcDOVzt6/GleJRY=","X-Google-Smtp-Source":"APXvYqxgZIT/nVhdnhe/LDBPJ3OlpDbbBrZBXSe8JiOHbrj9XvZPqa1MVcl0Rsy/n5d5KRJitGXHQw==","X-Received":"by 2002:a19:6f09:: with SMTP id k9mr7036450lfc.102.1567100994235;\n\tThu, 29 Aug 2019 10:49:54 -0700 (PDT)","Date":"Thu, 29 Aug 2019 19:49:53 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190829174953.GA8479@bigcity.dyn.berto.se>","References":"<20190828011710.32128-1-niklas.soderlund@ragnatech.se>\n\t<20190828011710.32128-3-niklas.soderlund@ragnatech.se>\n\t<64ade229-0de8-3c4e-f982-0643d1de33b4@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<64ade229-0de8-3c4e-f982-0643d1de33b4@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH 02/13] libcamera: pipeline: Move IPA\n\tfrom pipeline to camera data","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Thu, 29 Aug 2019 17:49:55 -0000"}}]