[{"id":31900,"web_url":"https://patchwork.libcamera.org/comment/31900/","msgid":"<a6384f8d-413c-48dc-924b-55c3e078e1b0@ideasonboard.com>","date":"2024-10-24T09:07:32","subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Kieran\n\nOn 09/10/2024 00:13, Kieran Bingham wrote:\n> Use the new MediaPipeline to manage and identify all sensors connected\n> to complex pipelines that can connect to the CSI2 receiver before the\n> ISP.\n>\n> This can include chained multiplexers that supply multiple cameras, so\n> make use of the MediaDevice::locateEntities to search for all cameras\n> and construct a pipeline for each.\n>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 86 +++++++++---------------\n>   1 file changed, 32 insertions(+), 54 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 2fee84e56d4d..e94f047ba70c 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -37,6 +37,7 @@\n>   #include \"libcamera/internal/framebuffer.h\"\n>   #include \"libcamera/internal/ipa_manager.h\"\n>   #include \"libcamera/internal/media_device.h\"\n> +#include \"libcamera/internal/media_pipeline.h\"\n>   #include \"libcamera/internal/pipeline_handler.h\"\n>   #include \"libcamera/internal/v4l2_subdevice.h\"\n>   #include \"libcamera/internal/v4l2_videodevice.h\"\n> @@ -108,6 +109,11 @@ public:\n>   \n>   \tstd::unique_ptr<ipa::rkisp1::IPAProxyRkISP1> ipa_;\n>   \n> +\t/*\n> +\t * All entities in the pipeline, from the camera sensor to the RkISP1.\n> +\t */\n> +\tMediaPipeline pipe_;\n> +\n>   private:\n>   \tvoid paramFilled(unsigned int frame, unsigned int bytesused);\n>   \tvoid setSensorControls(unsigned int frame,\n> @@ -171,8 +177,7 @@ private:\n>   \tfriend RkISP1CameraData;\n>   \tfriend RkISP1Frames;\n>   \n> -\tint initLinks(Camera *camera, const CameraSensor *sensor,\n> -\t\t      const RkISP1CameraConfiguration &config);\n> +\tint initLinks(Camera *camera, const RkISP1CameraConfiguration &config);\n>   \tint createCamera(MediaEntity *sensor);\n>   \tvoid tryCompleteRequest(RkISP1FrameInfo *info);\n>   \tvoid bufferReady(FrameBuffer *buffer);\n> @@ -187,7 +192,6 @@ private:\n>   \tstd::unique_ptr<V4L2Subdevice> isp_;\n>   \tstd::unique_ptr<V4L2VideoDevice> param_;\n>   \tstd::unique_ptr<V4L2VideoDevice> stat_;\n> -\tstd::unique_ptr<V4L2Subdevice> csi_;\n>   \n>   \tbool hasSelfPath_;\n>   \tbool isRaw_;\n> @@ -201,8 +205,6 @@ private:\n>   \tstd::queue<FrameBuffer *> availableStatBuffers_;\n>   \n>   \tCamera *activeCamera_;\n> -\n> -\tconst MediaPad *ispSink_;\n>   };\n>   \n>   RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)\n> @@ -712,7 +714,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n>   \tCameraSensor *sensor = data->sensor_.get();\n>   \tint ret;\n>   \n> -\tret = initLinks(camera, sensor, *config);\n> +\tret = initLinks(camera, *config);\n>   \tif (ret)\n>   \t\treturn ret;\n>   \n> @@ -729,12 +731,12 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n>   \n>   \tLOG(RkISP1, Debug) << \"Sensor configured with \" << format;\n>   \n> -\tif (csi_) {\n> -\t\tret = csi_->setFormat(0, &format);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> -\t}\n> +\t/* Propagate format through the internal media pipeline up to the ISP */\n> +\tret = data->pipe_.configure(sensor, &format);\n> +\tif (ret < 0)\n> +\t\treturn ret;\n>   \n> +\tLOG(RkISP1, Debug) << \"Configuring ISP with : \" << format;\n>   \tret = isp_->setFormat(0, &format);\n>   \tif (ret < 0)\n>   \t\treturn ret;\n> @@ -1035,7 +1037,6 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)\n>    */\n>   \n>   int PipelineHandlerRkISP1::initLinks(Camera *camera,\n> -\t\t\t\t     const CameraSensor *sensor,\n>   \t\t\t\t     const RkISP1CameraConfiguration &config)\n>   {\n>   \tRkISP1CameraData *data = cameraData(camera);\n> @@ -1046,31 +1047,16 @@ int PipelineHandlerRkISP1::initLinks(Camera *camera,\n>   \t\treturn ret;\n>   \n>   \t/*\n> -\t * Configure the sensor links: enable the link corresponding to this\n> -\t * camera.\n> +\t * Configure the sensor links: enable the links corresponding to this\n> +\t * pipeline all the way up to the ISP, through any connected CSI receiver.\n>   \t */\n> -\tfor (MediaLink *link : ispSink_->links()) {\n> -\t\tif (link->source()->entity() != sensor->entity())\n> -\t\t\tcontinue;\n> -\n> -\t\tLOG(RkISP1, Debug)\n> -\t\t\t<< \"Enabling link from sensor '\"\n> -\t\t\t<< link->source()->entity()->name()\n> -\t\t\t<< \"' to ISP\";\n> -\n> -\t\tret = link->setEnabled(true);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> -\t}\n> -\n> -\tif (csi_) {\n> -\t\tMediaLink *link = isp_->entity()->getPadByIndex(0)->links().at(0);\n> -\n> -\t\tret = link->setEnabled(true);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> +\tret = data->pipe_.initLinks();\n> +\tif (ret) {\n> +\t\tLOG(RkISP1, Error) << \"Failed to set up pipe links\";\n> +\t\treturn ret;\n>   \t}\n>   \n> +\t/* Configure the paths after the ISP */\n>   \tfor (const StreamConfiguration &cfg : config) {\n>   \t\tif (cfg.stream() == &data->mainPathStream_)\n>   \t\t\tret = data->mainPath_->setEnabled(true);\n> @@ -1094,6 +1080,13 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>   \t\tstd::make_unique<RkISP1CameraData>(this, &mainPath_,\n>   \t\t\t\t\t\t   hasSelfPath_ ? &selfPath_ : nullptr);\n>   \n> +\t/* Identify the pipeline path between the sensor and the rkisp1_isp */\n> +\tret = data->pipe_.init(sensor, \"rkisp1_isp\");\n\nThe \"rkisp1_isp\" entity is a subdevice right? That makes me a bit more wary of things in the last \npatch, as the impression I got from it was that the design is for sensor subdevice to video \ndevice...let me go back to that.\n\n> +\tif (ret) {\n> +\t\tLOG(RkISP1, Error) << \"Failed to identify path from sensor to rkisp1_isp\";\n> +\t\treturn ret;\n> +\t}\n> +\n>   \tdata->sensor_ = std::make_unique<CameraSensor>(sensor);\n>   \tret = data->sensor_->init();\n>   \tif (ret)\n> @@ -1129,6 +1122,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>   \tconst std::string &id = data->sensor_->id();\n>   \tstd::shared_ptr<Camera> camera =\n>   \t\tCamera::create(std::move(data), id, streams);\n> +\n>   \tregisterCamera(std::move(camera));\n>   \n>   \treturn 0;\n> @@ -1136,8 +1130,6 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>   \n>   bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>   {\n> -\tconst MediaPad *pad;\n> -\n>   \tDeviceMatch dm(\"rkisp1\");\n>   \tdm.add(\"rkisp1_isp\");\n>   \tdm.add(\"rkisp1_resizer_mainpath\");\n> @@ -1162,22 +1154,6 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>   \tif (isp_->open() < 0)\n>   \t\treturn false;\n>   \n> -\t/* Locate and open the optional CSI-2 receiver. */\n> -\tispSink_ = isp_->entity()->getPadByIndex(0);\n> -\tif (!ispSink_ || ispSink_->links().empty())\n> -\t\treturn false;\n> -\n> -\tpad = ispSink_->links().at(0)->source();\n> -\tif (pad->entity()->function() == MEDIA_ENT_F_VID_IF_BRIDGE) {\n> -\t\tcsi_ = std::make_unique<V4L2Subdevice>(pad->entity());\n> -\t\tif (csi_->open() < 0)\n> -\t\t\treturn false;\n> -\n> -\t\tispSink_ = csi_->entity()->getPadByIndex(0);\n> -\t\tif (!ispSink_)\n> -\t\t\treturn false;\n> -\t}\n> -\n>   \t/* Locate and open the stats and params video nodes. */\n>   \tstat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_stats\");\n>   \tif (stat_->open() < 0)\n> @@ -1205,8 +1181,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>   \t * camera instance for each of them.\n>   \t */\n>   \tbool registered = false;\n> -\tfor (MediaLink *link : ispSink_->links()) {\n> -\t\tif (!createCamera(link->source()->entity()))\n> +\n> +\tfor (MediaEntity *entity : media_->locateEntities(MEDIA_ENT_F_CAM_SENSOR)) {\n> +\t\tLOG(RkISP1, Info) << \"Identified \" << entity->name();\n\nDoes this need to be an Info, or would Debug do?\n\n\nOtherwise I think this looks ok:\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\n> +\t\tif (!createCamera(entity))\n>   \t\t\tregistered = true;\n>   \t}\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 5EFCCC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Oct 2024 09:07:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27C8165393;\n\tThu, 24 Oct 2024 11:07:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B442603ED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Oct 2024 11:07:35 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A19E792\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Oct 2024 11:05:47 +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=\"FTwcHgFl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1729760747;\n\tbh=ocuSNvz6fIPca8D0rl8+DGMzzu/80nD8VywFzODBWVo=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=FTwcHgFlT7+2ZV8jZuWlFI0jYoU/rCRRe5kIZFAAMNH3F2BYUfJiAZmUytpXqQNAF\n\tYjqGrnglRbPZkvB44l6/4/WUo9ssi56sK1zoV2rQa5rbRmrHeXcIkrqb9+QR65Pa4C\n\t3oKGZiC301IE3xtPceUu08h6PLuuvsORpt12sFR0=","Message-ID":"<a6384f8d-413c-48dc-924b-55c3e078e1b0@ideasonboard.com>","Date":"Thu, 24 Oct 2024 10:07:32 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","To":"libcamera-devel@lists.libcamera.org","References":"<20241008231314.744556-1-kieran.bingham@ideasonboard.com>\n\t<20241008231314.744556-5-kieran.bingham@ideasonboard.com>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\t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","In-Reply-To":"<20241008231314.744556-5-kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":31905,"web_url":"https://patchwork.libcamera.org/comment/31905/","msgid":"<172977012516.2721096.9025686382579266367@ping.linuxembedded.co.uk>","date":"2024-10-24T11:42:05","subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Dan Scally (2024-10-24 10:07:32)\n> Hi Kieran\n> \n> On 09/10/2024 00:13, Kieran Bingham wrote:\n> > Use the new MediaPipeline to manage and identify all sensors connected\n> > to complex pipelines that can connect to the CSI2 receiver before the\n> > ISP.\n> >\n> > This can include chained multiplexers that supply multiple cameras, so\n> > make use of the MediaDevice::locateEntities to search for all cameras\n> > and construct a pipeline for each.\n> >\n> > Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 86 +++++++++---------------\n> >   1 file changed, 32 insertions(+), 54 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > index 2fee84e56d4d..e94f047ba70c 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > @@ -37,6 +37,7 @@\n> >   #include \"libcamera/internal/framebuffer.h\"\n> >   #include \"libcamera/internal/ipa_manager.h\"\n> >   #include \"libcamera/internal/media_device.h\"\n> > +#include \"libcamera/internal/media_pipeline.h\"\n> >   #include \"libcamera/internal/pipeline_handler.h\"\n> >   #include \"libcamera/internal/v4l2_subdevice.h\"\n> >   #include \"libcamera/internal/v4l2_videodevice.h\"\n> > @@ -108,6 +109,11 @@ public:\n> >   \n> >       std::unique_ptr<ipa::rkisp1::IPAProxyRkISP1> ipa_;\n> >   \n> > +     /*\n> > +      * All entities in the pipeline, from the camera sensor to the RkISP1.\n> > +      */\n> > +     MediaPipeline pipe_;\n> > +\n> >   private:\n> >       void paramFilled(unsigned int frame, unsigned int bytesused);\n> >       void setSensorControls(unsigned int frame,\n> > @@ -171,8 +177,7 @@ private:\n> >       friend RkISP1CameraData;\n> >       friend RkISP1Frames;\n> >   \n> > -     int initLinks(Camera *camera, const CameraSensor *sensor,\n> > -                   const RkISP1CameraConfiguration &config);\n> > +     int initLinks(Camera *camera, const RkISP1CameraConfiguration &config);\n> >       int createCamera(MediaEntity *sensor);\n> >       void tryCompleteRequest(RkISP1FrameInfo *info);\n> >       void bufferReady(FrameBuffer *buffer);\n> > @@ -187,7 +192,6 @@ private:\n> >       std::unique_ptr<V4L2Subdevice> isp_;\n> >       std::unique_ptr<V4L2VideoDevice> param_;\n> >       std::unique_ptr<V4L2VideoDevice> stat_;\n> > -     std::unique_ptr<V4L2Subdevice> csi_;\n> >   \n> >       bool hasSelfPath_;\n> >       bool isRaw_;\n> > @@ -201,8 +205,6 @@ private:\n> >       std::queue<FrameBuffer *> availableStatBuffers_;\n> >   \n> >       Camera *activeCamera_;\n> > -\n> > -     const MediaPad *ispSink_;\n> >   };\n> >   \n> >   RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)\n> > @@ -712,7 +714,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n> >       CameraSensor *sensor = data->sensor_.get();\n> >       int ret;\n> >   \n> > -     ret = initLinks(camera, sensor, *config);\n> > +     ret = initLinks(camera, *config);\n> >       if (ret)\n> >               return ret;\n> >   \n> > @@ -729,12 +731,12 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n> >   \n> >       LOG(RkISP1, Debug) << \"Sensor configured with \" << format;\n> >   \n> > -     if (csi_) {\n> > -             ret = csi_->setFormat(0, &format);\n> > -             if (ret < 0)\n> > -                     return ret;\n> > -     }\n> > +     /* Propagate format through the internal media pipeline up to the ISP */\n> > +     ret = data->pipe_.configure(sensor, &format);\n> > +     if (ret < 0)\n> > +             return ret;\n> >   \n> > +     LOG(RkISP1, Debug) << \"Configuring ISP with : \" << format;\n> >       ret = isp_->setFormat(0, &format);\n> >       if (ret < 0)\n> >               return ret;\n> > @@ -1035,7 +1037,6 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)\n> >    */\n> >   \n> >   int PipelineHandlerRkISP1::initLinks(Camera *camera,\n> > -                                  const CameraSensor *sensor,\n> >                                    const RkISP1CameraConfiguration &config)\n> >   {\n> >       RkISP1CameraData *data = cameraData(camera);\n> > @@ -1046,31 +1047,16 @@ int PipelineHandlerRkISP1::initLinks(Camera *camera,\n> >               return ret;\n> >   \n> >       /*\n> > -      * Configure the sensor links: enable the link corresponding to this\n> > -      * camera.\n> > +      * Configure the sensor links: enable the links corresponding to this\n> > +      * pipeline all the way up to the ISP, through any connected CSI receiver.\n> >        */\n> > -     for (MediaLink *link : ispSink_->links()) {\n> > -             if (link->source()->entity() != sensor->entity())\n> > -                     continue;\n> > -\n> > -             LOG(RkISP1, Debug)\n> > -                     << \"Enabling link from sensor '\"\n> > -                     << link->source()->entity()->name()\n> > -                     << \"' to ISP\";\n> > -\n> > -             ret = link->setEnabled(true);\n> > -             if (ret < 0)\n> > -                     return ret;\n> > -     }\n> > -\n> > -     if (csi_) {\n> > -             MediaLink *link = isp_->entity()->getPadByIndex(0)->links().at(0);\n> > -\n> > -             ret = link->setEnabled(true);\n> > -             if (ret < 0)\n> > -                     return ret;\n> > +     ret = data->pipe_.initLinks();\n> > +     if (ret) {\n> > +             LOG(RkISP1, Error) << \"Failed to set up pipe links\";\n> > +             return ret;\n> >       }\n> >   \n> > +     /* Configure the paths after the ISP */\n> >       for (const StreamConfiguration &cfg : config) {\n> >               if (cfg.stream() == &data->mainPathStream_)\n> >                       ret = data->mainPath_->setEnabled(true);\n> > @@ -1094,6 +1080,13 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n> >               std::make_unique<RkISP1CameraData>(this, &mainPath_,\n> >                                                  hasSelfPath_ ? &selfPath_ : nullptr);\n> >   \n> > +     /* Identify the pipeline path between the sensor and the rkisp1_isp */\n> > +     ret = data->pipe_.init(sensor, \"rkisp1_isp\");\n> \n> The \"rkisp1_isp\" entity is a subdevice right? That makes me a bit more wary of things in the last \n> patch, as the impression I got from it was that the design is for sensor subdevice to video \n> device...let me go back to that.\n\nYes, correct - it's a subdevice. The original code base this came from\nwas the simple pipeline handler which ends at a video device. But the\nRKISP1 feeds into the ISP.\n\nWhat I want from this series is to abstract a path of connected entities\n- and make sure that 'segment' is configurable independently regardless\nof length. In this instance - the raw data path from the sensor into\nthe ISP only.\n\n\n\n> \n> > +     if (ret) {\n> > +             LOG(RkISP1, Error) << \"Failed to identify path from sensor to rkisp1_isp\";\n> > +             return ret;\n> > +     }\n> > +\n> >       data->sensor_ = std::make_unique<CameraSensor>(sensor);\n> >       ret = data->sensor_->init();\n> >       if (ret)\n> > @@ -1129,6 +1122,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n> >       const std::string &id = data->sensor_->id();\n> >       std::shared_ptr<Camera> camera =\n> >               Camera::create(std::move(data), id, streams);\n> > +\n> >       registerCamera(std::move(camera));\n> >   \n> >       return 0;\n> > @@ -1136,8 +1130,6 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n> >   \n> >   bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n> >   {\n> > -     const MediaPad *pad;\n> > -\n> >       DeviceMatch dm(\"rkisp1\");\n> >       dm.add(\"rkisp1_isp\");\n> >       dm.add(\"rkisp1_resizer_mainpath\");\n> > @@ -1162,22 +1154,6 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n> >       if (isp_->open() < 0)\n> >               return false;\n> >   \n> > -     /* Locate and open the optional CSI-2 receiver. */\n> > -     ispSink_ = isp_->entity()->getPadByIndex(0);\n> > -     if (!ispSink_ || ispSink_->links().empty())\n> > -             return false;\n> > -\n> > -     pad = ispSink_->links().at(0)->source();\n> > -     if (pad->entity()->function() == MEDIA_ENT_F_VID_IF_BRIDGE) {\n> > -             csi_ = std::make_unique<V4L2Subdevice>(pad->entity());\n> > -             if (csi_->open() < 0)\n> > -                     return false;\n> > -\n> > -             ispSink_ = csi_->entity()->getPadByIndex(0);\n> > -             if (!ispSink_)\n> > -                     return false;\n> > -     }\n> > -\n> >       /* Locate and open the stats and params video nodes. */\n> >       stat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_stats\");\n> >       if (stat_->open() < 0)\n> > @@ -1205,8 +1181,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n> >        * camera instance for each of them.\n> >        */\n> >       bool registered = false;\n> > -     for (MediaLink *link : ispSink_->links()) {\n> > -             if (!createCamera(link->source()->entity()))\n> > +\n> > +     for (MediaEntity *entity : media_->locateEntities(MEDIA_ENT_F_CAM_SENSOR)) {\n> > +             LOG(RkISP1, Info) << \"Identified \" << entity->name();\n> \n> Does this need to be an Info, or would Debug do?\n\nYes, likely just a debug level is fine here ... We don't want things to\nbe too verbose at startup - though it does help me seeing this at\nstartup at the moment but I think I can manage to set a debug level ;-)\n\n> Otherwise I think this looks ok:\n> \n> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nThanks\n\n> \n> > +             if (!createCamera(entity))\n> >                       registered = true;\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 8BE15C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Oct 2024 11:42:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 76F7565393;\n\tThu, 24 Oct 2024 13:42:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C118618C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Oct 2024 13:42:08 +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 6B77F59D;\n\tThu, 24 Oct 2024 13:40:20 +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=\"CjTq8jDi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1729770020;\n\tbh=n6StR1D0PyiZ6ivfuB32jtdSKQ3hoZdiv6cuyoB7Umo=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=CjTq8jDi/wNQyWOv33r762Mc58+YPcqxqYPT0dEXzLoTZSSBQlzrSrMB3UwC9S/Eq\n\t2E+l9N9GBkrrA2nSljQlQhoGjDNylEQEBhd66/KIsemyVgkcB+j1I1BLbKb9sbIZlW\n\tf1AHfXY5KJi3mL4GaFkR93JgVkf7VtZIR7ghdBnc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<a6384f8d-413c-48dc-924b-55c3e078e1b0@ideasonboard.com>","References":"<20241008231314.744556-1-kieran.bingham@ideasonboard.com>\n\t<20241008231314.744556-5-kieran.bingham@ideasonboard.com>\n\t<a6384f8d-413c-48dc-924b-55c3e078e1b0@ideasonboard.com>","Subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Dan Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 24 Oct 2024 12:42:05 +0100","Message-ID":"<172977012516.2721096.9025686382579266367@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":31912,"web_url":"https://patchwork.libcamera.org/comment/31912/","msgid":"<hmyzzao7qs5ysli2w7nq4nnigsktup4wkg4eh3zbmd6sajiqw7@3wnnx2guheng>","date":"2024-10-24T16:29:55","subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Kieran\n\nOn Wed, Oct 09, 2024 at 12:13:14AM +0100, Kieran Bingham wrote:\n> Use the new MediaPipeline to manage and identify all sensors connected\n> to complex pipelines that can connect to the CSI2 receiver before the\n> ISP.\n>\n> This can include chained multiplexers that supply multiple cameras, so\n> make use of the MediaDevice::locateEntities to search for all cameras\n> and construct a pipeline for each.\n>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 86 +++++++++---------------\n>  1 file changed, 32 insertions(+), 54 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 2fee84e56d4d..e94f047ba70c 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -37,6 +37,7 @@\n>  #include \"libcamera/internal/framebuffer.h\"\n>  #include \"libcamera/internal/ipa_manager.h\"\n>  #include \"libcamera/internal/media_device.h\"\n> +#include \"libcamera/internal/media_pipeline.h\"\n>  #include \"libcamera/internal/pipeline_handler.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n>  #include \"libcamera/internal/v4l2_videodevice.h\"\n> @@ -108,6 +109,11 @@ public:\n>\n>  \tstd::unique_ptr<ipa::rkisp1::IPAProxyRkISP1> ipa_;\n>\n> +\t/*\n> +\t * All entities in the pipeline, from the camera sensor to the RkISP1.\n> +\t */\n\n(Almost) fits on 1 line\n\n> +\tMediaPipeline pipe_;\n> +\n>  private:\n>  \tvoid paramFilled(unsigned int frame, unsigned int bytesused);\n>  \tvoid setSensorControls(unsigned int frame,\n> @@ -171,8 +177,7 @@ private:\n>  \tfriend RkISP1CameraData;\n>  \tfriend RkISP1Frames;\n>\n> -\tint initLinks(Camera *camera, const CameraSensor *sensor,\n> -\t\t      const RkISP1CameraConfiguration &config);\n> +\tint initLinks(Camera *camera, const RkISP1CameraConfiguration &config);\n>  \tint createCamera(MediaEntity *sensor);\n>  \tvoid tryCompleteRequest(RkISP1FrameInfo *info);\n>  \tvoid bufferReady(FrameBuffer *buffer);\n> @@ -187,7 +192,6 @@ private:\n>  \tstd::unique_ptr<V4L2Subdevice> isp_;\n>  \tstd::unique_ptr<V4L2VideoDevice> param_;\n>  \tstd::unique_ptr<V4L2VideoDevice> stat_;\n> -\tstd::unique_ptr<V4L2Subdevice> csi_;\n>\n>  \tbool hasSelfPath_;\n>  \tbool isRaw_;\n> @@ -201,8 +205,6 @@ private:\n>  \tstd::queue<FrameBuffer *> availableStatBuffers_;\n>\n>  \tCamera *activeCamera_;\n> -\n> -\tconst MediaPad *ispSink_;\n>  };\n>\n>  RkISP1Frames::RkISP1Frames(PipelineHandler *pipe)\n> @@ -712,7 +714,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n>  \tCameraSensor *sensor = data->sensor_.get();\n>  \tint ret;\n>\n> -\tret = initLinks(camera, sensor, *config);\n> +\tret = initLinks(camera, *config);\n>  \tif (ret)\n>  \t\treturn ret;\n>\n> @@ -729,12 +731,12 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n>\n>  \tLOG(RkISP1, Debug) << \"Sensor configured with \" << format;\n>\n> -\tif (csi_) {\n> -\t\tret = csi_->setFormat(0, &format);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> -\t}\n> +\t/* Propagate format through the internal media pipeline up to the ISP */\n> +\tret = data->pipe_.configure(sensor, &format);\n> +\tif (ret < 0)\n> +\t\treturn ret;\n\nActually the API is not that bad\n\n>\n> +\tLOG(RkISP1, Debug) << \"Configuring ISP with : \" << format;\n>  \tret = isp_->setFormat(0, &format);\n>  \tif (ret < 0)\n>  \t\treturn ret;\n> @@ -1035,7 +1037,6 @@ int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)\n>   */\n>\n>  int PipelineHandlerRkISP1::initLinks(Camera *camera,\n> -\t\t\t\t     const CameraSensor *sensor,\n>  \t\t\t\t     const RkISP1CameraConfiguration &config)\n>  {\n>  \tRkISP1CameraData *data = cameraData(camera);\n> @@ -1046,31 +1047,16 @@ int PipelineHandlerRkISP1::initLinks(Camera *camera,\n>  \t\treturn ret;\n>\n>  \t/*\n> -\t * Configure the sensor links: enable the link corresponding to this\n> -\t * camera.\n> +\t * Configure the sensor links: enable the links corresponding to this\n> +\t * pipeline all the way up to the ISP, through any connected CSI receiver.\n>  \t */\n> -\tfor (MediaLink *link : ispSink_->links()) {\n> -\t\tif (link->source()->entity() != sensor->entity())\n> -\t\t\tcontinue;\n> -\n> -\t\tLOG(RkISP1, Debug)\n> -\t\t\t<< \"Enabling link from sensor '\"\n> -\t\t\t<< link->source()->entity()->name()\n> -\t\t\t<< \"' to ISP\";\n> -\n> -\t\tret = link->setEnabled(true);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> -\t}\n> -\n> -\tif (csi_) {\n> -\t\tMediaLink *link = isp_->entity()->getPadByIndex(0)->links().at(0);\n> -\n> -\t\tret = link->setEnabled(true);\n> -\t\tif (ret < 0)\n> -\t\t\treturn ret;\n> +\tret = data->pipe_.initLinks();\n> +\tif (ret) {\n> +\t\tLOG(RkISP1, Error) << \"Failed to set up pipe links\";\n> +\t\treturn ret;\n>  \t}\n>\n> +\t/* Configure the paths after the ISP */\n>  \tfor (const StreamConfiguration &cfg : config) {\n>  \t\tif (cfg.stream() == &data->mainPathStream_)\n>  \t\t\tret = data->mainPath_->setEnabled(true);\n> @@ -1094,6 +1080,13 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \t\tstd::make_unique<RkISP1CameraData>(this, &mainPath_,\n>  \t\t\t\t\t\t   hasSelfPath_ ? &selfPath_ : nullptr);\n>\n> +\t/* Identify the pipeline path between the sensor and the rkisp1_isp */\n> +\tret = data->pipe_.init(sensor, \"rkisp1_isp\");\n> +\tif (ret) {\n> +\t\tLOG(RkISP1, Error) << \"Failed to identify path from sensor to rkisp1_isp\";\n> +\t\treturn ret;\n> +\t}\n> +\n>  \tdata->sensor_ = std::make_unique<CameraSensor>(sensor);\n>  \tret = data->sensor_->init();\n>  \tif (ret)\n> @@ -1129,6 +1122,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \tconst std::string &id = data->sensor_->id();\n>  \tstd::shared_ptr<Camera> camera =\n>  \t\tCamera::create(std::move(data), id, streams);\n> +\n>  \tregisterCamera(std::move(camera));\n>\n>  \treturn 0;\n> @@ -1136,8 +1130,6 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>\n>  bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>  {\n> -\tconst MediaPad *pad;\n> -\n>  \tDeviceMatch dm(\"rkisp1\");\n>  \tdm.add(\"rkisp1_isp\");\n>  \tdm.add(\"rkisp1_resizer_mainpath\");\n> @@ -1162,22 +1154,6 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>  \tif (isp_->open() < 0)\n>  \t\treturn false;\n>\n> -\t/* Locate and open the optional CSI-2 receiver. */\n> -\tispSink_ = isp_->entity()->getPadByIndex(0);\n> -\tif (!ispSink_ || ispSink_->links().empty())\n> -\t\treturn false;\n> -\n> -\tpad = ispSink_->links().at(0)->source();\n> -\tif (pad->entity()->function() == MEDIA_ENT_F_VID_IF_BRIDGE) {\n> -\t\tcsi_ = std::make_unique<V4L2Subdevice>(pad->entity());\n> -\t\tif (csi_->open() < 0)\n> -\t\t\treturn false;\n> -\n> -\t\tispSink_ = csi_->entity()->getPadByIndex(0);\n> -\t\tif (!ispSink_)\n> -\t\t\treturn false;\n> -\t}\n> -\n>  \t/* Locate and open the stats and params video nodes. */\n>  \tstat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_stats\");\n>  \tif (stat_->open() < 0)\n> @@ -1205,8 +1181,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n>  \t * camera instance for each of them.\n>  \t */\n>  \tbool registered = false;\n> -\tfor (MediaLink *link : ispSink_->links()) {\n> -\t\tif (!createCamera(link->source()->entity()))\n> +\n> +\tfor (MediaEntity *entity : media_->locateEntities(MEDIA_ENT_F_CAM_SENSOR)) {\n> +\t\tLOG(RkISP1, Info) << \"Identified \" << entity->name();\n> +\t\tif (!createCamera(entity))\n>  \t\t\tregistered = true;\n\nLooks good\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n>  \t}\n>\n> --\n> 2.34.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 9F1ABC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Oct 2024 16:30:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 531BD65393;\n\tThu, 24 Oct 2024 18:30:01 +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 30103618C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Oct 2024 18:29:59 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF437353;\n\tThu, 24 Oct 2024 18:28:10 +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=\"Vh+WA30x\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1729787291;\n\tbh=GdPXbcFH6Nb3O14kdRVsyRCONAe+0DNdduo/sThk2zQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Vh+WA30xxV3t2UmvQu6Ch46/bjNz2BVJM1s8qgPAEMI4A7Uh+5HQGnlGmQUYXj/n+\n\t3icxvJG7gEXX61/qz0NRtUxqI1BsDHOAgdMktiDvaZeYuWV7syh3onlGN48xR/agNC\n\te3CwXllhrRGRmD68kPVp/yXM67hs9gcQ5+oYWJRA=","Date":"Thu, 24 Oct 2024 18:29:55 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>, \n\tUmang Jain <umang.jain@ideasonboard.com>","Subject":"Re: [PATCH v3 4/4] libcamera: pipeline: rkisp1: Convert to use\n\tMediaPipeline","Message-ID":"<hmyzzao7qs5ysli2w7nq4nnigsktup4wkg4eh3zbmd6sajiqw7@3wnnx2guheng>","References":"<20241008231314.744556-1-kieran.bingham@ideasonboard.com>\n\t<20241008231314.744556-5-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241008231314.744556-5-kieran.bingham@ideasonboard.com>","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>"}}]