All of lore.kernel.org
 help / color / mirror / Atom feed
* [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes
@ 2014-03-07 10:21 Hans Verkuil
  2014-03-07 10:21 ` [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Hans Verkuil
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart

Currently the VIDIOC_SUBDEV_G/S_EDID and struct v4l2_subdev_edid are subdev
APIs. However, that's in reality quite annoying since for simple video
pipelines there is no need to create v4l-subdev device nodes for anything
else except for setting or getting EDIDs.

What happens in practice is that v4l2 bridge drivers add explicit support
for VIDIOC_SUBDEV_G/S_EDID themselves, just to avoid having to create
subdev device nodes just for this.

So this patch series makes the ioctls available as regular ioctls as
well. In that case the pad field is interpreted as the input or output
index as returned by ENUMINPUT/OUTPUT.

Changes since RFCv1:

- Split off the compat32 fix (I'll queue this for 3.14)
- Interpret pad as an input or output index when used with a video node.
- S_EDID is now enabled for rx devices instead of tx.
- Fix a one tab too many.

Regards,

        Hans


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

* [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support.
  2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
@ 2014-03-07 10:21 ` Hans Verkuil
  2014-03-07 14:04   ` Laurent Pinchart
  2014-03-07 10:21 ` [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes Hans Verkuil
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart, Hans Verkuil, stable

From: Hans Verkuil <hans.verkuil@cisco.com>

The wrong ioctl numbers were used due to a copy-and-paste error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org      # for v3.7 and up
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 1b18616..7e23e19 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -787,8 +787,8 @@ static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde
 #define VIDIOC_DQBUF32		_IOWR('V', 17, struct v4l2_buffer32)
 #define VIDIOC_ENUMSTD32	_IOWR('V', 25, struct v4l2_standard32)
 #define VIDIOC_ENUMINPUT32	_IOWR('V', 26, struct v4l2_input32)
-#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 63, struct v4l2_subdev_edid32)
-#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 64, struct v4l2_subdev_edid32)
+#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 40, struct v4l2_subdev_edid32)
+#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 41, struct v4l2_subdev_edid32)
 #define VIDIOC_TRY_FMT32      	_IOWR('V', 64, struct v4l2_format32)
 #define VIDIOC_G_EXT_CTRLS32    _IOWR('V', 71, struct v4l2_ext_controls32)
 #define VIDIOC_S_EXT_CTRLS32    _IOWR('V', 72, struct v4l2_ext_controls32)
-- 
1.9.0


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

* [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes
  2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
  2014-03-07 10:21 ` [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Hans Verkuil
@ 2014-03-07 10:21 ` Hans Verkuil
  2014-03-07 14:04   ` Laurent Pinchart
  2014-03-07 10:21 ` [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core Hans Verkuil
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Struct v4l2_subdev_edid and the VIDIOC_SUBDEV_G/S_EDID ioctls were
specific for subdevices, but for hardware with a simple video pipeline
you do not need/want to create subdevice nodes to just get/set the EDID.

Move the v4l2_subdev_edid struct to v4l2-common.h and rename as
v4l2_edid. Add the same ioctls to videodev2.h as well, thus allowing
this API to be used with both video nodes and v4l-subdev nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 include/uapi/linux/v4l2-common.h |  8 ++++++++
 include/uapi/linux/v4l2-subdev.h | 14 +++++---------
 include/uapi/linux/videodev2.h   |  2 ++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
index 4f0667e..270db89 100644
--- a/include/uapi/linux/v4l2-common.h
+++ b/include/uapi/linux/v4l2-common.h
@@ -68,4 +68,12 @@
 #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE	V4L2_SEL_FLAG_LE
 #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
 
+struct v4l2_edid {
+	__u32 pad;
+	__u32 start_block;
+	__u32 blocks;
+	__u32 reserved[5];
+	__u8 __user *edid;
+};
+
 #endif /* __V4L2_COMMON__ */
diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h
index a33c4da..87e0515 100644
--- a/include/uapi/linux/v4l2-subdev.h
+++ b/include/uapi/linux/v4l2-subdev.h
@@ -148,13 +148,8 @@ struct v4l2_subdev_selection {
 	__u32 reserved[8];
 };
 
-struct v4l2_subdev_edid {
-	__u32 pad;
-	__u32 start_block;
-	__u32 blocks;
-	__u32 reserved[5];
-	__u8 __user *edid;
-};
+/* Backwards compatibility define --- to be removed */
+#define v4l2_subdev_edid v4l2_edid
 
 #define VIDIOC_SUBDEV_G_FMT	_IOWR('V',  4, struct v4l2_subdev_format)
 #define VIDIOC_SUBDEV_S_FMT	_IOWR('V',  5, struct v4l2_subdev_format)
@@ -174,7 +169,8 @@ struct v4l2_subdev_edid {
 	_IOWR('V', 61, struct v4l2_subdev_selection)
 #define VIDIOC_SUBDEV_S_SELECTION \
 	_IOWR('V', 62, struct v4l2_subdev_selection)
-#define VIDIOC_SUBDEV_G_EDID	_IOWR('V', 40, struct v4l2_subdev_edid)
-#define VIDIOC_SUBDEV_S_EDID	_IOWR('V', 41, struct v4l2_subdev_edid)
+/* These two G/S_EDID ioctls are identical to the ioctls in videodev2.h */
+#define VIDIOC_SUBDEV_G_EDID	_IOWR('V', 40, struct v4l2_edid)
+#define VIDIOC_SUBDEV_S_EDID	_IOWR('V', 41, struct v4l2_edid)
 
 #endif
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 17acba8..339738a 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1913,6 +1913,8 @@ struct v4l2_create_buffers {
 #define VIDIOC_QUERYMENU	_IOWR('V', 37, struct v4l2_querymenu)
 #define VIDIOC_G_INPUT		 _IOR('V', 38, int)
 #define VIDIOC_S_INPUT		_IOWR('V', 39, int)
+#define VIDIOC_G_EDID		_IOWR('V', 40, struct v4l2_edid)
+#define VIDIOC_S_EDID		_IOWR('V', 41, struct v4l2_edid)
 #define VIDIOC_G_OUTPUT		 _IOR('V', 46, int)
 #define VIDIOC_S_OUTPUT		_IOWR('V', 47, int)
 #define VIDIOC_ENUMOUTPUT	_IOWR('V', 48, struct v4l2_output)
-- 
1.9.0


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

* [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core.
  2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
  2014-03-07 10:21 ` [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Hans Verkuil
  2014-03-07 10:21 ` [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes Hans Verkuil
@ 2014-03-07 10:21 ` Hans Verkuil
  2014-03-07 14:07   ` Laurent Pinchart
  2014-03-07 10:21 ` [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid Hans Verkuil
  2014-03-07 10:21 ` [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation Hans Verkuil
  4 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Support this ioctl as part of the v4l2 core. Use the new ioctl
name and struct v4l2_edid type in the existing core code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 32 +++++++++++++--------------
 drivers/media/v4l2-core/v4l2-dev.c            |  2 ++
 drivers/media/v4l2-core/v4l2-ioctl.c          | 16 +++++++++++---
 drivers/media/v4l2-core/v4l2-subdev.c         |  4 ++--
 include/media/v4l2-ioctl.h                    |  2 ++
 include/media/v4l2-subdev.h                   |  4 ++--
 6 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 7e23e19..872f1ca 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -740,7 +740,7 @@ static int put_v4l2_event32(struct v4l2_event *kp, struct v4l2_event32 __user *u
 	return 0;
 }
 
-struct v4l2_subdev_edid32 {
+struct v4l2_edid32 {
 	__u32 pad;
 	__u32 start_block;
 	__u32 blocks;
@@ -748,11 +748,11 @@ struct v4l2_subdev_edid32 {
 	compat_caddr_t edid;
 };
 
-static int get_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subdev_edid32 __user *up)
+static int get_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
 {
 	u32 tmp;
 
-	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_subdev_edid32)) ||
+	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_edid32)) ||
 		get_user(kp->pad, &up->pad) ||
 		get_user(kp->start_block, &up->start_block) ||
 		get_user(kp->blocks, &up->blocks) ||
@@ -763,11 +763,11 @@ static int get_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde
 	return 0;
 }
 
-static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subdev_edid32 __user *up)
+static int put_v4l2_edid32(struct v4l2_edid *kp, struct v4l2_edid32 __user *up)
 {
 	u32 tmp = (u32)((unsigned long)kp->edid);
 
-	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_subdev_edid32)) ||
+	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_edid32)) ||
 		put_user(kp->pad, &up->pad) ||
 		put_user(kp->start_block, &up->start_block) ||
 		put_user(kp->blocks, &up->blocks) ||
@@ -787,8 +787,8 @@ static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct v4l2_subde
 #define VIDIOC_DQBUF32		_IOWR('V', 17, struct v4l2_buffer32)
 #define VIDIOC_ENUMSTD32	_IOWR('V', 25, struct v4l2_standard32)
 #define VIDIOC_ENUMINPUT32	_IOWR('V', 26, struct v4l2_input32)
-#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 40, struct v4l2_subdev_edid32)
-#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 41, struct v4l2_subdev_edid32)
+#define VIDIOC_G_EDID32		_IOWR('V', 40, struct v4l2_edid32)
+#define VIDIOC_S_EDID32		_IOWR('V', 41, struct v4l2_edid32)
 #define VIDIOC_TRY_FMT32      	_IOWR('V', 64, struct v4l2_format32)
 #define VIDIOC_G_EXT_CTRLS32    _IOWR('V', 71, struct v4l2_ext_controls32)
 #define VIDIOC_S_EXT_CTRLS32    _IOWR('V', 72, struct v4l2_ext_controls32)
@@ -816,7 +816,7 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 		struct v4l2_ext_controls v2ecs;
 		struct v4l2_event v2ev;
 		struct v4l2_create_buffers v2crt;
-		struct v4l2_subdev_edid v2edid;
+		struct v4l2_edid v2edid;
 		unsigned long vx;
 		int vi;
 	} karg;
@@ -849,8 +849,8 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 	case VIDIOC_S_OUTPUT32: cmd = VIDIOC_S_OUTPUT; break;
 	case VIDIOC_CREATE_BUFS32: cmd = VIDIOC_CREATE_BUFS; break;
 	case VIDIOC_PREPARE_BUF32: cmd = VIDIOC_PREPARE_BUF; break;
-	case VIDIOC_SUBDEV_G_EDID32: cmd = VIDIOC_SUBDEV_G_EDID; break;
-	case VIDIOC_SUBDEV_S_EDID32: cmd = VIDIOC_SUBDEV_S_EDID; break;
+	case VIDIOC_G_EDID32: cmd = VIDIOC_G_EDID; break;
+	case VIDIOC_S_EDID32: cmd = VIDIOC_S_EDID; break;
 	}
 
 	switch (cmd) {
@@ -868,9 +868,9 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 		compatible_arg = 0;
 		break;
 
-	case VIDIOC_SUBDEV_G_EDID:
-	case VIDIOC_SUBDEV_S_EDID:
-		err = get_v4l2_subdev_edid32(&karg.v2edid, up);
+	case VIDIOC_G_EDID:
+	case VIDIOC_S_EDID:
+		err = get_v4l2_edid32(&karg.v2edid, up);
 		compatible_arg = 0;
 		break;
 
@@ -966,9 +966,9 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 		err = put_v4l2_event32(&karg.v2ev, up);
 		break;
 
-	case VIDIOC_SUBDEV_G_EDID:
-	case VIDIOC_SUBDEV_S_EDID:
-		err = put_v4l2_subdev_edid32(&karg.v2edid, up);
+	case VIDIOC_G_EDID:
+	case VIDIOC_S_EDID:
+		err = put_v4l2_edid32(&karg.v2edid, up);
 		break;
 
 	case VIDIOC_G_FMT:
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 95112f6..634d863 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -701,6 +701,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
 			SET_VALID_IOCTL(ops, VIDIOC_G_AUDIO, vidioc_g_audio);
 			SET_VALID_IOCTL(ops, VIDIOC_S_AUDIO, vidioc_s_audio);
 			SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings);
