Patch Detail
Show a patch.
GET /api/1.1/patches/2649/?format=api
{ "id": 2649, "url": "https://patchwork.libcamera.org/api/1.1/patches/2649/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2649/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200116004553.2885674-1-helen.koike@collabora.com>", "date": "2020-01-16T00:45:53", "name": "[libcamera-devel] libcamera: pipeline: rkisp1: sync topology with upstream driver", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "007da035df5c5bf3381d2cae845bb57e67e41522", "submitter": { "id": 20, "url": "https://patchwork.libcamera.org/api/1.1/people/20/?format=api", "name": "Helen Koike", "email": "helen.koike@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2649/mbox/", "series": [ { "id": 627, "url": "https://patchwork.libcamera.org/api/1.1/series/627/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=627", "date": "2020-01-16T00:45:53", "name": "[libcamera-devel] libcamera: pipeline: rkisp1: sync topology with upstream driver", "version": 1, "mbox": "https://patchwork.libcamera.org/series/627/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2649/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2649/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 D2F3C6074F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jan 2020 01:46:03 +0100 (CET)", "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: koike) with ESMTPSA id BF8DE293506" ], "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", "Date": "Wed, 15 Jan 2020 21:45:53 -0300", "Message-Id": "<20200116004553.2885674-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] 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": "Thu, 16 Jan 2020 00:46:05 -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 libramera 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\nHi,\n\nI'm not sure if it is better to wait the driver to get out of staging,\nbut in any case I'm sending it here in case others want to use it.\n\nIt is also available at:\nhttps://gitlab.collabora.com/koike/libcamera\n\nThanks\nHelen\n\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 63 +++++++++++++-----------\n utils/rkisp1/rkisp1-capture.sh | 16 +++---\n 2 files changed, 43 insertions(+), 36 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 389a99c..279bbb6 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@@ -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 receiver 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 \ndiff --git a/utils/rkisp1/rkisp1-capture.sh b/utils/rkisp1/rkisp1-capture.sh\nindex cffe9fe..4d09f5d 100755\n--- a/utils/rkisp1/rkisp1-capture.sh\n+++ b/utils/rkisp1/rkisp1-capture.sh\n@@ -68,14 +68,14 @@ configure_pipeline() {\n \n \t$mediactl -r\n \n-\t$mediactl -l \"'$sensor':0 -> 'rockchip-sy-mipi-dphy':0 [1]\"\n-\t$mediactl -l \"'rockchip-sy-mipi-dphy':1 -> 'rkisp1-isp-subdev':0 [1]\"\n-\t$mediactl -l \"'rkisp1-isp-subdev':2 -> 'rkisp1_mainpath':0 [1]\"\n+\t$mediactl -l \"'$sensor':0 -> 'rkisp1_isp':0 [1]\"\n+\t$mediactl -l \"'rkisp1_isp':2 -> 'rkisp1_resizer_mainpath':0 [1]\"\n \n \t$mediactl -V \"\\\"$sensor\\\":0 [$format]\"\n-\t$mediactl -V \"'rockchip-sy-mipi-dphy':1 [$format]\"\n-\t$mediactl -V \"'rkisp1-isp-subdev':0 [$format crop:(0,0)/$sensor_size]\"\n-\t$mediactl -V \"'rkisp1-isp-subdev':2 [fmt:$capture_mbus_code/$capture_size crop:(0,0)/$capture_size]\"\n+\t$mediactl -V \"'rkisp1_isp':0 [$format crop:(0,0)/$sensor_size]\"\n+\t$mediactl -V \"'rkisp1_isp':2 [fmt:$capture_mbus_code/$sensor_size crop:(0,0)/$sensor_size]\"\n+\t$mediactl -V \"'rkisp1_resizer_mainpath':0 [fmt:$capture_mbus_code/$sensor_size crop:(0,0)/$sensor_size]\"\n+\t$mediactl -V \"'rkisp1_resizer_mainpath':1 [fmt:$capture_mbus_code/$capture_size]\"\n }\n \n # Capture frames\n@@ -161,8 +161,8 @@ fi\n \n sensor_name=$1\n \n-modprobe mipi_dphy_sy\n-modprobe video_rkisp1\n+modprobe phy_rockchip_dphy_rx0\n+modprobe rockchip_isp1\n \n sensor=$(find_sensor $sensor_name) || exit\n mdev=$(find_media_device rkisp1) || exit\n", "prefixes": [ "libcamera-devel" ] }