{"id":2656,"url":"https://patchwork.libcamera.org/api/1.1/patches/2656/?format=json","web_url":"https://patchwork.libcamera.org/patch/2656/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200117145619.3321911-1-helen.koike@collabora.com>","date":"2020-01-17T14:56:18","name":"[libcamera-devel,1/2] libcamera: pipeline: rkisp1: sync topology with upstream driver","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b59f253d05ac32f842708322c63c707080a63125","submitter":{"id":20,"url":"https://patchwork.libcamera.org/api/1.1/people/20/?format=json","name":"Helen Koike","email":"helen.koike@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2656/mbox/","series":[{"id":632,"url":"https://patchwork.libcamera.org/api/1.1/series/632/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=632","date":"2020-01-17T14:56:18","name":"[libcamera-devel,1/2] libcamera: pipeline: rkisp1: sync topology with upstream driver","version":1,"mbox":"https://patchwork.libcamera.org/series/632/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2656/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2656/checks/","tags":{},"headers":{"Return-Path":"<helen.koike@collabora.com>","Received":["from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8CAD60456\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 15:56:30 +0100 (CET)","from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: koike) with ESMTPSA id 86B0D294912"],"From":"Helen Koike <helen.koike@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"laurent.pinchart@ideasonboard.com, kernel@collabora.com, heiko@sntech.de,\n\ttfiga@chromium.org, niklas.soderlund@ragnatech.se,\n\tjoacim.zetterling@gmail.com","Date":"Fri, 17 Jan 2020 11:56:18 -0300","Message-Id":"<20200117145619.3321911-1-helen.koike@collabora.com>","X-Mailer":"git-send-email 2.24.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: pipeline: rkisp1: sync\n\ttopology with upstream driver","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>","X-List-Received-Date":"Fri, 17 Jan 2020 14:56:31 -0000"},"content":"rkisp1 kernel driver was merged upstream with minor changes in the\ntopology from the original driver libcamera based it's first support to\nrkisp1.\n\nAdapt libcamera pipeline to work with upstream driver.\n\n* Remove subdevice dphy from the pipeline.\n* Add resizer in the pipeline.\n* Fix links.\n* Update entity names.\n\nSigned-off-by: Helen Koike <helen.koike@collabora.com>\n\n---\n\nChanges in v2:\n* Update rkisp1-capture.sh in a different patch\n* Fix typos in commit message.\n* Remove \"receiver\" and \"CSI-2\" reference at:\n\n                        << \" link from sensor '\"\n                        << link->source()->entity()->name()\n-                       << \"' to CSI-2 receiver\";\n+                       << \"' to ISP\";\n...\n\n-        * Enumerate all sensors connected to the ISP receiver and create one\n+        * Enumerate all sensors connected to the ISP and create one\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 65 +++++++++++++-----------\n 1 file changed, 36 insertions(+), 29 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 389a99c..e25b215 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -207,8 +207,8 @@ private:\n \tint freeBuffers(Camera *camera);\n \n \tMediaDevice *media_;\n-\tV4L2Subdevice *dphy_;\n \tV4L2Subdevice *isp_;\n+\tV4L2Subdevice *resizer_;\n \tV4L2VideoDevice *video_;\n \tV4L2VideoDevice *param_;\n \tV4L2VideoDevice *stat_;\n@@ -513,7 +513,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n }\n \n PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager)\n-\t: PipelineHandler(manager), dphy_(nullptr), isp_(nullptr),\n+\t: PipelineHandler(manager), isp_(nullptr), resizer_(nullptr),\n \t  video_(nullptr), param_(nullptr), stat_(nullptr)\n {\n }\n@@ -523,8 +523,8 @@ PipelineHandlerRkISP1::~PipelineHandlerRkISP1()\n \tdelete param_;\n \tdelete stat_;\n \tdelete video_;\n+\tdelete resizer_;\n \tdelete isp_;\n-\tdelete dphy_;\n }\n \n /* -----------------------------------------------------------------------------\n@@ -564,7 +564,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t * Configure the sensor links: enable the link corresponding to this\n \t * camera and disable all the other sensor links.\n \t */\n-\tconst MediaPad *pad = dphy_->entity()->getPadByIndex(0);\n+\tconst MediaPad *pad = isp_->entity()->getPadByIndex(0);\n \n \tfor (MediaLink *link : pad->links()) {\n \t\tbool enable = link->source()->entity() == sensor->entity();\n@@ -576,7 +576,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \t\t\t<< (enable ? \"Enabling\" : \"Disabling\")\n \t\t\t<< \" link from sensor '\"\n \t\t\t<< link->source()->entity()->name()\n-\t\t\t<< \"' to CSI-2 receiver\";\n+\t\t\t<< \"' to ISP\";\n \n \t\tret = link->setEnabled(enable);\n \t\tif (ret < 0)\n@@ -596,16 +596,6 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tLOG(RkISP1, Debug) << \"Sensor configured with \" << format.toString();\n \n-\tret = dphy_->setFormat(0, &format);\n-\tif (ret < 0)\n-\t\treturn ret;\n-\n-\tLOG(RkISP1, Debug) << \"Configuring ISP input pad with \" << format.toString();\n-\n-\tret = dphy_->getFormat(1, &format);\n-\tif (ret < 0)\n-\t\treturn ret;\n-\n \tret = isp_->setFormat(0, &format);\n \tif (ret < 0)\n \t\treturn ret;\n@@ -622,6 +612,22 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tLOG(RkISP1, Debug) << \"ISP output pad configured with \" << format.toString();\n \n+\tret = resizer_->setFormat(0, &format);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tLOG(RkISP1, Debug) << \"Resizer input pad configured with \" << format.toString();\n+\n+\tformat.size = cfg.size;\n+\n+\tLOG(RkISP1, Debug) << \"Configuring resizer output pad with \" << format.toString();\n+\n+\tret = resizer_->setFormat(1, &format);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\tLOG(RkISP1, Debug) << \"Resizer output pad configured with \" << format.toString();\n+\n \tV4L2DeviceFormat outputFormat = {};\n \toutputFormat.fourcc = video_->toV4L2Fourcc(cfg.pixelFormat);\n \toutputFormat.size = cfg.size;\n@@ -868,7 +874,7 @@ int PipelineHandlerRkISP1::initLinks()\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tlink = media_->link(\"rockchip-sy-mipi-dphy\", 1, \"rkisp1-isp-subdev\", 0);\n+\tlink = media_->link(\"rkisp1_isp\", 2, \"rkisp1_resizer_mainpath\", 0);\n \tif (!link)\n \t\treturn -ENODEV;\n \n@@ -876,7 +882,7 @@ int PipelineHandlerRkISP1::initLinks()\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tlink = media_->link(\"rkisp1-isp-subdev\", 2, \"rkisp1_mainpath\", 0);\n+\tlink = media_->link(\"rkisp1_resizer_mainpath\", 1, \"rkisp1_mainpath\", 0);\n \tif (!link)\n \t\treturn -ENODEV;\n \n@@ -923,24 +929,25 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tconst MediaPad *pad;\n \n \tDeviceMatch dm(\"rkisp1\");\n-\tdm.add(\"rkisp1-isp-subdev\");\n+\tdm.add(\"rkisp1_isp\");\n+\tdm.add(\"rkisp1_resizer_selfpath\");\n+\tdm.add(\"rkisp1_resizer_mainpath\");\n \tdm.add(\"rkisp1_selfpath\");\n \tdm.add(\"rkisp1_mainpath\");\n-\tdm.add(\"rkisp1-statistics\");\n-\tdm.add(\"rkisp1-input-params\");\n-\tdm.add(\"rockchip-sy-mipi-dphy\");\n+\tdm.add(\"rkisp1_stats\");\n+\tdm.add(\"rkisp1_params\");\n \n \tmedia_ = acquireMediaDevice(enumerator, dm);\n \tif (!media_)\n \t\treturn false;\n \n \t/* Create the V4L2 subdevices we will need. */\n-\tdphy_ = V4L2Subdevice::fromEntityName(media_, \"rockchip-sy-mipi-dphy\");\n-\tif (dphy_->open() < 0)\n+\tisp_ = V4L2Subdevice::fromEntityName(media_, \"rkisp1_isp\");\n+\tif (isp_->open() < 0)\n \t\treturn false;\n \n-\tisp_ = V4L2Subdevice::fromEntityName(media_, \"rkisp1-isp-subdev\");\n-\tif (isp_->open() < 0)\n+\tresizer_ = V4L2Subdevice::fromEntityName(media_, \"rkisp1_resizer_mainpath\");\n+\tif (resizer_->open() < 0)\n \t\treturn false;\n \n \t/* Locate and open the capture video node. */\n@@ -948,11 +955,11 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \tif (video_->open() < 0)\n \t\treturn false;\n \n-\tstat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1-statistics\");\n+\tstat_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_stats\");\n \tif (stat_->open() < 0)\n \t\treturn false;\n \n-\tparam_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1-input-params\");\n+\tparam_ = V4L2VideoDevice::fromEntityName(media_, \"rkisp1_params\");\n \tif (param_->open() < 0)\n \t\treturn false;\n \n@@ -967,10 +974,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n \t}\n \n \t/*\n-\t * Enumerate all sensors connected to the CSI-2 receiver and create one\n+\t * Enumerate all sensors connected to the ISP and create one\n \t * camera instance for each of them.\n \t */\n-\tpad = dphy_->entity()->getPadByIndex(0);\n+\tpad = isp_->entity()->getPadByIndex(0);\n \tif (!pad)\n \t\treturn false;\n \n","prefixes":["libcamera-devel","1/2"]}