+			SET_VALID_IOCTL(ops, VIDIOC_S_EDID, vidioc_s_edid);
 		}
 		if (is_tx) {
 			SET_VALID_IOCTL(ops, VIDIOC_ENUMOUTPUT, vidioc_enum_output);
@@ -726,6 +727,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
 		SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings);
 		SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
 		SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap);
+		SET_VALID_IOCTL(ops, VIDIOC_G_EDID, vidioc_g_edid);
 	}
 	if (is_tx && (is_radio || is_sdr)) {
 		/* radio transmitter only ioctls */
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 95dd4f1..6536e15 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -844,6 +844,14 @@ static void v4l_print_freq_band(const void *arg, bool write_only)
 			p->rangehigh, p->modulation);
 }
 
+static void v4l_print_edid(const void *arg, bool write_only)
+{
+	const struct v4l2_edid *p = arg;
+
+	pr_cont("pad=%u, start_block=%u, blocks=%u\n",
+		p->pad, p->start_block, p->blocks);
+}
+
 static void v4l_print_u32(const void *arg, bool write_only)
 {
 	pr_cont("value=%u\n", *(const u32 *)arg);
@@ -2062,6 +2070,8 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
 	IOCTL_INFO_FNC(VIDIOC_QUERYMENU, v4l_querymenu, v4l_print_querymenu, INFO_FL_CTRL | INFO_FL_CLEAR(v4l2_querymenu, index)),
 	IOCTL_INFO_STD(VIDIOC_G_INPUT, vidioc_g_input, v4l_print_u32, 0),
 	IOCTL_INFO_FNC(VIDIOC_S_INPUT, v4l_s_input, v4l_print_u32, INFO_FL_PRIO),
+	IOCTL_INFO_STD(VIDIOC_G_EDID, vidioc_g_edid, v4l_print_edid, INFO_FL_CLEAR(v4l2_edid, edid)),
+	IOCTL_INFO_STD(VIDIOC_S_EDID, vidioc_s_edid, v4l_print_edid, INFO_FL_PRIO | INFO_FL_CLEAR(v4l2_edid, edid)),
 	IOCTL_INFO_STD(VIDIOC_G_OUTPUT, vidioc_g_output, v4l_print_u32, 0),
 	IOCTL_INFO_FNC(VIDIOC_S_OUTPUT, v4l_s_output, v4l_print_u32, INFO_FL_PRIO),
 	IOCTL_INFO_FNC(VIDIOC_ENUMOUTPUT, v4l_enumoutput, v4l_print_enumoutput, INFO_FL_CLEAR(v4l2_output, index)),
@@ -2274,9 +2284,9 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
 		break;
 	}
 
-	case VIDIOC_SUBDEV_G_EDID:
-	case VIDIOC_SUBDEV_S_EDID: {
-		struct v4l2_subdev_edid *edid = parg;
+	case VIDIOC_G_EDID:
+	case VIDIOC_S_EDID: {
+		struct v4l2_edid *edid = parg;
 
 		if (edid->blocks) {
 			if (edid->blocks > 256) {
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 60d2550..aea84ac 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -349,10 +349,10 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 			sd, pad, set_selection, subdev_fh, sel);
 	}
 
-	case VIDIOC_SUBDEV_G_EDID:
+	case VIDIOC_G_EDID:
 		return v4l2_subdev_call(sd, pad, get_edid, arg);
 
-	case VIDIOC_SUBDEV_S_EDID:
+	case VIDIOC_S_EDID:
 		return v4l2_subdev_call(sd, pad, set_edid, arg);
 #endif
 	default:
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 8be32f5..50cf7c1 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -273,6 +273,8 @@ struct v4l2_ioctl_ops {
 				    struct v4l2_enum_dv_timings *timings);
 	int (*vidioc_dv_timings_cap) (struct file *file, void *fh,
 				    struct v4l2_dv_timings_cap *cap);
+	int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
+	int (*vidioc_s_edid) (struct file *file, void *fh, struct v4l2_edid *edid);
 
 	int (*vidioc_subscribe_event)  (struct v4l2_fh *fh,
 					const struct v4l2_event_subscription *sub);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 1752530..855c928 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -507,8 +507,8 @@ struct v4l2_subdev_pad_ops {
 			     struct v4l2_subdev_selection *sel);
 	int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
 			     struct v4l2_subdev_selection *sel);
-	int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid);
-	int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid);
+	int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
+	int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
 #ifdef CONFIG_MEDIA_CONTROLLER
 	int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link,
 			     struct v4l2_subdev_format *source_fmt,
