Show a patch.

GET /api/1.1/patches/15159/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 15159,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15159/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15159/",
    "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-5-djrscally@gmail.com>",
    "date": "2021-12-13T23:28:48",
    "name": "[libcamera-devel,4/5] media: entity: Add support for ancillary links",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "ae62b88beb2c57f04753cd21dd3505a31a0eb9a0",
    "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/15159/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/15159/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15159/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 1CE5AC3258\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 A016D60876;\n\tTue, 14 Dec 2021 00:29:11 +0100 (CET)",
            "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ACF2660822\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 00:29:08 +0100 (CET)",
            "by mail-wr1-x431.google.com with SMTP id v11so29606622wrw.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Dec 2021 15:29:08 -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.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 13 Dec 2021 15:29:07 -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=\"jZw8QXwr\"; 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=WPmh++1yGOyffVNvBSBuVqzTMZyztDE2gAwt3atAco0=;\n\tb=jZw8QXwrR4JYgOck8siYAetE+xqhNFOOHpiMs4vysQyrym/KsUzR5sDe34pI2nrOy7\n\tX4WokiJPeGPmrcu2RD6VOr66Fhlkc0K9HtcXHvaoC+vQZGG5vOi3WPM079kUKDiZWysc\n\t2OP8Ox+DGgHkdNcMReO7h6lewL+9MnX4hq04789HxRUHYESPDoKEJ+V0Yfw+GDkBLHT3\n\tEG3xzDTxCcAxj9PxLUv1k0SlWsJ+Jvz2BKB2WEwn4CbhHBP5AiTDZBgfkTq07/Ir0iOW\n\tlRASh0cQ670rur9OZ3rj81y8Cu+dewMBysnjYnnvsgtNCthIp4+rM0klQ7mahb9frrmR\n\tceeQ==",
        "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=WPmh++1yGOyffVNvBSBuVqzTMZyztDE2gAwt3atAco0=;\n\tb=T8Te9SMwWL6xzZDdStNrvZCxyxb2sw46A/KspgBmNm+Q/tiOWE039D/V4cLQ8EthJn\n\txyAbje5iLGaewlbtjm0e74OzosAZ21di1lPAEodQHKaAHI5OdZ8KT2CBZ+1oCRBsOH/P\n\tcvUfoBSCsRMrfHFV514A5fP9feQT35qMMNqsAqHeEKUaxYfIQTVLzynvYn3HsC/3ol1l\n\t0BOuy5SYqFvElJZoLMjAoCRntwk1yAzJtDiXcARAe8uoQjW8TrJZTKUWAG5WsoffIppm\n\t4dDTUQFASajzSVKQ2Ou7XNZJcqX5Co6lwxp6Phof0Hm8IypAL5md6u+I/qHFRTctp1n4\n\tJ1pg==",
        "X-Gm-Message-State": "AOAM530vWWQ8yGhJ02xjZagbKvSKW4WG3LTe4wVMW+EswovUrTYcmnkw\n\t3xeFKqwoHbVWaTk/UPizQ9Y=",
        "X-Google-Smtp-Source": "ABdhPJz/eyzP7nXkcRU67Nqk5nWkb5g2NtYqBejosKNlZW51Y0l8ElFV4zOVxORJrzW052JZ+wv+rQ==",
        "X-Received": "by 2002:adf:cf11:: with SMTP id\n\to17mr1767621wrj.554.1639438148418; \n\tMon, 13 Dec 2021 15:29:08 -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:48 +0000",
        "Message-Id": "<20211213232849.40071-5-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 4/5] media: entity: Add support for\n\tancillary links",
        "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": "Add functions to create and destroy ancillary links, so that they\ndon't need to be manually created by users.\n\nSigned-off-by: Daniel Scally <djrscally@gmail.com>\n---\nChanges since the rfc:\n\n\t- (Laurent) Set gobj0 and gobj1 directly instead of the other union\n\tmembers\n\t- (Laurent) Added MEDIA_LNK_FL_IMMUTABLE to the kerneldoc for the new\n\tcreate function\n\n drivers/media/mc/mc-entity.c | 30 ++++++++++++++++++++++++++++++\n include/media/media-entity.h | 29 +++++++++++++++++++++++++++++\n 2 files changed, 59 insertions(+)",
    "diff": "diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\nindex aeddc3f6310e..4e39e100ea03 100644\n--- a/drivers/media/mc/mc-entity.c\n+++ b/drivers/media/mc/mc-entity.c\n@@ -1052,3 +1052,33 @@ void media_remove_intf_links(struct media_interface *intf)\n \tmutex_unlock(&mdev->graph_mutex);\n }\n EXPORT_SYMBOL_GPL(media_remove_intf_links);\n+\n+struct media_link *media_create_ancillary_link(struct media_entity *primary,\n+\t\t\t\t\t       struct media_entity *ancillary,\n+\t\t\t\t\t       u32 flags)\n+{\n+\tstruct media_link *link;\n+\n+\tlink = media_add_link(&primary->links);\n+\tif (!link)\n+\t\treturn ERR_PTR(-ENOMEM);\n+\n+\tlink->gobj0 = &primary->graph_obj;\n+\tlink->gobj1 = &ancillary->graph_obj;\n+\tlink->flags = flags | MEDIA_LNK_FL_ANCILLARY_LINK;\n+\n+\t/* Initialize graph object embedded at the new link */\n+\tmedia_gobj_create(primary->graph_obj.mdev, MEDIA_GRAPH_LINK,\n+\t\t\t  &link->graph_obj);\n+\n+\treturn link;\n+}\n+EXPORT_SYMBOL_GPL(media_create_ancillary_link);\n+\n+void media_remove_ancillary_link(struct media_link *link)\n+{\n+\tlist_del(&link->list);\n+\tmedia_gobj_destroy(&link->graph_obj);\n+\tkfree(link);\n+}\n+EXPORT_SYMBOL_GPL(media_remove_ancillary_link);\ndiff --git a/include/media/media-entity.h b/include/media/media-entity.h\nindex fea489f03d57..f7b1738cef88 100644\n--- a/include/media/media-entity.h\n+++ b/include/media/media-entity.h\n@@ -1104,6 +1104,35 @@ void media_remove_intf_links(struct media_interface *intf);\n  * it will issue a call to @operation\\(@entity, @args\\).\n  */\n \n+/**\n+ * media_create_ancillary_link() - creates a link between two entities\n+ *\n+ * @primary:\tpointer to the primary &media_entity\n+ * @ancillary:\tpointer to the ancillary &media_entity\n+ * @flags:\tLink flags, as defined in\n+ *\t\t:ref:`include/uapi/linux/media.h <media_header>`\n+ *\t\t( seek for ``MEDIA_LNK_FL_*``)\n+ *\n+ *\n+ * Valid values for flags:\n+ *\n+ * %MEDIA_LNK_FL_ENABLED\n+ *   Indicates that the two entities are connected pieces of hardware that form\n+ *   a single logical unit.\n+ *\n+ *   A typical example is a camera lens being linked to the sensor that it is\n+ *   supporting.\n+ *\n+ * %MEDIA_LNK_FL_IMMUTABLE\n+ *   Indicates that the link enabled state can't be modified at runtime. If\n+ *   %MEDIA_LNK_FL_IMMUTABLE is set, then %MEDIA_LNK_FL_ENABLED must also be\n+ *   set, since an immutable link is always enabled.\n+ */\n+struct media_link *\n+media_create_ancillary_link(struct media_entity *primary,\n+\t\t\t    struct media_entity *ancillary,\n+\t\t\t    u32 flags);\n+\n #define media_entity_call(entity, operation, args...)\t\t\t\\\n \t(((entity)->ops && (entity)->ops->operation) ?\t\t\t\\\n \t (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)\n",
    "prefixes": [
        "libcamera-devel",
        "4/5"
    ]
}