public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] v4l2-subdev: return -EPIPE instead of -EINVAL in link validate default
@ 2015-06-29  0:45 Helen Fornazier
  2015-06-29  7:23 ` Sakari Ailus
  0 siblings, 1 reply; 14+ messages in thread
From: Helen Fornazier @ 2015-06-29  0:45 UTC (permalink / raw)
  To: linux-media, mchehab, laurent.pinchart, hans.verkuil, s.nawrocki,
	sakari.ailus
  Cc: Helen Fornazier

According to the V4L2 API, the VIDIOC_STREAMON ioctl should return EPIPE
when the pipeline configuration is invalid.

As the .vidioc_streamon in the v4l2_ioctl_ops usually forwards the error
caused by the v4l2_subdev_link_validate_default (if it is in use), it
should return -EPIPE if it detects a format mismatch in the pipeline
configuration

Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 6359606..5e64342 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -508,7 +508,7 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
 	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;
+		return -EPIPE;
 
 	/* The field order must match, or the sink field order must be NONE
 	 * to support interlaced hardware connected to bridges that support
@@ -516,7 +516,7 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
 	 */
 	if (source_fmt->format.field != sink_fmt->format.field &&
 	    sink_fmt->format.field != V4L2_FIELD_NONE)
-		return -EINVAL;
+		return -EPIPE;
 
 	return 0;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-08-13 14:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29  0:45 [PATCH] [media] v4l2-subdev: return -EPIPE instead of -EINVAL in link validate default Helen Fornazier
2015-06-29  7:23 ` Sakari Ailus
2015-06-29  8:10   ` Laurent Pinchart
2015-06-30  9:19     ` Sakari Ailus
2015-06-30 19:26       ` Helen Fornazier
2015-07-12 17:11         ` Helen Fornazier
     [not found]         ` <CAPW4XYYETmTK8MfZd941B0rb1DWODH=ZqAJu=FdmkVFrO_=dXQ@mail.gmail.com>
2015-07-13  8:03           ` Sakari Ailus
2015-07-13  9:16             ` Laurent Pinchart
2015-07-14 14:19             ` Hans Verkuil
2015-07-14 14:32               ` Laurent Pinchart
2015-08-07 16:55                 ` Helen Fornazier
2015-08-10 14:07                 ` Hans Verkuil
2015-08-13 12:23                   ` Sakari Ailus
2015-08-13 14:09                     ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox