[PATCH 04/20] v4l2-core: check that both pads in a link are muxed if one are

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since multiplexed pads carry multiple streams it's not possible to
verify the format for a specific stream at this time. Instead make sure
both pads are marked as multiplexed and skip the format checking.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 43fefa73e0a3f64f..d6c1a3b777dd2fcd 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -547,6 +547,15 @@ int v4l2_subdev_link_validate(struct media_link *link)
 	struct v4l2_subdev_format sink_fmt, source_fmt;
 	int rval;
 
+	/* Require both pads in a link to be multiplexed if one is */
+	if ((link->source->flags | link->sink->flags) & MEDIA_PAD_FL_MUXED) {
+		if ((link->source->flags & MEDIA_PAD_FL_MUXED) == 0)
+			return -EINVAL;
+		if ((link->sink->flags & MEDIA_PAD_FL_MUXED) == 0)
+			return -EINVAL;
+		return 0;
+	}
+
 	rval = v4l2_subdev_link_validate_get_format(
 		link->source, &source_fmt);
 	if (rval < 0)
-- 
2.13.3




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux