All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Julien BERAUD <julien.beraud@parrot.com>,
	Boris Todorov <boris.st.todorov@gmail.com>,
	Gary Thomas <gary@mlbassoc.com>,
	Enrico <ebutera@users.berlios.de>,
	Stefan Herbrechtsmeier <sherbrec@cit-ec.uni-bielefeld.de>,
	Javier Martinez Canillas <martinez.javier@gmail.com>,
	Chris Whittenburg <whittenburg@gmail.com>,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: [PATCH 01/11] v4l: subdev: Extend default link validation to cover field order
Date: Mon, 26 May 2014 21:50:02 +0200	[thread overview]
Message-ID: <1401133812-8745-2-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1401133812-8745-1-git-send-email-laurent.pinchart@ideasonboard.com>

The field order must match between the source and sink pads, or the sink
pad field order must be NONE. This allows connecting an interlaced
source to a bridge that has no hardware support for interlaced formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 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 058c1a6..752cca0 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -468,11 +468,20 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
 				      struct v4l2_subdev_format *source_fmt,
 				      struct v4l2_subdev_format *sink_fmt)
 {
+	/* The width, height and code must match. */
 	if (source_fmt->format.width != sink_fmt->format.width
 	    || source_fmt->format.height != sink_fmt->format.height
 	    || source_fmt->format.code != sink_fmt->format.code)
 		return -EINVAL;
 
+	/* The field order must match, or the sink field order must be NONE
+	 * to support interlaced hardware connected to bridges that support
+	 * progressive formats only.
+	 */
+	if (source_fmt->format.field != sink_fmt->format.field &&
+	    sink_fmt->format.field != V4L2_FIELD_NONE)
+		return -EINVAL;
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate_default);
-- 
1.8.5.5


  reply	other threads:[~2014-05-26 19:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 19:50 [PATCH 00/11] OMAP3 ISP BT.656 support Laurent Pinchart
2014-05-26 19:50 ` Laurent Pinchart [this message]
2014-05-26 19:50 ` [PATCH 02/11] omap3isp: Don't ignore subdev streamoff failures Laurent Pinchart
2014-05-26 19:50 ` [PATCH 03/11] omap3isp: Remove boilerplate disclaimer and FSF address Laurent Pinchart
2014-05-26 19:50 ` [PATCH 04/11] omap3isp: Move non-critical code out of the mutex-protected section Laurent Pinchart
2014-05-26 19:50 ` [PATCH 05/11] omap3isp: Default to progressive field order when setting the format Laurent Pinchart
2014-05-26 19:50 ` [PATCH 06/11] omap3isp: video: Validate the video node field order Laurent Pinchart
2014-05-26 19:50 ` [PATCH 07/11] omap3isp: ccdc: Simplify the configuration function Laurent Pinchart
2014-05-26 19:50 ` [PATCH 08/11] omap3isp: ccdc: Simplify the ccdc_isr_buffer() function Laurent Pinchart
2014-05-26 19:50 ` [PATCH 09/11] omap3isp: ccdc: Add basic support for interlaced video Laurent Pinchart
2014-05-26 21:12   ` Sakari Ailus
2014-05-26 19:50 ` [PATCH 10/11] omap3isp: ccdc: Support the interlaced field orders at the CCDC output Laurent Pinchart
2014-05-26 19:50 ` [PATCH 11/11] omap3isp: ccdc: Add support for BT.656 YUV format at the CCDC input Laurent Pinchart
2014-05-26 21:18 ` [PATCH 00/11] OMAP3 ISP BT.656 support Sakari Ailus
2014-05-27  8:38 ` Enrico
2014-06-24 15:19   ` Enrico
2014-06-24 17:19     ` Stefan Herbrechtsmeier
2014-07-01 20:24       ` Laurent Pinchart
2014-07-04 11:21         ` Stefan Herbrechtsmeier
2014-06-26 16:18     ` Enrico
2014-07-01 20:17       ` Laurent Pinchart
2014-07-22 15:52     ` Enrico
2014-07-22 16:04       ` Laurent Pinchart
2014-07-22 16:26         ` Enrico
2014-07-22 16:32           ` Laurent Pinchart
2014-07-23 13:54             ` Enrico
2014-07-23 13:57               ` Enrico
2014-07-30 21:01                 ` Laurent Pinchart
2014-07-31 10:21                   ` Enrico
2014-08-01 13:46                     ` Laurent Pinchart
     [not found]         ` <1406046034.73192.YahooMailNeo@web162404.mail.bf1.yahoo.com>
2014-07-22 16:27           ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401133812-8745-2-git-send-email-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=boris.st.todorov@gmail.com \
    --cc=ebutera@users.berlios.de \
    --cc=gary@mlbassoc.com \
    --cc=julien.beraud@parrot.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martinez.javier@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --cc=sherbrec@cit-ec.uni-bielefeld.de \
    --cc=whittenburg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.