Patch Detail
Show a patch.
GET /api/patches/16887/?format=api
{ "id": 16887, "url": "https://patchwork.libcamera.org/api/patches/16887/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16887/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20220801000543.3501-11-laurent.pinchart@ideasonboard.com>", "date": "2022-08-01T00:05:40", "name": "[libcamera-devel,10/13] libcamera: pipeline: simple: Setup links in the context of sink entities", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "76f5cb1e29d2b088360640aa8697408bd39da10b", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16887/mbox/", "series": [ { "id": 3352, "url": "https://patchwork.libcamera.org/api/series/3352/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3352", "date": "2022-08-01T00:05:30", "name": "libcamera: pipeline: simple: Support the NXP i.MX8 ISI", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3352/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16887/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16887/checks/", "tags": {}, "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 21B89BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 1 Aug 2022 00:06:05 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFE3A63330;\n\tMon, 1 Aug 2022 02:06:04 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2133D63323\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 1 Aug 2022 02:06:03 +0200 (CEST)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B0AF69AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 1 Aug 2022 02:06:02 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659312364;\n\tbh=A+plz7jYk6G2UzvKnAwXKWZGJTdy/JSjFZehHss5AQM=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=AZ/C4dgTYRlPbtuCn86A3xwoTnpy1o8uh23g0y+HevG/Ywnquh/5+aIGBQF4Hf8Mp\n\tVY0uK/qpc3PKIMz25IdwW+oDRLASHTScXnGG/TAuatPDLzCZxGtaepBt1YsqpDDj3d\n\tN7LulyDKXi8AglkKmxmw4qpUb6pUz6XiyR7QMcwtuVHDWr2KQ8eDzCDZPgFco34sVj\n\tGd8WrJzcAjx9CTEH0vUdVYv/trRysmgqHdJuelOQRbL5ixcwuIHy+QUY/a87se7weJ\n\t5EL5t/QPJ2rIW9B7KYOJjlkpyKAKTNs3GhYPrEHzK0GbFygmgQY1fjCikmV2/mDNYK\n\t4osYVaWWCJUhQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659312362;\n\tbh=A+plz7jYk6G2UzvKnAwXKWZGJTdy/JSjFZehHss5AQM=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=JNA3ygGKrAkuYp7H7vCXMQ/NuTNeGvG3mpeSUCc/d8ihxsHpDJwo3OIfXY3ybJv7L\n\tPBhP86qxHVoYr8ldohnSK4zAAMyjhWm5MZwdP0tJCVRs8IssrqjbuS1D6WSTjvGhxa\n\tGUB27oP9w0QV6vvKinK3Q1/7bYVCzyWAMvReepQc=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JNA3ygGK\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 1 Aug 2022 03:05:40 +0300", "Message-Id": "<20220801000543.3501-11-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220801000543.3501-1-laurent.pinchart@ideasonboard.com>", "References": "<20220801000543.3501-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 10/13] libcamera: pipeline: simple: Setup\n\tlinks in the context of sink entities", "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>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "To setup links the pipeline handler iterates over all entities in the\npipeline and disables all links but the ones we want to enable. Some\nentities don't allow multiple sink links to be enabled, so the iteration\nneeds to be based on sink entities, disabling all their links first and\nthen enabling the sink link that is part of the pipeline.\n\nThe loop implementation iterates over all Entity instances, and uses\ntheir source link to locate the MediaEntity for the connected sink. The\nsink entity is then processed in the context of the source's loop\niteration. This prevents the code from being able to access extra\ninformation about the sink entity, as we only have access to the\nMediaEntity, not the Entity.\n\nTo prepare for subdev routing support that will require accessing\nadditional entity information, refactor the loop to process the sink\nentity in the context of its Entity instance.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 24 +++++++++++++++++-------\n 1 file changed, 17 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 731d355efda6..4bde9caa7254 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -578,15 +578,23 @@ int SimpleCameraData::setupLinks()\n \t * multiple sink links to be enabled together, even on different sink\n \t * pads. We must thus start by disabling all sink links (but the one we\n \t * want to enable) before enabling the pipeline link.\n+\t *\n+\t * The entities_ list stores entities along with their source link. We\n+\t * need to process the link in the context of the sink entity, so\n+\t * record the source link of the current entity as the sink link of the\n+\t * next entity, and skip the first entity in the loop.\n \t */\n+\tMediaLink *sinkLink = nullptr;\n+\n \tfor (SimpleCameraData::Entity &e : entities_) {\n-\t\tif (!e.sourceLink)\n-\t\t\tbreak;\n+\t\tif (!sinkLink) {\n+\t\t\tsinkLink = e.sourceLink;\n+\t\t\tcontinue;\n+\t\t}\n \n-\t\tMediaEntity *remote = e.sourceLink->sink()->entity();\n-\t\tfor (MediaPad *pad : remote->pads()) {\n+\t\tfor (MediaPad *pad : e.entity->pads()) {\n \t\t\tfor (MediaLink *link : pad->links()) {\n-\t\t\t\tif (link == e.sourceLink)\n+\t\t\t\tif (link == sinkLink)\n \t\t\t\t\tcontinue;\n \n \t\t\t\tif ((link->flags() & MEDIA_LNK_FL_ENABLED) &&\n@@ -598,11 +606,13 @@ int SimpleCameraData::setupLinks()\n \t\t\t}\n \t\t}\n \n-\t\tif (!(e.sourceLink->flags() & MEDIA_LNK_FL_ENABLED)) {\n-\t\t\tret = e.sourceLink->setEnabled(true);\n+\t\tif (!(sinkLink->flags() & MEDIA_LNK_FL_ENABLED)) {\n+\t\t\tret = sinkLink->setEnabled(true);\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n \t\t}\n+\n+\t\tsinkLink = e.sourceLink;\n \t}\n \n \treturn 0;\n", "prefixes": [ "libcamera-devel", "10/13" ] }