-- 
1.9.0


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

* [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid.
  2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
                   ` (2 preceding siblings ...)
  2014-03-07 10:21 ` [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core Hans Verkuil
@ 2014-03-07 10:21 ` Hans Verkuil
  2014-03-07 14:07   ` Laurent Pinchart
  2014-03-07 10:21 ` [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation Hans Verkuil
  4 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/i2c/ad9389b.c | 2 +-
 drivers/media/i2c/adv7511.c | 2 +-
 drivers/media/i2c/adv7604.c | 4 ++--
 drivers/media/i2c/adv7842.c | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 83225d6..1b7ecfd 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -573,7 +573,7 @@ static const struct v4l2_subdev_core_ops ad9389b_core_ops = {
 
 /* ------------------------------ PAD OPS ------------------------------ */
 
-static int ad9389b_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
+static int ad9389b_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 {
 	struct ad9389b_state *state = get_ad9389b_state(sd);
 
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index ee61894..942ca4b 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -597,7 +597,7 @@ static int adv7511_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
 	return 0;
 }
 
-static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
+static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 {
 	struct adv7511_state *state = get_adv7511_state(sd);
 
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 71c8570..98cc540 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -1658,7 +1658,7 @@ static int adv7604_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
 	return 0;
 }
 
-static int adv7604_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
+static int adv7604_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 {
 	struct adv7604_state *state = to_state(sd);
 	u8 *data = NULL;
@@ -1728,7 +1728,7 @@ static int get_edid_spa_location(const u8 *edid)
 	return -1;
 }
 
-static int adv7604_set_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
+static int adv7604_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 {
 	struct adv7604_state *state = to_state(sd);
 	int spa_loc;
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index e04fe3f..4d1e07e 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -2014,7 +2014,7 @@ static int adv7842_isr(struct v4l2_subdev *sd, u32 status, bool *handled)
 	return 0;
 }
 
-static int adv7842_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
+static int adv7842_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 {
 	struct adv7842_state *state = to_state(sd);
 	u8 *data = NULL;
@@ -2054,7 +2054,7 @@ static int adv7842_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edi
 	return 0;
 }
 
-static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *e)
+static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *e)
 {
 	struct adv7842_state *state = to_state(sd);
 	int err = 0;
-- 
1.9.0


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

* [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation
  2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
                   ` (3 preceding siblings ...)
  2014-03-07 10:21 ` [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid Hans Verkuil
@ 2014-03-07 10:21 ` Hans Verkuil
  2014-03-07 14:09   ` Laurent Pinchart
  4 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 10:21 UTC (permalink / raw)
  To: linux-media; +Cc: marbugge, laurent.pinchart, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Document that it is now possible to call G/S_EDID from video nodes, not
just sub-device nodes. Add a note that -EINVAL will be returned if
the pad does not support EDIDs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/DocBook/media/v4l/v4l2.xml           |   2 +-
 .../DocBook/media/v4l/vidioc-subdev-g-edid.xml     | 152 ---------------------
 2 files changed, 1 insertion(+), 153 deletions(-)
 delete mode 100644 Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml

diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index 61a7bb1..b445161 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -607,6 +607,7 @@ and discussions on the V4L mailing list.</revremark>
     &sub-g-crop;
     &sub-g-ctrl;
     &sub-g-dv-timings;
+    &sub-g-edid;
     &sub-g-enc-index;
     &sub-g-ext-ctrls;
     &sub-g-fbuf;
@@ -638,7 +639,6 @@ and discussions on the V4L mailing list.</revremark>
     &sub-subdev-enum-frame-size;
     &sub-subdev-enum-mbus-code;
     &sub-subdev-g-crop;
-    &sub-subdev-g-edid;
     &sub-subdev-g-fmt;
     &sub-subdev-g-frame-interval;
     &sub-subdev-g-selection;
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
deleted file mode 100644
index bbd18f0..0000000
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<refentry id="vidioc-subdev-g-edid">
-  <refmeta>
-    <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle>
-    &manvol;
-  </refmeta>
-
-  <refnamediv>
-    <refname>VIDIOC_SUBDEV_G_EDID</refname>
-    <refname>VIDIOC_SUBDEV_S_EDID</refname>
-    <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <funcsynopsis>
-      <funcprototype>
-	<funcdef>int <function>ioctl</function></funcdef>
-	<paramdef>int <parameter>fd</parameter></paramdef>
-	<paramdef>int <parameter>request</parameter></paramdef>
-	<paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
-      </funcprototype>
-    </funcsynopsis>
-    <funcsynopsis>
-      <funcprototype>
-	<funcdef>int <function>ioctl</function></funcdef>
-	<paramdef>int <parameter>fd</parameter></paramdef>
-	<paramdef>int <parameter>request</parameter></paramdef>
-	<paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
-      </funcprototype>
-    </funcsynopsis>
-  </refsynopsisdiv>
-
-  <refsect1>
-    <title>Arguments</title>
-
-    <variablelist>
-      <varlistentry>
-	<term><parameter>fd</parameter></term>
-	<listitem>
-	  <para>&fd;</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><parameter>request</parameter></term>
-	<listitem>
-	  <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><parameter>argp</parameter></term>
-	<listitem>
-	  <para></para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
-  </refsect1>
-
-  <refsect1>
-    <title>Description</title>
-    <para>These ioctls can be used to get or set an EDID associated with an input pad
-    from a receiver or an output pad of a transmitter subdevice.</para>
-
-    <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
-    <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
-    fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block
-    <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
-    will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
-    pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes
-    large (the size of one block is 128 bytes).</para>
-
-    <para>If there are fewer blocks than specified, then the driver will set <structfield>blocks</structfield>
-    to the actual number of blocks. If there are no EDID blocks available at all, then the error code
-    ENODATA is set.</para>
-
-    <para>If blocks have to be retrieved from the sink, then this call will block until they
-    have been read.</para>
-
-    <para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
-    <structfield>blocks</structfield> and <structfield>edid</structfield> fields and set
-    <structfield>start_block</structfield> to 0. It is not possible to set part of an EDID,
-    it is always all or nothing. Setting the EDID data is only valid for receivers as it makes
-    no sense for a transmitter.</para>
-
-    <para>The driver assumes that the full EDID is passed in. If there are more EDID blocks than
-    the hardware can handle then the EDID is not written, but instead the error code E2BIG is set
-    and <structfield>blocks</structfield> is set to the maximum that the hardware supports.
-    If <structfield>start_block</structfield> is any
-    value other than 0 then the error code EINVAL is set.</para>
-
-    <para>To disable an EDID you set <structfield>blocks</structfield> to 0. Depending on the
-    hardware this will drive the hotplug pin low and/or block the source from reading the EDID
-    data in some way. In any case, the end result is the same: the EDID is no longer available.
-    </para>
-
-    <table pgwide="1" frame="none" id="v4l2-subdev-edid">
-      <title>struct <structname>v4l2_subdev_edid</structname></title>
-      <tgroup cols="3">
-        &cs-str;
-	<tbody valign="top">
-	  <row>
-	    <entry>__u32</entry>
-	    <entry><structfield>pad</structfield></entry>
-	    <entry>Pad for which to get/set the EDID blocks.</entry>
-	  </row>
-	  <row>
-	    <entry>__u32</entry>
-	    <entry><structfield>start_block</structfield></entry>
-	    <entry>Read the EDID from starting with this block. Must be 0 when setting
-	    the EDID.</entry>
-	  </row>
-	  <row>
-	    <entry>__u32</entry>
-	    <entry><structfield>blocks</structfield></entry>
-	    <entry>The number of blocks to get or set. Must be less or equal to 256 (the
-	    maximum number of blocks as defined by the standard). When you set the EDID and
-	    <structfield>blocks</structfield> is 0, then the EDID is disabled or erased.</entry>
-	  </row>
-	  <row>
-	    <entry>__u8&nbsp;*</entry>
-	    <entry><structfield>edid</structfield></entry>
-	    <entry>Pointer to memory that contains the EDID. The minimum size is
-	    <structfield>blocks</structfield>&nbsp;*&nbsp;128.</entry>
-	  </row>
-	  <row>
-	    <entry>__u32</entry>
-	    <entry><structfield>reserved</structfield>[5]</entry>
-	    <entry>Reserved for future extensions. Applications and drivers must
-	    set the array to zero.</entry>
-	  </row>
-	</tbody>
-      </tgroup>
-    </table>
-  </refsect1>
-
-  <refsect1>
-    &return-value;
-
-    <variablelist>
-      <varlistentry>
-	<term><errorcode>ENODATA</errorcode></term>
-	<listitem>
-	  <para>The EDID data is not available.</para>
-	</listitem>
-      </varlistentry>
-      <varlistentry>
-	<term><errorcode>E2BIG</errorcode></term>
-	<listitem>
-	  <para>The EDID data you provided is more than the hardware can handle.</para>
-	</listitem>
-      </varlistentry>
-    </variablelist>
-  </refsect1>
-</refentry>
-- 
1.9.0


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

* Re: [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support.
  2014-03-07 10:21 ` [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Hans Verkuil
@ 2014-03-07 14:04   ` Laurent Pinchart
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:04 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil, stable

Hi Hans,

Thank you for the patch.

On Friday 07 March 2014 11:21:15 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> The wrong ioctl numbers were used due to a copy-and-paste error.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: stable@vger.kernel.org      # for v3.7 and up

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 1b18616..7e23e19
> 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -787,8 +787,8 @@ static int put_v4l2_subdev_edid32(struct
> v4l2_subdev_edid *kp, struct v4l2_subde #define VIDIOC_DQBUF32		
_IOWR('V',
> 17, struct v4l2_buffer32)
>  #define VIDIOC_ENUMSTD32	_IOWR('V', 25, struct v4l2_standard32)
>  #define VIDIOC_ENUMINPUT32	_IOWR('V', 26, struct v4l2_input32)
> -#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 63, struct v4l2_subdev_edid32)
> -#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 64, struct v4l2_subdev_edid32)
> +#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 40, struct v4l2_subdev_edid32)
> +#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 41, struct v4l2_subdev_edid32)
>  #define VIDIOC_TRY_FMT32      	_IOWR('V', 64, struct v4l2_format32)
>  #define VIDIOC_G_EXT_CTRLS32    _IOWR('V', 71, struct v4l2_ext_controls32)
>  #define VIDIOC_S_EXT_CTRLS32    _IOWR('V', 72, struct v4l2_ext_controls32)

-- 
Regards,

Laurent Pinchart

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

* Re: [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes
  2014-03-07 10:21 ` [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes Hans Verkuil
@ 2014-03-07 14:04   ` Laurent Pinchart
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:04 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

Hi Hans,

Thank you for the patch.

On Friday 07 March 2014 11:21:16 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Struct v4l2_subdev_edid and the VIDIOC_SUBDEV_G/S_EDID ioctls were
> specific for subdevices, but for hardware with a simple video pipeline
> you do not need/want to create subdevice nodes to just get/set the EDID.
> 
> Move the v4l2_subdev_edid struct to v4l2-common.h and rename as
> v4l2_edid. Add the same ioctls to videodev2.h as well, thus allowing
> this API to be used with both video nodes and v4l-subdev nodes.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  include/uapi/linux/v4l2-common.h |  8 ++++++++
>  include/uapi/linux/v4l2-subdev.h | 14 +++++---------
>  include/uapi/linux/videodev2.h   |  2 ++
>  3 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/include/uapi/linux/v4l2-common.h
> b/include/uapi/linux/v4l2-common.h index 4f0667e..270db89 100644
> --- a/include/uapi/linux/v4l2-common.h
> +++ b/include/uapi/linux/v4l2-common.h
> @@ -68,4 +68,12 @@
>  #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE	V4L2_SEL_FLAG_LE
>  #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
> 
> +struct v4l2_edid {
> +	__u32 pad;
> +	__u32 start_block;
> +	__u32 blocks;
> +	__u32 reserved[5];
> +	__u8 __user *edid;
> +};
> +
>  #endif /* __V4L2_COMMON__ */
> diff --git a/include/uapi/linux/v4l2-subdev.h
> b/include/uapi/linux/v4l2-subdev.h index a33c4da..87e0515 100644
> --- a/include/uapi/linux/v4l2-subdev.h
> +++ b/include/uapi/linux/v4l2-subdev.h
> @@ -148,13 +148,8 @@ struct v4l2_subdev_selection {
>  	__u32 reserved[8];
>  };
> 
> -struct v4l2_subdev_edid {
> -	__u32 pad;
> -	__u32 start_block;
> -	__u32 blocks;
> -	__u32 reserved[5];
> -	__u8 __user *edid;
> -};
> +/* Backwards compatibility define --- to be removed */
> +#define v4l2_subdev_edid v4l2_edid
> 
>  #define VIDIOC_SUBDEV_G_FMT	_IOWR('V',  4, struct v4l2_subdev_format)
>  #define VIDIOC_SUBDEV_S_FMT	_IOWR('V',  5, struct v4l2_subdev_format)
> @@ -174,7 +169,8 @@ struct v4l2_subdev_edid {
>  	_IOWR('V', 61, struct v4l2_subdev_selection)
>  #define VIDIOC_SUBDEV_S_SELECTION \
>  	_IOWR('V', 62, struct v4l2_subdev_selection)
> -#define VIDIOC_SUBDEV_G_EDID	_IOWR('V', 40, struct v4l2_subdev_edid)
> -#define VIDIOC_SUBDEV_S_EDID	_IOWR('V', 41, struct v4l2_subdev_edid)
> +/* These two G/S_EDID ioctls are identical to the ioctls in videodev2.h */
> +#define VIDIOC_SUBDEV_G_EDID	_IOWR('V', 40, struct v4l2_edid)
> +#define VIDIOC_SUBDEV_S_EDID	_IOWR('V', 41, struct v4l2_edid)
> 
>  #endif
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 17acba8..339738a 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -1913,6 +1913,8 @@ struct v4l2_create_buffers {
>  #define VIDIOC_QUERYMENU	_IOWR('V', 37, struct v4l2_querymenu)
>  #define VIDIOC_G_INPUT		 _IOR('V', 38, int)
>  #define VIDIOC_S_INPUT		_IOWR('V', 39, int)
> +#define VIDIOC_G_EDID		_IOWR('V', 40, struct v4l2_edid)
> +#define VIDIOC_S_EDID		_IOWR('V', 41, struct v4l2_edid)
>  #define VIDIOC_G_OUTPUT		 _IOR('V', 46, int)
>  #define VIDIOC_S_OUTPUT		_IOWR('V', 47, int)
>  #define VIDIOC_ENUMOUTPUT	_IOWR('V', 48, struct v4l2_output)

-- 
Regards,

Laurent Pinchart


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

* Re: [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core.
  2014-03-07 10:21 ` [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core Hans Verkuil
@ 2014-03-07 14:07   ` Laurent Pinchart
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:07 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

Hi Hans,

Thank you for the patch.

On Friday 07 March 2014 11:21:17 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Support this ioctl as part of the v4l2 core. Use the new ioctl
> name and struct v4l2_edid type in the existing core code.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 32 ++++++++++++------------
>  drivers/media/v4l2-core/v4l2-dev.c            |  2 ++
>  drivers/media/v4l2-core/v4l2-ioctl.c          | 16 +++++++++++---
>  drivers/media/v4l2-core/v4l2-subdev.c         |  4 ++--
>  include/media/v4l2-ioctl.h                    |  2 ++
>  include/media/v4l2-subdev.h                   |  4 ++--
>  6 files changed, 37 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 7e23e19..872f1ca
> 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -740,7 +740,7 @@ static int put_v4l2_event32(struct v4l2_event *kp,
> struct v4l2_event32 __user *u return 0;
>  }
> 
> -struct v4l2_subdev_edid32 {
> +struct v4l2_edid32 {
>  	__u32 pad;
>  	__u32 start_block;
>  	__u32 blocks;
> @@ -748,11 +748,11 @@ struct v4l2_subdev_edid32 {
>  	compat_caddr_t edid;
>  };
> 
> -static int get_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct
> v4l2_subdev_edid32 __user *up) +static int get_v4l2_edid32(struct v4l2_edid
> *kp, struct v4l2_edid32 __user *up) {
>  	u32 tmp;
> 
> -	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_subdev_edid32)) ||
> +	if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_edid32)) ||
>  		get_user(kp->pad, &up->pad) ||
>  		get_user(kp->start_block, &up->start_block) ||
>  		get_user(kp->blocks, &up->blocks) ||
> @@ -763,11 +763,11 @@ static int get_v4l2_subdev_edid32(struct
> v4l2_subdev_edid *kp, struct v4l2_subde return 0;
>  }
> 
> -static int put_v4l2_subdev_edid32(struct v4l2_subdev_edid *kp, struct
> v4l2_subdev_edid32 __user *up) +static int put_v4l2_edid32(struct v4l2_edid
> *kp, struct v4l2_edid32 __user *up) {
>  	u32 tmp = (u32)((unsigned long)kp->edid);
> 
> -	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_subdev_edid32)) ||
> +	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_edid32)) ||
>  		put_user(kp->pad, &up->pad) ||
>  		put_user(kp->start_block, &up->start_block) ||
>  		put_user(kp->blocks, &up->blocks) ||
> @@ -787,8 +787,8 @@ static int put_v4l2_subdev_edid32(struct
> v4l2_subdev_edid *kp, struct v4l2_subde #define VIDIOC_DQBUF32		
_IOWR('V',
> 17, struct v4l2_buffer32)
>  #define VIDIOC_ENUMSTD32	_IOWR('V', 25, struct v4l2_standard32)
>  #define VIDIOC_ENUMINPUT32	_IOWR('V', 26, struct v4l2_input32)
> -#define VIDIOC_SUBDEV_G_EDID32	_IOWR('V', 40, struct v4l2_subdev_edid32)
> -#define VIDIOC_SUBDEV_S_EDID32	_IOWR('V', 41, struct v4l2_subdev_edid32)
> +#define VIDIOC_G_EDID32		_IOWR('V', 40, struct v4l2_edid32)
> +#define VIDIOC_S_EDID32		_IOWR('V', 41, struct v4l2_edid32)
>  #define VIDIOC_TRY_FMT32      	_IOWR('V', 64, struct v4l2_format32)
>  #define VIDIOC_G_EXT_CTRLS32    _IOWR('V', 71, struct v4l2_ext_controls32)
>  #define VIDIOC_S_EXT_CTRLS32    _IOWR('V', 72, struct v4l2_ext_controls32)
> @@ -816,7 +816,7 @@ static long do_video_ioctl(struct file *file, unsigned
> int cmd, unsigned long ar struct v4l2_ext_controls v2ecs;
>  		struct v4l2_event v2ev;
>  		struct v4l2_create_buffers v2crt;
> -		struct v4l2_subdev_edid v2edid;
> +		struct v4l2_edid v2edid;
>  		unsigned long vx;
>  		int vi;
>  	} karg;
> @@ -849,8 +849,8 @@ static long do_video_ioctl(struct file *file, unsigned
> int cmd, unsigned long ar case VIDIOC_S_OUTPUT32: cmd = VIDIOC_S_OUTPUT;
> break;
>  	case VIDIOC_CREATE_BUFS32: cmd = VIDIOC_CREATE_BUFS; break;
>  	case VIDIOC_PREPARE_BUF32: cmd = VIDIOC_PREPARE_BUF; break;
> -	case VIDIOC_SUBDEV_G_EDID32: cmd = VIDIOC_SUBDEV_G_EDID; break;
> -	case VIDIOC_SUBDEV_S_EDID32: cmd = VIDIOC_SUBDEV_S_EDID; break;
> +	case VIDIOC_G_EDID32: cmd = VIDIOC_G_EDID; break;
> +	case VIDIOC_S_EDID32: cmd = VIDIOC_S_EDID; break;
>  	}
> 
>  	switch (cmd) {
> @@ -868,9 +868,9 @@ static long do_video_ioctl(struct file *file, unsigned
> int cmd, unsigned long ar compatible_arg = 0;
>  		break;
> 
> -	case VIDIOC_SUBDEV_G_EDID:
> -	case VIDIOC_SUBDEV_S_EDID:
> -		err = get_v4l2_subdev_edid32(&karg.v2edid, up);
> +	case VIDIOC_G_EDID:
> +	case VIDIOC_S_EDID:
> +		err = get_v4l2_edid32(&karg.v2edid, up);
>  		compatible_arg = 0;
>  		break;
> 
> @@ -966,9 +966,9 @@ static long do_video_ioctl(struct file *file, unsigned
> int cmd, unsigned long ar err = put_v4l2_event32(&karg.v2ev, up);
>  		break;
> 
> -	case VIDIOC_SUBDEV_G_EDID:
> -	case VIDIOC_SUBDEV_S_EDID:
> -		err = put_v4l2_subdev_edid32(&karg.v2edid, up);
> +	case VIDIOC_G_EDID:
> +	case VIDIOC_S_EDID:
> +		err = put_v4l2_edid32(&karg.v2edid, up);
>  		break;
> 
>  	case VIDIOC_G_FMT:
> diff --git a/drivers/media/v4l2-core/v4l2-dev.c
> b/drivers/media/v4l2-core/v4l2-dev.c index 95112f6..634d863 100644
> --- a/drivers/media/v4l2-core/v4l2-dev.c
> +++ b/drivers/media/v4l2-core/v4l2-dev.c
> @@ -701,6 +701,7 @@ static void determine_valid_ioctls(struct video_device
> *vdev) SET_VALID_IOCTL(ops, VIDIOC_G_AUDIO, vidioc_g_audio);
>  			SET_VALID_IOCTL(ops, VIDIOC_S_AUDIO, vidioc_s_audio);
>  			SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, 
vidioc_query_dv_timings);
> +			SET_VALID_IOCTL(ops, VIDIOC_S_EDID, vidioc_s_edid);
>  		}
>  		if (is_tx) {
>  			SET_VALID_IOCTL(ops, VIDIOC_ENUMOUTPUT, vidioc_enum_output);
> @@ -726,6 +727,7 @@ static void determine_valid_ioctls(struct video_device
> *vdev) SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings);
> SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
> SET_VALID_IOCTL(ops, VIDIOC_DV_TIMINGS_CAP, vidioc_dv_timings_cap);
> +		SET_VALID_IOCTL(ops, VIDIOC_G_EDID, vidioc_g_edid);
>  	}
>  	if (is_tx && (is_radio || is_sdr)) {
>  		/* radio transmitter only ioctls */
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> b/drivers/media/v4l2-core/v4l2-ioctl.c index 95dd4f1..6536e15 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -844,6 +844,14 @@ static void v4l_print_freq_band(const void *arg, bool
> write_only) p->rangehigh, p->modulation);
>  }
> 
> +static void v4l_print_edid(const void *arg, bool write_only)
> +{
> +	const struct v4l2_edid *p = arg;
> +
> +	pr_cont("pad=%u, start_block=%u, blocks=%u\n",
> +		p->pad, p->start_block, p->blocks);
> +}
> +
>  static void v4l_print_u32(const void *arg, bool write_only)
>  {
>  	pr_cont("value=%u\n", *(const u32 *)arg);
> @@ -2062,6 +2070,8 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
>  	IOCTL_INFO_FNC(VIDIOC_QUERYMENU, v4l_querymenu, v4l_print_querymenu,
> INFO_FL_CTRL | INFO_FL_CLEAR(v4l2_querymenu, index)),
> IOCTL_INFO_STD(VIDIOC_G_INPUT, vidioc_g_input, v4l_print_u32, 0),
> IOCTL_INFO_FNC(VIDIOC_S_INPUT, v4l_s_input, v4l_print_u32, INFO_FL_PRIO),
> +	IOCTL_INFO_STD(VIDIOC_G_EDID, vidioc_g_edid, v4l_print_edid,
> INFO_FL_CLEAR(v4l2_edid, edid)), +	IOCTL_INFO_STD(VIDIOC_S_EDID,
> vidioc_s_edid, v4l_print_edid, INFO_FL_PRIO | INFO_FL_CLEAR(v4l2_edid,
> edid)), IOCTL_INFO_STD(VIDIOC_G_OUTPUT, vidioc_g_output, v4l_print_u32, 0),
> IOCTL_INFO_FNC(VIDIOC_S_OUTPUT, v4l_s_output, v4l_print_u32, INFO_FL_PRIO),
> IOCTL_INFO_FNC(VIDIOC_ENUMOUTPUT, v4l_enumoutput, v4l_print_enumoutput,
> INFO_FL_CLEAR(v4l2_output, index)), @@ -2274,9 +2284,9 @@ static int
> check_array_args(unsigned int cmd, void *parg, size_t *array_size, break;
>  	}
> 
> -	case VIDIOC_SUBDEV_G_EDID:
> -	case VIDIOC_SUBDEV_S_EDID: {
> -		struct v4l2_subdev_edid *edid = parg;
> +	case VIDIOC_G_EDID:
> +	case VIDIOC_S_EDID: {
> +		struct v4l2_edid *edid = parg;
> 
>  		if (edid->blocks) {
>  			if (edid->blocks > 256) {
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c
> b/drivers/media/v4l2-core/v4l2-subdev.c index 60d2550..aea84ac 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -349,10 +349,10 @@ static long subdev_do_ioctl(struct file *file,
> unsigned int cmd, void *arg) sd, pad, set_selection, subdev_fh, sel);
>  	}
> 
> -	case VIDIOC_SUBDEV_G_EDID:
> +	case VIDIOC_G_EDID:
>  		return v4l2_subdev_call(sd, pad, get_edid, arg);
> 
> -	case VIDIOC_SUBDEV_S_EDID:
> +	case VIDIOC_S_EDID:
>  		return v4l2_subdev_call(sd, pad, set_edid, arg);
>  #endif
>  	default:
> diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
> index 8be32f5..50cf7c1 100644
> --- a/include/media/v4l2-ioctl.h
> +++ b/include/media/v4l2-ioctl.h
> @@ -273,6 +273,8 @@ struct v4l2_ioctl_ops {
>  				    struct v4l2_enum_dv_timings *timings);
>  	int (*vidioc_dv_timings_cap) (struct file *file, void *fh,
>  				    struct v4l2_dv_timings_cap *cap);
> +	int (*vidioc_g_edid) (struct file *file, void *fh, struct v4l2_edid
> *edid); +	int (*vidioc_s_edid) (struct file *file, void *fh, struct
> v4l2_edid *edid);
> 
>  	int (*vidioc_subscribe_event)  (struct v4l2_fh *fh,
>  					const struct v4l2_event_subscription *sub);
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 1752530..855c928 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -507,8 +507,8 @@ struct v4l2_subdev_pad_ops {
>  			     struct v4l2_subdev_selection *sel);
>  	int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
>  			     struct v4l2_subdev_selection *sel);
> -	int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid);
> -	int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid);
> +	int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
> +	int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
>  #ifdef CONFIG_MEDIA_CONTROLLER
>  	int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link,
>  			     struct v4l2_subdev_format *source_fmt,

-- 
Regards,

Laurent Pinchart


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

* Re: [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid.
  2014-03-07 10:21 ` [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid Hans Verkuil
@ 2014-03-07 14:07   ` Laurent Pinchart
  0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:07 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

Hi Hans,

Thank you for the patch.

On Friday 07 March 2014 11:21:18 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/ad9389b.c | 2 +-
>  drivers/media/i2c/adv7511.c | 2 +-
>  drivers/media/i2c/adv7604.c | 4 ++--
>  drivers/media/i2c/adv7842.c | 4 ++--
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
> index 83225d6..1b7ecfd 100644
> --- a/drivers/media/i2c/ad9389b.c
> +++ b/drivers/media/i2c/ad9389b.c
> @@ -573,7 +573,7 @@ static const struct v4l2_subdev_core_ops
> ad9389b_core_ops = {
> 
>  /* ------------------------------ PAD OPS ------------------------------ */
> 
> -static int ad9389b_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *edid) +static int ad9389b_get_edid(struct v4l2_subdev *sd, struct
> v4l2_edid *edid) {
>  	struct ad9389b_state *state = get_ad9389b_state(sd);
> 
> diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
> index ee61894..942ca4b 100644
> --- a/drivers/media/i2c/adv7511.c
> +++ b/drivers/media/i2c/adv7511.c
> @@ -597,7 +597,7 @@ static int adv7511_isr(struct v4l2_subdev *sd, u32
> status, bool *handled) return 0;
>  }
> 
> -static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *edid) +static int adv7511_get_edid(struct v4l2_subdev *sd, struct
> v4l2_edid *edid) {
>  	struct adv7511_state *state = get_adv7511_state(sd);
> 
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 71c8570..98cc540 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -1658,7 +1658,7 @@ static int adv7604_isr(struct v4l2_subdev *sd, u32
> status, bool *handled) return 0;
>  }
> 
> -static int adv7604_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *edid) +static int adv7604_get_edid(struct v4l2_subdev *sd, struct
> v4l2_edid *edid) {
>  	struct adv7604_state *state = to_state(sd);
>  	u8 *data = NULL;
> @@ -1728,7 +1728,7 @@ static int get_edid_spa_location(const u8 *edid)
>  	return -1;
>  }
> 
> -static int adv7604_set_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *edid) +static int adv7604_set_edid(struct v4l2_subdev *sd, struct
> v4l2_edid *edid) {
>  	struct adv7604_state *state = to_state(sd);
>  	int spa_loc;
> diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
> index e04fe3f..4d1e07e 100644
> --- a/drivers/media/i2c/adv7842.c
> +++ b/drivers/media/i2c/adv7842.c
> @@ -2014,7 +2014,7 @@ static int adv7842_isr(struct v4l2_subdev *sd, u32
> status, bool *handled) return 0;
>  }
> 
> -static int adv7842_get_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *edid) +static int adv7842_get_edid(struct v4l2_subdev *sd, struct
> v4l2_edid *edid) {
>  	struct adv7842_state *state = to_state(sd);
>  	u8 *data = NULL;
> @@ -2054,7 +2054,7 @@ static int adv7842_get_edid(struct v4l2_subdev *sd,
> struct v4l2_subdev_edid *edi return 0;
>  }
> 
> -static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid
> *e) +static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid
> *e) {
>  	struct adv7842_state *state = to_state(sd);
>  	int err = 0;

-- 
Regards,

Laurent Pinchart


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

* Re: [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation
  2014-03-07 10:21 ` [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation Hans Verkuil
@ 2014-03-07 14:09   ` Laurent Pinchart
  2014-03-07 14:19     ` Hans Verkuil
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:09 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

Hi Hans,

Thank you for the patch.

On Friday 07 March 2014 11:21:19 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Document that it is now possible to call G/S_EDID from video nodes, not
> just sub-device nodes. Add a note that -EINVAL will be returned if
> the pad does not support EDIDs.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  Documentation/DocBook/media/v4l/v4l2.xml           |   2 +-
>  .../DocBook/media/v4l/vidioc-subdev-g-edid.xml     | 152 ------------------
>  2 files changed, 1 insertion(+), 153 deletions(-)
>  delete mode 100644 Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml

The patch just removes the EDID ioctls documentation, I highly doubt that this 
is what you intended :-)

-- 
Regards,

Laurent Pinchart


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

* Re: [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation
  2014-03-07 14:09   ` Laurent Pinchart
@ 2014-03-07 14:19     ` Hans Verkuil
  2014-03-07 14:25       ` Laurent Pinchart
  0 siblings, 1 reply; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 14:19 UTC (permalink / raw)
  To: Laurent Pinchart, Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

On 03/07/2014 03:09 PM, Laurent Pinchart wrote:
> Hi Hans,
> 
> Thank you for the patch.
> 
> On Friday 07 March 2014 11:21:19 Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> Document that it is now possible to call G/S_EDID from video nodes, not
>> just sub-device nodes. Add a note that -EINVAL will be returned if
>> the pad does not support EDIDs.
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  Documentation/DocBook/media/v4l/v4l2.xml           |   2 +-
>>  .../DocBook/media/v4l/vidioc-subdev-g-edid.xml     | 152 ------------------
>>  2 files changed, 1 insertion(+), 153 deletions(-)
>>  delete mode 100644 Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
> 
> The patch just removes the EDID ioctls documentation, I highly doubt that this 
> is what you intended :-)

Let's try again:


Document that it is now possible to call G/S_EDID from video nodes, not
just sub-device nodes. Add a note that -EINVAL will be returned if
the pad does not support EDIDs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/DocBook/media/v4l/v4l2.xml           |  2 +-
 ...{vidioc-subdev-g-edid.xml => vidioc-g-edid.xml} | 36 ++++++++++++++--------
 2 files changed, 24 insertions(+), 14 deletions(-)
 rename Documentation/DocBook/media/v4l/{vidioc-subdev-g-edid.xml => vidioc-g-edid.xml} (77%)

diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index 61a7bb1..b445161 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -607,6 +607,7 @@ and discussions on the V4L mailing list.</revremark>
     &sub-g-crop;
     &sub-g-ctrl;
     &sub-g-dv-timings;
+    &sub-g-edid;
     &sub-g-enc-index;
     &sub-g-ext-ctrls;
     &sub-g-fbuf;
@@ -638,7 +639,6 @@ and discussions on the V4L mailing list.</revremark>
     &sub-subdev-enum-frame-size;
     &sub-subdev-enum-mbus-code;
     &sub-subdev-g-crop;
-    &sub-subdev-g-edid;
     &sub-subdev-g-fmt;
     &sub-subdev-g-frame-interval;
     &sub-subdev-g-selection;
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml
similarity index 77%
rename from Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
rename to Documentation/DocBook/media/v4l/vidioc-g-edid.xml
index bbd18f0..becd7cb 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml
@@ -1,12 +1,12 @@
-<refentry id="vidioc-subdev-g-edid">
+<refentry id="vidioc-g-edid">
   <refmeta>
-    <refentrytitle>ioctl VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</refentrytitle>
+    <refentrytitle>ioctl VIDIOC_G_EDID, VIDIOC_S_EDID</refentrytitle>
     &manvol;
   </refmeta>
 
   <refnamediv>
-    <refname>VIDIOC_SUBDEV_G_EDID</refname>
-    <refname>VIDIOC_SUBDEV_S_EDID</refname>
+    <refname>VIDIOC_G_EDID</refname>
+    <refname>VIDIOC_S_EDID</refname>
     <refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
   </refnamediv>
 
@@ -16,7 +16,7 @@
 	<funcdef>int <function>ioctl</function></funcdef>
 	<paramdef>int <parameter>fd</parameter></paramdef>
 	<paramdef>int <parameter>request</parameter></paramdef>
-	<paramdef>struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
+	<paramdef>struct v4l2_edid *<parameter>argp</parameter></paramdef>
       </funcprototype>
     </funcsynopsis>
     <funcsynopsis>
@@ -24,7 +24,7 @@
 	<funcdef>int <function>ioctl</function></funcdef>
 	<paramdef>int <parameter>fd</parameter></paramdef>
 	<paramdef>int <parameter>request</parameter></paramdef>
-	<paramdef>const struct v4l2_subdev_edid *<parameter>argp</parameter></paramdef>
+	<paramdef>const struct v4l2_edid *<parameter>argp</parameter></paramdef>
       </funcprototype>
     </funcsynopsis>
   </refsynopsisdiv>
@@ -42,7 +42,7 @@
       <varlistentry>
 	<term><parameter>request</parameter></term>
 	<listitem>
-	  <para>VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
+	  <para>VIDIOC_G_EDID, VIDIOC_S_EDID</para>
 	</listitem>
       </varlistentry>
       <varlistentry>
@@ -56,12 +56,20 @@
 
   <refsect1>
     <title>Description</title>
-    <para>These ioctls can be used to get or set an EDID associated with an input pad
-    from a receiver or an output pad of a transmitter subdevice.</para>
+    <para>These ioctls can be used to get or set an EDID associated with an input
+    from a receiver or an output of a transmitter device. These ioctls can be
+    used with subdevice nodes (/dev/v4l-subdevX) or with video nodes (/dev/videoX).</para>
+
+    <para>When used with video nodes the <structfield>pad</structfield> field represents the
+    input (for video capture devices) or output (for video output devices) index as
+    is returned by &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively. When used
+    with subdevice nodes the <structfield>pad</structfield> field represents the
+    input or output pad of the subdevice. If there is no EDID support for the given
+    <structfield>pad</structfield> value, then the &EINVAL; will be returned.</para>
 
     <para>To get the EDID data the application has to fill in the <structfield>pad</structfield>,
     <structfield>start_block</structfield>, <structfield>blocks</structfield> and <structfield>edid</structfield>
-    fields and call <constant>VIDIOC_SUBDEV_G_EDID</constant>. The current EDID from block
+    fields and call <constant>VIDIOC_G_EDID</constant>. The current EDID from block
     <structfield>start_block</structfield> and of size <structfield>blocks</structfield>
     will be placed in the memory <structfield>edid</structfield> points to. The <structfield>edid</structfield>
     pointer must point to memory at least <structfield>blocks</structfield>&nbsp;*&nbsp;128 bytes
@@ -91,15 +99,17 @@
     data in some way. In any case, the end result is the same: the EDID is no longer available.
     </para>
 
-    <table pgwide="1" frame="none" id="v4l2-subdev-edid">
-      <title>struct <structname>v4l2_subdev_edid</structname></title>
+    <table pgwide="1" frame="none" id="v4l2-edid">
+      <title>struct <structname>v4l2_edid</structname></title>
       <tgroup cols="3">
         &cs-str;
 	<tbody valign="top">
 	  <row>
 	    <entry>__u32</entry>
 	    <entry><structfield>pad</structfield></entry>
-	    <entry>Pad for which to get/set the EDID blocks.</entry>
+	    <entry>Pad for which to get/set the EDID blocks. When used with a video device
+	    node the pad represents the input or output index as returned by
+	    &VIDIOC-ENUMINPUT; and &VIDIOC-ENUMOUTPUT; respectively.</entry>
 	  </row>
 	  <row>
 	    <entry>__u32</entry>
-- 
1.9.0



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

* Re: [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation
  2014-03-07 14:19     ` Hans Verkuil
@ 2014-03-07 14:25       ` Laurent Pinchart
  2014-03-07 14:31         ` Hans Verkuil
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2014-03-07 14:25 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Hans Verkuil, linux-media, marbugge, Hans Verkuil

Hi Hans,

On Friday 07 March 2014 15:19:07 Hans Verkuil wrote:
> On 03/07/2014 03:09 PM, Laurent Pinchart wrote:
> > Hi Hans,
> > 
> > Thank you for the patch.
> > 
> > On Friday 07 March 2014 11:21:19 Hans Verkuil wrote:
> >> From: Hans Verkuil <hans.verkuil@cisco.com>
> >> 
> >> Document that it is now possible to call G/S_EDID from video nodes, not
> >> just sub-device nodes. Add a note that -EINVAL will be returned if
> >> the pad does not support EDIDs.
> >> 
> >> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> >> ---
> >> 
> >>  Documentation/DocBook/media/v4l/v4l2.xml           |   2 +-
> >>  .../DocBook/media/v4l/vidioc-subdev-g-edid.xml     | 152
> >>  ------------------
> >>  2 files changed, 1 insertion(+), 153 deletions(-)
> >>  delete mode 100644
> >>  Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
> > 
> > The patch just removes the EDID ioctls documentation, I highly doubt that
> > this is what you intended :-)
> 
> Let's try again:

Much better :-)

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

with a minor nitpicking comment below.

> Document that it is now possible to call G/S_EDID from video nodes, not
> just sub-device nodes. Add a note that -EINVAL will be returned if
> the pad does not support EDIDs.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  Documentation/DocBook/media/v4l/v4l2.xml           |  2 +-
>  ...{vidioc-subdev-g-edid.xml => vidioc-g-edid.xml} | 36 +++++++++++--------
>  2 files changed, 24 insertions(+), 14 deletions(-)
>  rename Documentation/DocBook/media/v4l/{vidioc-subdev-g-edid.xml =>
>  vidioc-g-edid.xml} (77%)

[snip]

> diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
> b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml similarity index 77%
> rename from Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
> rename to Documentation/DocBook/media/v4l/vidioc-g-edid.xml
> index bbd18f0..becd7cb 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml

[snip]

> @@ -56,12 +56,20 @@
> 
>    <refsect1>
>      <title>Description</title>
> -    <para>These ioctls can be used to get or set an EDID associated with an
> input pad
> -    from a receiver or an output pad of a transmitter subdevice.</para>
> +    <para>These ioctls can be used to get or set an EDID associated with an
> input
> +    from a receiver or an output of a transmitter device. These ioctls can

I would s/These ioctls/They/ here to avoid repeating "These ioctls" at the 
beginning of the two sentences.

> be
> +    used with subdevice nodes (/dev/v4l-subdevX) or with video nodes
> (/dev/videoX).</para>
> +

-- 
Regards,

Laurent Pinchart


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

* Re: [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation
  2014-03-07 14:25       ` Laurent Pinchart
@ 2014-03-07 14:31         ` Hans Verkuil
  0 siblings, 0 replies; 14+ messages in thread
From: Hans Verkuil @ 2014-03-07 14:31 UTC (permalink / raw)
  To: Laurent Pinchart, Hans Verkuil; +Cc: linux-media, marbugge, Hans Verkuil

Hi Laurent,

Thanks for reviewing this series so quickly. I've added your nitpick to my
tree and I plan to post the pull request on Monday.

Regards,

	Hans

On 03/07/2014 03:25 PM, Laurent Pinchart wrote:
> Hi Hans,
> 
> On Friday 07 March 2014 15:19:07 Hans Verkuil wrote:
>> On 03/07/2014 03:09 PM, Laurent Pinchart wrote:
>>> Hi Hans,
>>>
>>> Thank you for the patch.
>>>
>>> On Friday 07 March 2014 11:21:19 Hans Verkuil wrote:
>>>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>>>
>>>> Document that it is now possible to call G/S_EDID from video nodes, not
>>>> just sub-device nodes. Add a note that -EINVAL will be returned if
>>>> the pad does not support EDIDs.
>>>>
>>>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>>>> ---
>>>>
>>>>  Documentation/DocBook/media/v4l/v4l2.xml           |   2 +-
>>>>  .../DocBook/media/v4l/vidioc-subdev-g-edid.xml     | 152
>>>>  ------------------
>>>>  2 files changed, 1 insertion(+), 153 deletions(-)
>>>>  delete mode 100644
>>>>  Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
>>>
>>> The patch just removes the EDID ioctls documentation, I highly doubt that
>>> this is what you intended :-)
>>
>> Let's try again:
> 
> Much better :-)
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> with a minor nitpicking comment below.
> 
>> Document that it is now possible to call G/S_EDID from video nodes, not
>> just sub-device nodes. Add a note that -EINVAL will be returned if
>> the pad does not support EDIDs.
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>>  Documentation/DocBook/media/v4l/v4l2.xml           |  2 +-
>>  ...{vidioc-subdev-g-edid.xml => vidioc-g-edid.xml} | 36 +++++++++++--------
>>  2 files changed, 24 insertions(+), 14 deletions(-)
>>  rename Documentation/DocBook/media/v4l/{vidioc-subdev-g-edid.xml =>
>>  vidioc-g-edid.xml} (77%)
> 
> [snip]
> 
>> diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
>> b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml similarity index 77%
>> rename from Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
>> rename to Documentation/DocBook/media/v4l/vidioc-g-edid.xml
>> index bbd18f0..becd7cb 100644
>> --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-edid.xml
>> +++ b/Documentation/DocBook/media/v4l/vidioc-g-edid.xml
> 
> [snip]
> 
>> @@ -56,12 +56,20 @@
>>
>>    <refsect1>
>>      <title>Description</title>
>> -    <para>These ioctls can be used to get or set an EDID associated with an
>> input pad
>> -    from a receiver or an output pad of a transmitter subdevice.</para>
>> +    <para>These ioctls can be used to get or set an EDID associated with an
>> input
>> +    from a receiver or an output of a transmitter device. These ioctls can
> 
> I would s/These ioctls/They/ here to avoid repeating "These ioctls" at the 
> beginning of the two sentences.
> 
>> be
>> +    used with subdevice nodes (/dev/v4l-subdevX) or with video nodes
>> (/dev/videoX).</para>
>> +
> 


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

end of thread, other threads:[~2014-03-07 14:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07 10:21 [REVIEWv1 PATCH 0/5] Add G/S_EDID support for video nodes Hans Verkuil
2014-03-07 10:21 ` [REVIEWv1 PATCH 1/5] v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Hans Verkuil
2014-03-07 14:04   ` Laurent Pinchart
2014-03-07 10:21 ` [REVIEWv1 PATCH 2/5] v4l2: allow v4l2_subdev_edid to be used with video nodes Hans Verkuil
2014-03-07 14:04   ` Laurent Pinchart
2014-03-07 10:21 ` [REVIEWv1 PATCH 3/5] v4l2: add VIDIOC_G/S_EDID support to the v4l2 core Hans Verkuil
2014-03-07 14:07   ` Laurent Pinchart
2014-03-07 10:21 ` [REVIEWv1 PATCH 4/5] adv*: replace the deprecated v4l2_subdev_edid by v4l2_edid Hans Verkuil
2014-03-07 14:07   ` Laurent Pinchart
2014-03-07 10:21 ` [REVIEWv1 PATCH 5/5] DocBook v4l2: update the G/S_EDID documentation Hans Verkuil
2014-03-07 14:09   ` Laurent Pinchart
2014-03-07 14:19     ` Hans Verkuil
2014-03-07 14:25       ` Laurent Pinchart
2014-03-07 14:31         ` Hans Verkuil

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.