Show a patch.

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

{
    "id": 15847,
    "url": "https://patchwork.libcamera.org/api/patches/15847/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15847/",
    "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": "<20220510115147.19360-8-laurent.pinchart@ideasonboard.com>",
    "date": "2022-05-10T11:51:04",
    "name": "[libcamera-devel,07/50] staging: media: imx: imx7-media-csi: Don't populate vdev lists",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "9fd4886162a9d487a22c069807a4bbd2af39bf2b",
    "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/15847/mbox/",
    "series": [
        {
            "id": 3106,
            "url": "https://patchwork.libcamera.org/api/series/3106/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3106",
            "date": "2022-05-10T11:50:57",
            "name": "staging: media: imx: Prepare destaging of imx7-media-csi",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3106/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15847/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15847/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 750A9C326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 May 2022 11:52:07 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2113D65646;\n\tTue, 10 May 2022 13:52:07 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA1E465657\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 13:52:02 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0850A1224; \n\tTue, 10 May 2022 13:52:01 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652183527;\n\tbh=JweyVKZn5hEu99NUVKs8LT0pqn6mT3HILsiBxsegB5s=;\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:Cc:\n\tFrom;\n\tb=0u2rjM7fE4jdo2ukgQZofUeXk0bzfUZd3gRaNS8bVPTdXmWvPGpo8li32dt/BFJv0\n\t7FSr9B4BOaYWhy2z9XP5ssJZnnZDQuZAd1laP7JFcyGBbVST1nXQbiz7Gm3aYw5JPE\n\tZIpxL+zVQsm4fKLnN/AFTreX86WSLkx1+wfC67lvHGhbCAwsrOgBbCcdEDCMXR/onr\n\tJCFJ3qcvD6tLeZLBfPH8tXtWcP4ju31Ob/gSPA/j9d7L5sNBFJg6goSN+EOZBTiPsH\n\t0DsbezcW4sran7PFay4J6qHuy1ZtEx6QLfMHs+fVo4BIT5RM1hxfiMlFM7+rWFcm7K\n\t9n2oq3QNd2nXg==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652183522;\n\tbh=JweyVKZn5hEu99NUVKs8LT0pqn6mT3HILsiBxsegB5s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DbTIzd0R7s40rfd8uGCAhQBVXTbGiQPNEmuMBGRCm1Y770UXt3/zkcKNbav0fBP5/\n\tc1OOaZfkxopCc8dplIcpPXqqYkhIok7pRouVmabr8B1pq2d28/RMzegUUkjbbTkoQm\n\tpO32/AglRwAjb3lcVE8Wb0rKFR70vtEjJQ5kHzDM="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DbTIzd0R\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 10 May 2022 14:51:04 +0300",
        "Message-Id": "<20220510115147.19360-8-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220510115147.19360-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220510115147.19360-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 07/50] staging: media: imx:\n\timx7-media-csi: Don't populate vdev lists",
        "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>",
        "Cc": "Martin Kepplinger <martin.kepplinger@puri.sm>, kernel@pengutronix.de,\n\tDorota Czaplejewicz <dorota.czaplejewicz@puri.sm>,\n\tAlexander Stein <alexander.stein@ew.tq-group.com>,\n\tRui Miguel Silva <rmfrfs@gmail.com>,\n\tPhilipp Zabel <p.zabel@pengutronix.de>, \n\tSteve Longerbeam <slongerbeam@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The imx_media_dev framework maintains a per-pad list of connected video\ndevices, created once all subdevs have been bound. This is used for two\npurposes, updating V4L2 control inheritance when links change, and\nrelaying subdev events to video nodes. None of these are used by the\nimx7-media-csi driver as it implements the MC-centric approach. Drop\nthem.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n drivers/staging/media/imx/imx7-media-csi.c | 167 +++------------------\n 1 file changed, 17 insertions(+), 150 deletions(-)",
    "diff": "diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c\nindex 042dd4c0cb4d..e0b600580c21 100644\n--- a/drivers/staging/media/imx/imx7-media-csi.c\n+++ b/drivers/staging/media/imx/imx7-media-csi.c\n@@ -717,151 +717,6 @@ static irqreturn_t imx7_csi_irq_handler(int irq, void *data)\n \treturn IRQ_HANDLED;\n }\n \n-/* -----------------------------------------------------------------------------\n- * Temporary copy of imx_media_dev helpers\n- */\n-\n-/*\n- * adds given video device to given imx-media source pad vdev list.\n- * Continues upstream from the pad entity's sink pads.\n- */\n-static int imx_media_add_vdev_to_pad(struct imx_media_dev *imxmd,\n-\t\t\t\t     struct imx_media_video_dev *vdev,\n-\t\t\t\t     struct media_pad *srcpad)\n-{\n-\tstruct media_entity *entity = srcpad->entity;\n-\tstruct imx_media_pad_vdev *pad_vdev;\n-\tstruct list_head *pad_vdev_list;\n-\tstruct media_link *link;\n-\tstruct v4l2_subdev *sd;\n-\tint i, ret;\n-\n-\t/* skip this entity if not a v4l2_subdev */\n-\tif (!is_media_entity_v4l2_subdev(entity))\n-\t\treturn 0;\n-\n-\tsd = media_entity_to_v4l2_subdev(entity);\n-\n-\tpad_vdev_list = to_pad_vdev_list(sd, srcpad->index);\n-\tif (!pad_vdev_list) {\n-\t\tv4l2_warn(&imxmd->v4l2_dev, \"%s:%u has no vdev list!\\n\",\n-\t\t\t  entity->name, srcpad->index);\n-\t\t/*\n-\t\t * shouldn't happen, but no reason to fail driver load,\n-\t\t * just skip this entity.\n-\t\t */\n-\t\treturn 0;\n-\t}\n-\n-\t/* just return if we've been here before */\n-\tlist_for_each_entry(pad_vdev, pad_vdev_list, list) {\n-\t\tif (pad_vdev->vdev == vdev)\n-\t\t\treturn 0;\n-\t}\n-\n-\tdev_dbg(imxmd->md.dev, \"adding %s to pad %s:%u\\n\",\n-\t\tvdev->vfd->entity.name, entity->name, srcpad->index);\n-\n-\tpad_vdev = devm_kzalloc(imxmd->md.dev, sizeof(*pad_vdev), GFP_KERNEL);\n-\tif (!pad_vdev)\n-\t\treturn -ENOMEM;\n-\n-\t/* attach this vdev to this pad */\n-\tpad_vdev->vdev = vdev;\n-\tlist_add_tail(&pad_vdev->list, pad_vdev_list);\n-\n-\t/* move upstream from this entity's sink pads */\n-\tfor (i = 0; i < entity->num_pads; i++) {\n-\t\tstruct media_pad *pad = &entity->pads[i];\n-\n-\t\tif (!(pad->flags & MEDIA_PAD_FL_SINK))\n-\t\t\tcontinue;\n-\n-\t\tlist_for_each_entry(link, &entity->links, list) {\n-\t\t\tif (link->sink != pad)\n-\t\t\t\tcontinue;\n-\t\t\tret = imx_media_add_vdev_to_pad(imxmd, vdev,\n-\t\t\t\t\t\t\tlink->source);\n-\t\t\tif (ret)\n-\t\t\t\treturn ret;\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/*\n- * For every subdevice, allocate an array of list_head's, one list_head\n- * for each pad, to hold the list of video devices reachable from that\n- * pad.\n- */\n-static int imx_media_alloc_pad_vdev_lists(struct imx_media_dev *imxmd)\n-{\n-\tstruct list_head *vdev_lists;\n-\tstruct media_entity *entity;\n-\tstruct v4l2_subdev *sd;\n-\tint i;\n-\n-\tlist_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) {\n-\t\tentity = &sd->entity;\n-\t\tvdev_lists = devm_kcalloc(imxmd->md.dev,\n-\t\t\t\t\t  entity->num_pads, sizeof(*vdev_lists),\n-\t\t\t\t\t  GFP_KERNEL);\n-\t\tif (!vdev_lists)\n-\t\t\treturn -ENOMEM;\n-\n-\t\t/* attach to the subdev's host private pointer */\n-\t\tsd->host_priv = vdev_lists;\n-\n-\t\tfor (i = 0; i < entity->num_pads; i++)\n-\t\t\tINIT_LIST_HEAD(to_pad_vdev_list(sd, i));\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/* form the vdev lists in all imx-media source pads */\n-static int imx_media_create_pad_vdev_lists(struct imx_media_dev *imxmd)\n-{\n-\tstruct imx_media_video_dev *vdev;\n-\tstruct media_link *link;\n-\tint ret;\n-\n-\tret = imx_media_alloc_pad_vdev_lists(imxmd);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tlist_for_each_entry(vdev, &imxmd->vdev_list, list) {\n-\t\tlink = list_first_entry(&vdev->vfd->entity.links,\n-\t\t\t\t\tstruct media_link, list);\n-\t\tret = imx_media_add_vdev_to_pad(imxmd, vdev, link->source);\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/* async subdev complete notifier */\n-static int __imx_media_probe_complete(struct imx_media_dev *imxmd)\n-{\n-\tint ret;\n-\n-\tmutex_lock(&imxmd->mutex);\n-\n-\tret = imx_media_create_pad_vdev_lists(imxmd);\n-\tif (ret)\n-\t\tgoto unlock;\n-\n-\tret = v4l2_device_register_subdev_nodes(&imxmd->v4l2_dev);\n-unlock:\n-\tmutex_unlock(&imxmd->mutex);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\treturn media_device_register(&imxmd->md);\n-}\n-\n /* -----------------------------------------------------------------------------\n  * V4L2 Subdev Operations\n  */\n@@ -1214,12 +1069,24 @@ static int imx7_csi_registered(struct v4l2_subdev *sd)\n \n \tret = imx_media_capture_device_register(csi->vdev,\n \t\t\t\t\t\tMEDIA_LNK_FL_IMMUTABLE);\n-\tif (ret) {\n-\t\timx_media_capture_device_remove(csi->vdev);\n-\t\treturn ret;\n-\t}\n+\tif (ret)\n+\t\tgoto err_remove;\n \n-\treturn __imx_media_probe_complete(csi->imxmd);\n+\tret = v4l2_device_register_subdev_nodes(&csi->imxmd->v4l2_dev);\n+\tif (ret)\n+\t\tgoto err_unreg;\n+\n+\tret = media_device_register(&csi->imxmd->md);\n+\tif (ret)\n+\t\tgoto err_unreg;\n+\n+\treturn 0;\n+\n+err_unreg:\n+\timx_media_capture_device_unregister(csi->vdev);\n+err_remove:\n+\timx_media_capture_device_remove(csi->vdev);\n+\treturn ret;\n }\n \n static void imx7_csi_unregistered(struct v4l2_subdev *sd)\n",
    "prefixes": [
        "libcamera-devel",
        "07/50"
    ]
}