Patch Detail
Show a patch.
GET /api/1.1/patches/20995/?format=api
{ "id": 20995, "url": "https://patchwork.libcamera.org/api/1.1/patches/20995/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20995/", "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": "<20240822153527.25320-7-laurent.pinchart+renesas@ideasonboard.com>", "date": "2024-08-22T15:35:26", "name": "[v2,6/7] media: renesas: vsp1: Implement .link_validate() for video devices", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "985607110f235f1d6a6bdeb7c35a0a2021468301", "submitter": { "id": 204, "url": "https://patchwork.libcamera.org/api/1.1/people/204/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart+renesas@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20995/mbox/", "series": [ { "id": 4533, "url": "https://patchwork.libcamera.org/api/1.1/series/4533/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4533", "date": "2024-08-22T15:35:20", "name": "media: v4l2: Improve media link validation", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4533/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20995/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20995/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 AC093C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Aug 2024 15:35:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 225F7633E4;\n\tThu, 22 Aug 2024 17:35:48 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 36C56633D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Aug 2024 17:35:39 +0200 (CEST)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9AAA6124E;\n\tThu, 22 Aug 2024 17:34:35 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"C5Y6LwFU\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724340875;\n\tbh=p/Vm87vlP9XYuQzQ5C0tpdtZ2+oVHTKxRgJwzH0dUr8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=C5Y6LwFU1u1StjdmNVaZltQmP14CgULLXc74z7wuLGgn/aV4yp5+cLLQSO3uImXuJ\n\tgu47UuKs40s/z7OuHVsjJCzFAKTls1Fyr4/XS4keOIMqUNMsOGZ0P1wMyUM1D7aWDc\n\tB29+Gm/+b+ZBGkHnv/eKLi4Avu/OUKBgVAWjE9rw=", "From": "Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Chen-Yu Tsai <wens@csie.org>, Eugen Hristev <eugen.hristev@collabora.com>,\n\tHans Verkuil <hverkuil-cisco@xs4all.nl>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tMaxime Ripard <mripard@kernel.org>, Sakari Ailus <sakari.ailus@iki.fi>,\n\tTomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlinux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev", "Subject": "[PATCH v2 6/7] media: renesas: vsp1: Implement .link_validate() for\n\tvideo devices", "Date": "Thu, 22 Aug 2024 18:35:26 +0300", "Message-ID": "<20240822153527.25320-7-laurent.pinchart+renesas@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.2", "In-Reply-To": "<20240822153527.25320-1-laurent.pinchart+renesas@ideasonboard.com>", "References": "<20240822153527.25320-1-laurent.pinchart+renesas@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The v4l2_subdev_link_validate() helper prints a warning if the\n.link_validate() operation is not implemented for video devices\nconnected to the subdevs. Implement the operation to silence the\nwarning.\n\nIdeally validation of the link between the video device and the subdev\nshould be implemented in that operation. That would however break\nuserspace that does not configure formats on all video devices before\nstarting streaming. While this mode of operation may not be considered\nvalid by the V4L2 API specification (interpretation differ), it is\nnonetheless supported by the vsp1 driver at the moment and used by at\nleast the vsp1 unit test suite, and possibly other userspace\napplciations. Removing it would be a regression.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>\n---\n .../media/platform/renesas/vsp1/vsp1_video.c | 22 +++++++++++++++++++\n 1 file changed, 22 insertions(+)", "diff": "diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c\nindex fdb46ec0c872..e728f9f5160e 100644\n--- a/drivers/media/platform/renesas/vsp1/vsp1_video.c\n+++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c\n@@ -1081,6 +1081,27 @@ static const struct v4l2_file_operations vsp1_video_fops = {\n \t.mmap = vb2_fop_mmap,\n };\n \n+/* -----------------------------------------------------------------------------\n+ * Media entity operations\n+ */\n+\n+static int vsp1_video_link_validate(struct media_link *link)\n+{\n+\t/*\n+\t * Ideally, link validation should be implemented here instead of\n+\t * calling vsp1_video_verify_format() in vsp1_video_streamon()\n+\t * manually. That would however break userspace that start one video\n+\t * device before configures formats on other video devices in the\n+\t * pipeline. This operation is just a no-op to silence the warnings\n+\t * from v4l2_subdev_link_validate().\n+\t */\n+\treturn 0;\n+}\n+\n+static const struct media_entity_operations vsp1_video_media_ops = {\n+\t.link_validate = vsp1_video_link_validate,\n+};\n+\n /* -----------------------------------------------------------------------------\n * Suspend and Resume\n */\n@@ -1215,6 +1236,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,\n \n \t/* ... and the video node... */\n \tvideo->video.v4l2_dev = &video->vsp1->v4l2_dev;\n+\tvideo->video.entity.ops = &vsp1_video_media_ops;\n \tvideo->video.fops = &vsp1_video_fops;\n \tsnprintf(video->video.name, sizeof(video->video.name), \"%s %s\",\n \t\t rwpf->entity.subdev.name, direction);\n", "prefixes": [ "v2", "6/7" ] }