Patch Detail
Show a patch.
GET /api/1.1/patches/15160/?format=api
{ "id": 15160, "url": "https://patchwork.libcamera.org/api/1.1/patches/15160/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15160/", "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": "<20211213232849.40071-6-djrscally@gmail.com>", "date": "2021-12-13T23:28:49", "name": "[libcamera-devel,5/5] media: v4l2-async: Create links during v4l2_async_match_notify()", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "5c71216ccb3e12eb3ebe05702750ff9d36cae11d", "submitter": { "id": 90, "url": "https://patchwork.libcamera.org/api/1.1/people/90/?format=api", "name": "Daniel Scally", "email": "djrscally@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15160/mbox/", "series": [ { "id": 2843, "url": "https://patchwork.libcamera.org/api/1.1/series/2843/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2843", "date": "2021-12-13T23:28:44", "name": "Introduce ancillary links", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2843/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15160/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15160/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 8F9AEBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Dec 2021 23:29:12 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19BA3608A5;\n\tTue, 14 Dec 2021 00:29:12 +0100 (CET)", "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 872D96089A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 00:29:09 +0100 (CET)", "by mail-wr1-x432.google.com with SMTP id v11so29606658wrw.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Dec 2021 15:29:09 -0800 (PST)", "from localhost.localdomain\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\t38sm12551643wrc.1.2021.12.13.15.29.08\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 13 Dec 2021 15:29:08 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"aOtZvsZu\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=zPcgwKf+mxuvjKfph3hk9rnBdcEBzs1sgAB4FsNazWI=;\n\tb=aOtZvsZuASZ8nN15qXvrkYoGXMz++nvFlabc3Tqvs1q/Qe00IAACWvhcef4XiKdZ4x\n\tMMgyPxuyiB0bhlIGGFx12I3CjVJMzDOc1VFOtfm0xiHBF7h3xhU8zt5rlBDhOxdYM+QM\n\t6d0aU/DDa97+9TY9yLQCqBm8cVc/Xxu5+Q8aH1VFU+LwIMPULOyPhw/y1URN6jQMc5p+\n\tBxxx2VV/Fe0rRfSuIRO5iqv8uq5J082aU5RbK1USCXe86qsWWA1kLU9fymvG/enIoOZe\n\tojk13skpn/WGCVs1wi5dTbRbVQv+mQIRjf4skzJe9CXBa5yKAeXXPbjcRzhweePZ2g8x\n\tFRjw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=zPcgwKf+mxuvjKfph3hk9rnBdcEBzs1sgAB4FsNazWI=;\n\tb=JiSESxPR158GpgPbXIOTKaeTW07raXj40FHKNgZLmtYDMVIiaxw4cMFArs15xGminO\n\t4QRTUMWNMb8dFFMSD7lL46ZOly3p1jHF/n2U4Bwm8HWjWsFPVrhM7YGvN5heuAxKstbZ\n\t9SqYt2KnEOv402lNWgddm+YuP0SFRYjQPeJ5ab9/+w/s97ppnyCR8KrOrkrZLuRvWH1P\n\t0C23S4dssi7Vsi5wzCyY42Zghc29bDCVDq3SIjgjlOzPR+Ip7+0LzbYQB3gRfr9qME68\n\t/JTaYsdgXoeLEOBmjNqyBogqJSautRh+cHcPkQWPx9EhcJpvnOzTqFjKh/9GemKywUb0\n\tZclg==", "X-Gm-Message-State": "AOAM531HkYG7u9tDC7SZ8Iyck6r1kixZhLDHsoz8b/YPeRmQOyku84g9\n\tlkUa6e0QMZpaTFJzH4exeh0=", "X-Google-Smtp-Source": "ABdhPJwhIpe9gU+vpL+2cw8coxTBn7ak04EInINQaeKsxpW+bKWAFZN3VmhUaRERQaTFEgRJxoXUGg==", "X-Received": "by 2002:adf:fb09:: with SMTP id c9mr1678813wrr.223.1639438149280;\n\tMon, 13 Dec 2021 15:29:09 -0800 (PST)", "From": "Daniel Scally <djrscally@gmail.com>", "To": "linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org", "Date": "Mon, 13 Dec 2021 23:28:49 +0000", "Message-Id": "<20211213232849.40071-6-djrscally@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211213232849.40071-1-djrscally@gmail.com>", "References": "<20211213232849.40071-1-djrscally@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 5/5] media: v4l2-async: Create links\n\tduring v4l2_async_match_notify()", "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>", "Cc": "sakari.ailus@linux.intel.com", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Upon an async fwnode match, there's some typical behaviour that the\nnotifier and matching subdev will want to do. For example, a notifier\nrepresenting a sensor matching to an async subdev representing its\nVCM will want to create an ancillary link to expose that relationship\nto userspace.\n\nTo avoid lots of code in individual drivers, try to build these links\nwithin v4l2 core.\n\nSigned-off-by: Daniel Scally <djrscally@gmail.com>\n---\nChanges since the rfc:\n\n\t- None\n\n drivers/media/v4l2-core/v4l2-async.c | 51 ++++++++++++++++++++++++++++\n 1 file changed, 51 insertions(+)", "diff": "diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c\nindex 0404267f1ae4..6575b1cbe95f 100644\n--- a/drivers/media/v4l2-core/v4l2-async.c\n+++ b/drivers/media/v4l2-core/v4l2-async.c\n@@ -275,6 +275,45 @@ v4l2_async_nf_try_complete(struct v4l2_async_notifier *notifier)\n static int\n v4l2_async_nf_try_all_subdevs(struct v4l2_async_notifier *notifier);\n \n+static int\n+__v4l2_async_create_ancillary_link(struct v4l2_async_notifier *notifier,\n+\t\t\t\t struct v4l2_subdev *sd)\n+{\n+\tstruct media_link *link;\n+\n+\tif (sd->entity.function != MEDIA_ENT_F_LENS &&\n+\t sd->entity.function != MEDIA_ENT_F_FLASH)\n+\t\treturn -EINVAL;\n+\n+\tlink = media_create_ancillary_link(¬ifier->sd->entity, &sd->entity,\n+\t\t\t\t\t MEDIA_LNK_FL_ENABLED |\n+\t\t\t\t\t MEDIA_LNK_FL_IMMUTABLE);\n+\n+\treturn IS_ERR(link) ? PTR_ERR(link) : 0;\n+}\n+\n+/*\n+ * Setup links on behalf of the notifier and subdev, where it's obvious what\n+ * should be done. At the moment, we only support cases where the notifier\n+ * is a sensor and the subdev is a lens.\n+ *\n+ * TODO: Setup pad links if the notifier's function is MEDIA_ENT_F_VID_IF_BRIDGE\n+ * and the subdev's is MEDIA_ENT_F_CAM_SENSOR\n+ */\n+static int v4l2_async_try_create_links(struct v4l2_async_notifier *notifier,\n+\t\t\t\t struct v4l2_subdev *sd)\n+{\n+\tif (!notifier->sd)\n+\t\treturn 0;\n+\n+\tswitch (notifier->sd->entity.function) {\n+\tcase MEDIA_ENT_F_CAM_SENSOR:\n+\t\treturn __v4l2_async_create_ancillary_link(notifier, sd);\n+\tdefault:\n+\t\treturn 0;\n+\t}\n+}\n+\n static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,\n \t\t\t\t struct v4l2_device *v4l2_dev,\n \t\t\t\t struct v4l2_subdev *sd,\n@@ -293,6 +332,18 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,\n \t\treturn ret;\n \t}\n \n+\t/*\n+\t * Depending of the function of the entities involved, we may want to\n+\t * create links between them (for example between a sensor and its lens\n+\t * or between a sensor's source pad and the connected device's sink\n+\t * pad)\n+\t */\n+\tret = v4l2_async_try_create_links(notifier, sd);\n+\tif (ret) {\n+\t\tv4l2_device_unregister_subdev(sd);\n+\t\treturn ret;\n+\t}\n+\n \t/* Remove from the waiting list */\n \tlist_del(&asd->list);\n \tsd->asd = asd;\n", "prefixes": [ "libcamera-devel", "5/5" ] }