summaryrefslogtreecommitdiff
path: root/drivers/media/platform/renesas
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2024-06-18 21:46:44 +0300
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2024-08-26 16:36:14 +0300
commita3d44f011c6b7a87c9ad0d5be2f5fa092fa419bf (patch)
tree52e402204349f74d30726ce03fb9ea40971152bb /drivers/media/platform/renesas
parent5fd3e2412ade67ea20d855f0aea821c650d27559 (diff)
downloadlwn-a3d44f011c6b7a87c9ad0d5be2f5fa092fa419bf.tar.gz
lwn-a3d44f011c6b7a87c9ad0d5be2f5fa092fa419bf.zip
media: renesas: vsp1: Implement .link_validate() for video devices
The v4l2_subdev_link_validate() helper prints a warning if the .link_validate() operation is not implemented for video devices connected to the subdevs. Implement the operation to silence the warning. Ideally validation of the link between the video device and the subdev should be implemented in that operation. That would however break userspace that does not configure formats on all video devices before starting streaming. While this mode of operation may not be considered valid by the V4L2 API specification (interpretation differ), it is nonetheless supported by the vsp1 driver at the moment and used by at least the vsp1 unit test suite, and possibly other userspace applications. Removing it would be a regression. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers/media/platform/renesas')
-rw-r--r--drivers/media/platform/renesas/vsp1/vsp1_video.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_video.c b/drivers/media/platform/renesas/vsp1/vsp1_video.c
index fdb46ec0c872..e728f9f5160e 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_video.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_video.c
@@ -1082,6 +1082,27 @@ static const struct v4l2_file_operations vsp1_video_fops = {
};
/* -----------------------------------------------------------------------------
+ * Media entity operations
+ */
+
+static int vsp1_video_link_validate(struct media_link *link)
+{
+ /*
+ * Ideally, link validation should be implemented here instead of
+ * calling vsp1_video_verify_format() in vsp1_video_streamon()
+ * manually. That would however break userspace that start one video
+ * device before configures formats on other video devices in the
+ * pipeline. This operation is just a no-op to silence the warnings
+ * from v4l2_subdev_link_validate().
+ */
+ return 0;
+}
+
+static const struct media_entity_operations vsp1_video_media_ops = {
+ .link_validate = vsp1_video_link_validate,
+};
+
+/* -----------------------------------------------------------------------------
* Suspend and Resume
*/
@@ -1215,6 +1236,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
/* ... and the video node... */
video->video.v4l2_dev = &video->vsp1->v4l2_dev;
+ video->video.entity.ops = &vsp1_video_media_ops;
video->video.fops = &vsp1_video_fops;
snprintf(video->video.name, sizeof(video->video.name), "%s %s",
rwpf->entity.subdev.name, direction);