All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/8] stk-webcam: various fixes.
@ 2013-02-04 12:36 Hans Verkuil
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede

This patch series updates this driver to the control framework, switches
it to unlocked_ioctl, fixes a variety of V4L2 compliance issues.

It compiles, but to my knowledge nobody has hardware to test this :-(

If anyone has hardware to test this, please let me know!

Regards,

	Hans


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

* [RFC PATCH 1/8] stk-webcam: remove bogus STD support.
  2013-02-04 12:36 [RFC PATCH 1/8] stk-webcam: various fixes Hans Verkuil
@ 2013-02-04 12:36 ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 2/8] stk-webcam: add support for struct v4l2_device Hans Verkuil
                     ` (6 more replies)
  2013-02-04 13:13 ` [RFC PATCH 1/8] stk-webcam: various fixes Hans de Goede
  2013-02-04 13:23 ` Ezequiel Garcia
  2 siblings, 7 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

It's a webcam, the STD API is not applicable to webcams.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 4cbab08..176ab4b 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -768,12 +768,6 @@ static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
 		return 0;
 }
 
-/* from vivi.c */
-static int stk_vidioc_s_std(struct file *filp, void *priv, v4l2_std_id *a)
-{
-	return 0;
-}
-
 /* List of all V4Lv2 controls supported by the driver */
 static struct v4l2_queryctrl stk_controls[] = {
 	{
@@ -1225,7 +1219,6 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
 	.vidioc_enum_input = stk_vidioc_enum_input,
 	.vidioc_s_input = stk_vidioc_s_input,
 	.vidioc_g_input = stk_vidioc_g_input,
-	.vidioc_s_std = stk_vidioc_s_std,
 	.vidioc_reqbufs = stk_vidioc_reqbufs,
 	.vidioc_querybuf = stk_vidioc_querybuf,
 	.vidioc_qbuf = stk_vidioc_qbuf,
@@ -1251,8 +1244,6 @@ static void stk_v4l_dev_release(struct video_device *vd)
 
 static struct video_device stk_v4l_data = {
 	.name = "stkwebcam",
-	.tvnorms = V4L2_STD_UNKNOWN,
-	.current_norm = V4L2_STD_UNKNOWN,
 	.fops = &v4l_stk_fops,
 	.ioctl_ops = &v4l_stk_ioctl_ops,
 	.release = stk_v4l_dev_release,
-- 
1.7.10.4


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

* [RFC PATCH 2/8] stk-webcam: add support for struct v4l2_device.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 3/8] stk-webcam: convert to the control framework Hans Verkuil
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   10 +++++++++-
 drivers/media/usb/stkwebcam/stk-webcam.h |    2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 176ab4b..588304e 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -1256,7 +1256,7 @@ static int stk_register_video_device(struct stk_camera *dev)
 
 	dev->vdev = stk_v4l_data;
 	dev->vdev.debug = debug;
-	dev->vdev.parent = &dev->interface->dev;
+	dev->vdev.v4l2_dev = &dev->v4l2_dev;
 	err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
 	if (err)
 		STK_ERROR("v4l registration failed\n");
@@ -1285,6 +1285,12 @@ static int stk_camera_probe(struct usb_interface *interface,
 		STK_ERROR("Out of memory !\n");
 		return -ENOMEM;
 	}
+	err = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
+	if (err < 0) {
+		dev_err(&udev->dev, "couldn't register v4l2_device\n");
+		kfree(dev);
+		return err;
+	}
 
 	spin_lock_init(&dev->spinlock);
 	init_waitqueue_head(&dev->wait_frame);
@@ -1345,6 +1351,7 @@ static int stk_camera_probe(struct usb_interface *interface,
 	return 0;
 
 error:
+	v4l2_device_unregister(&dev->v4l2_dev);
 	kfree(dev);
 	return err;
 }
@@ -1362,6 +1369,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
 		 video_device_node_name(&dev->vdev));
 
 	video_unregister_device(&dev->vdev);
+	v4l2_device_unregister(&dev->v4l2_dev);
 }
 
 #ifdef CONFIG_PM
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.h b/drivers/media/usb/stkwebcam/stk-webcam.h
index 9f67366..49ebe85 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.h
+++ b/drivers/media/usb/stkwebcam/stk-webcam.h
@@ -23,6 +23,7 @@
 #define STKWEBCAM_H
 
 #include <linux/usb.h>
+#include <media/v4l2-device.h>
 #include <media/v4l2-common.h>
 
 #define DRIVER_VERSION		"v0.0.1"
@@ -91,6 +92,7 @@ struct regval {
 };
 
 struct stk_camera {
+	struct v4l2_device v4l2_dev;
 	struct video_device vdev;
 	struct usb_device *udev;
 	struct usb_interface *interface;
-- 
1.7.10.4


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

* [RFC PATCH 3/8] stk-webcam: convert to the control framework.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 2/8] stk-webcam: add support for struct v4l2_device Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 4/8] stk-webcam: don't use private_data, use video_drvdata Hans Verkuil
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |  119 ++++++++----------------------
 drivers/media/usb/stkwebcam/stk-webcam.h |    3 +-
 2 files changed, 33 insertions(+), 89 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 588304e..ff5b461 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -768,99 +768,25 @@ static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
 		return 0;
 }
 
-/* List of all V4Lv2 controls supported by the driver */
-static struct v4l2_queryctrl stk_controls[] = {
-	{
-		.id      = V4L2_CID_BRIGHTNESS,
-		.type    = V4L2_CTRL_TYPE_INTEGER,
-		.name    = "Brightness",
-		.minimum = 0,
-		.maximum = 0xffff,
-		.step    = 0x0100,
-		.default_value = 0x6000,
-	},
-	{
-		.id      = V4L2_CID_HFLIP,
-		.type    = V4L2_CTRL_TYPE_BOOLEAN,
-		.name    = "Horizontal Flip",
-		.minimum = 0,
-		.maximum = 1,
-		.step    = 1,
-		.default_value = 1,
-	},
-	{
-		.id      = V4L2_CID_VFLIP,
-		.type    = V4L2_CTRL_TYPE_BOOLEAN,
-		.name    = "Vertical Flip",
-		.minimum = 0,
-		.maximum = 1,
-		.step    = 1,
-		.default_value = 1,
-	},
-};
-
-static int stk_vidioc_queryctrl(struct file *filp,
-		void *priv, struct v4l2_queryctrl *c)
+static int stk_s_ctrl(struct v4l2_ctrl *ctrl)
 {
-	int i;
-	int nbr;
-	nbr = ARRAY_SIZE(stk_controls);
-
-	for (i = 0; i < nbr; i++) {
-		if (stk_controls[i].id == c->id) {
-			memcpy(c, &stk_controls[i],
-				sizeof(struct v4l2_queryctrl));
-			return 0;
-		}
-	}
-	return -EINVAL;
-}
-
-static int stk_vidioc_g_ctrl(struct file *filp,
-		void *priv, struct v4l2_control *c)
-{
-	struct stk_camera *dev = priv;
-	switch (c->id) {
-	case V4L2_CID_BRIGHTNESS:
-		c->value = dev->vsettings.brightness;
-		break;
-	case V4L2_CID_HFLIP:
-		if (dmi_check_system(stk_upside_down_dmi_table))
-			c->value = !dev->vsettings.hflip;
-		else
-			c->value = dev->vsettings.hflip;
-		break;
-	case V4L2_CID_VFLIP:
-		if (dmi_check_system(stk_upside_down_dmi_table))
-			c->value = !dev->vsettings.vflip;
-		else
-			c->value = dev->vsettings.vflip;
-		break;
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
+	struct stk_camera *dev =
+		container_of(ctrl->handler, struct stk_camera, hdl);
 
-static int stk_vidioc_s_ctrl(struct file *filp,
-		void *priv, struct v4l2_control *c)
-{
-	struct stk_camera *dev = priv;
-	switch (c->id) {
+	switch (ctrl->id) {
 	case V4L2_CID_BRIGHTNESS:
-		dev->vsettings.brightness = c->value;
-		return stk_sensor_set_brightness(dev, c->value >> 8);
+		return stk_sensor_set_brightness(dev, ctrl->val);
 	case V4L2_CID_HFLIP:
 		if (dmi_check_system(stk_upside_down_dmi_table))
-			dev->vsettings.hflip = !c->value;
+			dev->vsettings.hflip = !ctrl->val;
 		else
-			dev->vsettings.hflip = c->value;
+			dev->vsettings.hflip = ctrl->val;
 		return 0;
 	case V4L2_CID_VFLIP:
 		if (dmi_check_system(stk_upside_down_dmi_table))
-			dev->vsettings.vflip = !c->value;
+			dev->vsettings.vflip = !ctrl->val;
 		else
-			dev->vsettings.vflip = c->value;
+			dev->vsettings.vflip = ctrl->val;
 		return 0;
 	default:
 		return -EINVAL;
@@ -1200,6 +1126,10 @@ static int stk_vidioc_enum_framesizes(struct file *filp,
 	}
 }
 
+static const struct v4l2_ctrl_ops stk_ctrl_ops = {
+	.s_ctrl = stk_s_ctrl,
+};
+
 static struct v4l2_file_operations v4l_stk_fops = {
 	.owner = THIS_MODULE,
 	.open = v4l_stk_open,
@@ -1225,9 +1155,6 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
 	.vidioc_dqbuf = stk_vidioc_dqbuf,
 	.vidioc_streamon = stk_vidioc_streamon,
 	.vidioc_streamoff = stk_vidioc_streamoff,
-	.vidioc_queryctrl = stk_vidioc_queryctrl,
-	.vidioc_g_ctrl = stk_vidioc_g_ctrl,
-	.vidioc_s_ctrl = stk_vidioc_s_ctrl,
 	.vidioc_g_parm = stk_vidioc_g_parm,
 	.vidioc_enum_framesizes = stk_vidioc_enum_framesizes,
 };
@@ -1272,8 +1199,9 @@ static int stk_register_video_device(struct stk_camera *dev)
 static int stk_camera_probe(struct usb_interface *interface,
 		const struct usb_device_id *id)
 {
-	int i;
+	struct v4l2_ctrl_handler *hdl;
 	int err = 0;
+	int i;
 
 	struct stk_camera *dev = NULL;
 	struct usb_device *udev = interface_to_usbdev(interface);
@@ -1291,6 +1219,20 @@ static int stk_camera_probe(struct usb_interface *interface,
 		kfree(dev);
 		return err;
 	}
+	hdl = &dev->hdl;
+	v4l2_ctrl_handler_init(hdl, 3);
+	v4l2_ctrl_new_std(hdl, &stk_ctrl_ops,
+			  V4L2_CID_BRIGHTNESS, 0, 0xff, 0x1, 0x60);
+	v4l2_ctrl_new_std(hdl, &stk_ctrl_ops,
+			  V4L2_CID_HFLIP, 0, 1, 1, 1);
+	v4l2_ctrl_new_std(hdl, &stk_ctrl_ops,
+			  V4L2_CID_VFLIP, 0, 1, 1, 1);
+	if (hdl->error) {
+		err = hdl->error;
+		dev_err(&udev->dev, "couldn't register control\n");
+		goto error;
+	}
+	dev->v4l2_dev.ctrl_handler = hdl;
 
 	spin_lock_init(&dev->spinlock);
 	init_waitqueue_head(&dev->wait_frame);
@@ -1334,7 +1276,6 @@ static int stk_camera_probe(struct usb_interface *interface,
 		err = -ENODEV;
 		goto error;
 	}
-	dev->vsettings.brightness = 0x7fff;
 	dev->vsettings.palette = V4L2_PIX_FMT_RGB565;
 	dev->vsettings.mode = MODE_VGA;
 	dev->frame_size = 640 * 480 * 2;
@@ -1351,6 +1292,7 @@ static int stk_camera_probe(struct usb_interface *interface,
 	return 0;
 
 error:
+	v4l2_ctrl_handler_free(hdl);
 	v4l2_device_unregister(&dev->v4l2_dev);
 	kfree(dev);
 	return err;
@@ -1369,6 +1311,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
 		 video_device_node_name(&dev->vdev));
 
 	video_unregister_device(&dev->vdev);
+	v4l2_ctrl_handler_free(&dev->hdl);
 	v4l2_device_unregister(&dev->v4l2_dev);
 }
 
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.h b/drivers/media/usb/stkwebcam/stk-webcam.h
index 49ebe85..901f0df 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.h
+++ b/drivers/media/usb/stkwebcam/stk-webcam.h
@@ -24,6 +24,7 @@
 
 #include <linux/usb.h>
 #include <media/v4l2-device.h>
+#include <media/v4l2-ctrls.h>
 #include <media/v4l2-common.h>
 
 #define DRIVER_VERSION		"v0.0.1"
@@ -60,7 +61,6 @@ enum stk_mode {MODE_VGA, MODE_SXGA, MODE_CIF, MODE_QVGA, MODE_QCIF};
 
 struct stk_video {
 	enum stk_mode mode;
-	int brightness;
 	__u32 palette;
 	int hflip;
 	int vflip;
@@ -93,6 +93,7 @@ struct regval {
 
 struct stk_camera {
 	struct v4l2_device v4l2_dev;
+	struct v4l2_ctrl_handler hdl;
 	struct video_device vdev;
 	struct usb_device *udev;
 	struct usb_interface *interface;
-- 
1.7.10.4


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

* [RFC PATCH 4/8] stk-webcam: don't use private_data, use video_drvdata
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 2/8] stk-webcam: add support for struct v4l2_device Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 3/8] stk-webcam: convert to the control framework Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 5/8] stk-webcam: add support for control events and prio handling Hans Verkuil
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

file->private_data is needed to store the pointer to struct v4l2_fh.
So use video_drvdata to get hold of the stk_camera struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   32 +++++++++++++-----------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index ff5b461..24dc240 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -566,11 +566,7 @@ static void stk_free_buffers(struct stk_camera *dev)
 static int v4l_stk_open(struct file *fp)
 {
 	static int first_init = 1; /* webcam LED management */
-	struct stk_camera *dev;
-	struct video_device *vdev;
-
-	vdev = video_devdata(fp);
-	dev = vdev_to_camera(vdev);
+	struct stk_camera *dev = video_drvdata(fp);
 
 	if (dev == NULL || !is_present(dev))
 		return -ENXIO;
@@ -580,7 +576,6 @@ static int v4l_stk_open(struct file *fp)
 	else
 		first_init = 0;
 
-	fp->private_data = dev;
 	usb_autopm_get_interface(dev->interface);
 
 	return 0;
@@ -588,7 +583,7 @@ static int v4l_stk_open(struct file *fp)
 
 static int v4l_stk_release(struct file *fp)
 {
-	struct stk_camera *dev = fp->private_data;
+	struct stk_camera *dev = video_drvdata(fp);
 
 	if (dev->owner == fp) {
 		stk_stop_stream(dev);
@@ -611,7 +606,7 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
 	int ret;
 	unsigned long flags;
 	struct stk_sio_buffer *sbuf;
-	struct stk_camera *dev = fp->private_data;
+	struct stk_camera *dev = video_drvdata(fp);
 
 	if (!is_present(dev))
 		return -EIO;
@@ -667,7 +662,7 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
 
 static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait)
 {
-	struct stk_camera *dev = fp->private_data;
+	struct stk_camera *dev = video_drvdata(fp);
 
 	poll_wait(fp, &dev->wait_frame, wait);
 
@@ -703,7 +698,7 @@ static int v4l_stk_mmap(struct file *fp, struct vm_area_struct *vma)
 	unsigned int i;
 	int ret;
 	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
-	struct stk_camera *dev = fp->private_data;
+	struct stk_camera *dev = video_drvdata(fp);
 	struct stk_sio_buffer *sbuf = NULL;
 
 	if (!(vma->vm_flags & VM_WRITE) || !(vma->vm_flags & VM_SHARED))
@@ -841,7 +836,7 @@ static int stk_vidioc_g_fmt_vid_cap(struct file *filp,
 		void *priv, struct v4l2_format *f)
 {
 	struct v4l2_pix_format *pix_format = &f->fmt.pix;
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(stk_sizes) &&
@@ -946,7 +941,7 @@ static int stk_vidioc_s_fmt_vid_cap(struct file *filp,
 		void *priv, struct v4l2_format *fmtd)
 {
 	int ret;
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 
 	if (dev == NULL)
 		return -ENODEV;
@@ -973,7 +968,7 @@ static int stk_vidioc_s_fmt_vid_cap(struct file *filp,
 static int stk_vidioc_reqbufs(struct file *filp,
 		void *priv, struct v4l2_requestbuffers *rb)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 
 	if (dev == NULL)
 		return -ENODEV;
@@ -999,7 +994,7 @@ static int stk_vidioc_reqbufs(struct file *filp,
 static int stk_vidioc_querybuf(struct file *filp,
 		void *priv, struct v4l2_buffer *buf)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	struct stk_sio_buffer *sbuf;
 
 	if (buf->index >= dev->n_sbufs)
@@ -1012,7 +1007,7 @@ static int stk_vidioc_querybuf(struct file *filp,
 static int stk_vidioc_qbuf(struct file *filp,
 		void *priv, struct v4l2_buffer *buf)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	struct stk_sio_buffer *sbuf;
 	unsigned long flags;
 
@@ -1036,7 +1031,7 @@ static int stk_vidioc_qbuf(struct file *filp,
 static int stk_vidioc_dqbuf(struct file *filp,
 		void *priv, struct v4l2_buffer *buf)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	struct stk_sio_buffer *sbuf;
 	unsigned long flags;
 	int ret;
@@ -1069,7 +1064,7 @@ static int stk_vidioc_dqbuf(struct file *filp,
 static int stk_vidioc_streamon(struct file *filp,
 		void *priv, enum v4l2_buf_type type)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	if (is_streaming(dev))
 		return 0;
 	if (dev->sio_bufs == NULL)
@@ -1081,7 +1076,7 @@ static int stk_vidioc_streamon(struct file *filp,
 static int stk_vidioc_streamoff(struct file *filp,
 		void *priv, enum v4l2_buf_type type)
 {
-	struct stk_camera *dev = priv;
+	struct stk_camera *dev = video_drvdata(filp);
 	unsigned long flags;
 	int i;
 	stk_stop_stream(dev);
@@ -1184,6 +1179,7 @@ static int stk_register_video_device(struct stk_camera *dev)
 	dev->vdev = stk_v4l_data;
 	dev->vdev.debug = debug;
 	dev->vdev.v4l2_dev = &dev->v4l2_dev;
+	video_set_drvdata(&dev->vdev, dev);
 	err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
 	if (err)
 		STK_ERROR("v4l registration failed\n");
-- 
1.7.10.4


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

* [RFC PATCH 5/8] stk-webcam: add support for control events and prio handling.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
                     ` (2 preceding siblings ...)
  2013-02-04 12:36   ` [RFC PATCH 4/8] stk-webcam: don't use private_data, use video_drvdata Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 6/8] stk-webcam: fix querycap and simplify s_input Hans Verkuil
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

Also correct the first_init static: this should be part of the stk_camera struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   27 +++++++++++++++++----------
 drivers/media/usb/stkwebcam/stk-webcam.h |    1 +
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 24dc240..a7882d6 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -35,6 +35,7 @@
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-event.h>
 
 #include "stk-webcam.h"
 
@@ -565,20 +566,21 @@ static void stk_free_buffers(struct stk_camera *dev)
 
 static int v4l_stk_open(struct file *fp)
 {
-	static int first_init = 1; /* webcam LED management */
 	struct stk_camera *dev = video_drvdata(fp);
+	int err;
 
 	if (dev == NULL || !is_present(dev))
 		return -ENXIO;
 
-	if (!first_init)
+	if (!dev->first_init)
 		stk_camera_write_reg(dev, 0x0, 0x24);
 	else
-		first_init = 0;
-
-	usb_autopm_get_interface(dev->interface);
+		dev->first_init = 0;
 
-	return 0;
+	err = v4l2_fh_open(fp);
+	if (!err)
+		usb_autopm_get_interface(dev->interface);
+	return err;
 }
 
 static int v4l_stk_release(struct file *fp)
@@ -595,8 +597,7 @@ static int v4l_stk_release(struct file *fp)
 
 	if (is_present(dev))
 		usb_autopm_put_interface(dev->interface);
-
-	return 0;
+	return v4l2_fh_release(fp);
 }
 
 static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
@@ -663,6 +664,7 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
 static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait)
 {
 	struct stk_camera *dev = video_drvdata(fp);
+	unsigned res = v4l2_ctrl_poll(fp, wait);
 
 	poll_wait(fp, &dev->wait_frame, wait);
 
@@ -670,9 +672,9 @@ static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait)
 		return POLLERR;
 
 	if (!list_empty(&dev->sio_full))
-		return POLLIN | POLLRDNORM;
+		return res | POLLIN | POLLRDNORM;
 
-	return 0;
+	return res;
 }
 
 
@@ -1152,6 +1154,9 @@ static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
 	.vidioc_streamoff = stk_vidioc_streamoff,
 	.vidioc_g_parm = stk_vidioc_g_parm,
 	.vidioc_enum_framesizes = stk_vidioc_enum_framesizes,
+	.vidioc_log_status = v4l2_ctrl_log_status,
+	.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
+	.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
 };
 
 static void stk_v4l_dev_release(struct video_device *vd)
@@ -1179,6 +1184,7 @@ static int stk_register_video_device(struct stk_camera *dev)
 	dev->vdev = stk_v4l_data;
 	dev->vdev.debug = debug;
 	dev->vdev.v4l2_dev = &dev->v4l2_dev;
+	set_bit(V4L2_FL_USE_FH_PRIO, &dev->vdev.flags);
 	video_set_drvdata(&dev->vdev, dev);
 	err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
 	if (err)
@@ -1232,6 +1238,7 @@ static int stk_camera_probe(struct usb_interface *interface,
 
 	spin_lock_init(&dev->spinlock);
 	init_waitqueue_head(&dev->wait_frame);
+	dev->first_init = 1; /* webcam LED management */
 
 	dev->udev = udev;
 	dev->interface = interface;
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.h b/drivers/media/usb/stkwebcam/stk-webcam.h
index 901f0df..2156320 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.h
+++ b/drivers/media/usb/stkwebcam/stk-webcam.h
@@ -99,6 +99,7 @@ struct stk_camera {
 	struct usb_interface *interface;
 	int webcam_model;
 	struct file *owner;
+	int first_init;
 
 	u8 isoc_ep;
 
-- 
1.7.10.4


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

* [RFC PATCH 6/8] stk-webcam: fix querycap and simplify s_input.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
                     ` (3 preceding siblings ...)
  2013-02-04 12:36   ` [RFC PATCH 5/8] stk-webcam: add support for control events and prio handling Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 7/8] stk-webcam: zero the priv field of v4l2_pix_format Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 8/8] stk-webcam: enable core-locking Hans Verkuil
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

Add device_caps support to querycap and do not set the version field (let the
core handle that).

Also simplify the s_input ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index a7882d6..a654578 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -730,12 +730,16 @@ static int v4l_stk_mmap(struct file *fp, struct vm_area_struct *vma)
 static int stk_vidioc_querycap(struct file *filp,
 		void *priv, struct v4l2_capability *cap)
 {
+	struct stk_camera *dev = video_drvdata(filp);
+
 	strcpy(cap->driver, "stk");
 	strcpy(cap->card, "stk");
-	cap->version = DRIVER_VERSION_NUM;
+	strlcpy(cap->bus_info, dev_name(&dev->udev->dev),
+		sizeof(cap->bus_info));
 
-	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE
+	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE
 		| V4L2_CAP_READWRITE | V4L2_CAP_STREAMING;
+	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 
@@ -759,10 +763,7 @@ static int stk_vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
 
 static int stk_vidioc_s_input(struct file *filp, void *priv, unsigned int i)
 {
-	if (i != 0)
-		return -EINVAL;
-	else
-		return 0;
+	return i ? -EINVAL : 0;
 }
 
 static int stk_s_ctrl(struct v4l2_ctrl *ctrl)
-- 
1.7.10.4


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

* [RFC PATCH 7/8] stk-webcam: zero the priv field of v4l2_pix_format.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
                     ` (4 preceding siblings ...)
  2013-02-04 12:36   ` [RFC PATCH 6/8] stk-webcam: fix querycap and simplify s_input Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  2013-02-04 12:36   ` [RFC PATCH 8/8] stk-webcam: enable core-locking Hans Verkuil
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

The priv field should be set to 0. In this case the driver abused the priv
field for internal housekeeping. Modify the code so priv is no longer used
for that purpose.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index a654578..d1ef797 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -860,11 +860,12 @@ static int stk_vidioc_g_fmt_vid_cap(struct file *filp,
 		pix_format->bytesperline = 2 * pix_format->width;
 	pix_format->sizeimage = pix_format->bytesperline
 				* pix_format->height;
+	pix_format->priv = 0;
 	return 0;
 }
 
-static int stk_vidioc_try_fmt_vid_cap(struct file *filp,
-		void *priv, struct v4l2_format *fmtd)
+static int stk_try_fmt_vid_cap(struct file *filp,
+		struct v4l2_format *fmtd, int *idx)
 {
 	int i;
 	switch (fmtd->fmt.pix.pixelformat) {
@@ -886,11 +887,13 @@ static int stk_vidioc_try_fmt_vid_cap(struct file *filp,
 			< abs(fmtd->fmt.pix.width - stk_sizes[i].w))) {
 		fmtd->fmt.pix.height = stk_sizes[i-1].h;
 		fmtd->fmt.pix.width = stk_sizes[i-1].w;
-		fmtd->fmt.pix.priv = i - 1;
+		if (idx)
+			*idx = i - 1;
 	} else {
 		fmtd->fmt.pix.height = stk_sizes[i].h;
 		fmtd->fmt.pix.width = stk_sizes[i].w;
-		fmtd->fmt.pix.priv = i;
+		if (idx)
+			*idx = i;
 	}
 
 	fmtd->fmt.pix.field = V4L2_FIELD_NONE;
@@ -901,9 +904,16 @@ static int stk_vidioc_try_fmt_vid_cap(struct file *filp,
 		fmtd->fmt.pix.bytesperline = 2 * fmtd->fmt.pix.width;
 	fmtd->fmt.pix.sizeimage = fmtd->fmt.pix.bytesperline
 		* fmtd->fmt.pix.height;
+	fmtd->fmt.pix.priv = 0;
 	return 0;
 }
 
+static int stk_vidioc_try_fmt_vid_cap(struct file *filp,
+		void *priv, struct v4l2_format *fmtd)
+{
+	return stk_try_fmt_vid_cap(filp, fmtd, NULL);
+}
+
 static int stk_setup_format(struct stk_camera *dev)
 {
 	int i = 0;
@@ -944,6 +954,7 @@ static int stk_vidioc_s_fmt_vid_cap(struct file *filp,
 		void *priv, struct v4l2_format *fmtd)
 {
 	int ret;
+	int idx;
 	struct stk_camera *dev = video_drvdata(filp);
 
 	if (dev == NULL)
@@ -954,7 +965,7 @@ static int stk_vidioc_s_fmt_vid_cap(struct file *filp,
 		return -EBUSY;
 	if (dev->owner && dev->owner != filp)
 		return -EBUSY;
-	ret = stk_vidioc_try_fmt_vid_cap(filp, priv, fmtd);
+	ret = stk_try_fmt_vid_cap(filp, fmtd, &idx);
 	if (ret)
 		return ret;
 	dev->owner = filp;
@@ -962,7 +973,7 @@ static int stk_vidioc_s_fmt_vid_cap(struct file *filp,
 	dev->vsettings.palette = fmtd->fmt.pix.pixelformat;
 	stk_free_buffers(dev);
 	dev->frame_size = fmtd->fmt.pix.sizeimage;
-	dev->vsettings.mode = stk_sizes[fmtd->fmt.pix.priv].m;
+	dev->vsettings.mode = stk_sizes[idx].m;
 
 	stk_initialise(dev);
 	return stk_setup_format(dev);
-- 
1.7.10.4


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

* [RFC PATCH 8/8] stk-webcam: enable core-locking.
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
                     ` (5 preceding siblings ...)
  2013-02-04 12:36   ` [RFC PATCH 7/8] stk-webcam: zero the priv field of v4l2_pix_format Hans Verkuil
@ 2013-02-04 12:36   ` Hans Verkuil
  6 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 12:36 UTC (permalink / raw)
  To: linux-media; +Cc: Hans de Goede, Hans Verkuil

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

This makes it possible to switch to unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/stkwebcam/stk-webcam.c |   24 ++++++++++++++++++++++--
 drivers/media/usb/stkwebcam/stk-webcam.h |    1 +
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index d1ef797..3fbcb7f 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -572,6 +572,8 @@ static int v4l_stk_open(struct file *fp)
 	if (dev == NULL || !is_present(dev))
 		return -ENXIO;
 
+	if (mutex_lock_interruptible(&dev->lock))
+		return -ERESTARTSYS;
 	if (!dev->first_init)
 		stk_camera_write_reg(dev, 0x0, 0x24);
 	else
@@ -580,6 +582,7 @@ static int v4l_stk_open(struct file *fp)
 	err = v4l2_fh_open(fp);
 	if (!err)
 		usb_autopm_get_interface(dev->interface);
+	mutex_unlock(&dev->lock);
 	return err;
 }
 
@@ -587,6 +590,7 @@ static int v4l_stk_release(struct file *fp)
 {
 	struct stk_camera *dev = video_drvdata(fp);
 
+	mutex_lock(&dev->lock);
 	if (dev->owner == fp) {
 		stk_stop_stream(dev);
 		stk_free_buffers(dev);
@@ -597,10 +601,11 @@ static int v4l_stk_release(struct file *fp)
 
 	if (is_present(dev))
 		usb_autopm_put_interface(dev->interface);
+	mutex_unlock(&dev->lock);
 	return v4l2_fh_release(fp);
 }
 
-static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
+static ssize_t stk_read(struct file *fp, char __user *buf,
 		size_t count, loff_t *f_pos)
 {
 	int i;
@@ -661,6 +666,19 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
 	return count;
 }
 
+static ssize_t v4l_stk_read(struct file *fp, char __user *buf,
+		size_t count, loff_t *f_pos)
+{
+	struct stk_camera *dev = video_drvdata(fp);
+	int ret;
+
+	if (mutex_lock_interruptible(&dev->lock))
+		return -ERESTARTSYS;
+	ret = stk_read(fp, buf, count, f_pos);
+	mutex_unlock(&dev->lock);
+	return ret;
+}
+
 static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait)
 {
 	struct stk_camera *dev = video_drvdata(fp);
@@ -1146,7 +1164,7 @@ static struct v4l2_file_operations v4l_stk_fops = {
 	.read = v4l_stk_read,
 	.poll = v4l_stk_poll,
 	.mmap = v4l_stk_mmap,
-	.ioctl = video_ioctl2,
+	.unlocked_ioctl = video_ioctl2,
 };
 
 static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
@@ -1194,6 +1212,7 @@ static int stk_register_video_device(struct stk_camera *dev)
 	int err;
 
 	dev->vdev = stk_v4l_data;
+	dev->vdev.lock = &dev->lock;
 	dev->vdev.debug = debug;
 	dev->vdev.v4l2_dev = &dev->v4l2_dev;
 	set_bit(V4L2_FL_USE_FH_PRIO, &dev->vdev.flags);
@@ -1249,6 +1268,7 @@ static int stk_camera_probe(struct usb_interface *interface,
 	dev->v4l2_dev.ctrl_handler = hdl;
 
 	spin_lock_init(&dev->spinlock);
+	mutex_init(&dev->lock);
 	init_waitqueue_head(&dev->wait_frame);
 	dev->first_init = 1; /* webcam LED management */
 
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.h b/drivers/media/usb/stkwebcam/stk-webcam.h
index 2156320..03550cf 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.h
+++ b/drivers/media/usb/stkwebcam/stk-webcam.h
@@ -99,6 +99,7 @@ struct stk_camera {
 	struct usb_interface *interface;
 	int webcam_model;
 	struct file *owner;
+	struct mutex lock;
 	int first_init;
 
 	u8 isoc_ep;
-- 
1.7.10.4


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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-04 12:36 [RFC PATCH 1/8] stk-webcam: various fixes Hans Verkuil
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
@ 2013-02-04 13:13 ` Hans de Goede
  2013-02-04 13:23 ` Ezequiel Garcia
  2 siblings, 0 replies; 26+ messages in thread
From: Hans de Goede @ 2013-02-04 13:13 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi,

On 02/04/2013 01:36 PM, Hans Verkuil wrote:
> This patch series updates this driver to the control framework, switches
> it to unlocked_ioctl, fixes a variety of V4L2 compliance issues.

Good stuff!

> It compiles, but to my knowledge nobody has hardware to test this :-(
>
> If anyone has hardware to test this, please let me know!

I've recently done some changes to stk-webcam because of upside-down issues
with it, and my changes where (eventually) tested by the upside-down
bug-reporter. I'll send you his mail-address in a private mail.

I would like to suggest to keep this series as RFC only until this is
actually tested, since this driver is still being actively used, so regressing
on it would be bad.

Regards,

Hans

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-04 12:36 [RFC PATCH 1/8] stk-webcam: various fixes Hans Verkuil
  2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
  2013-02-04 13:13 ` [RFC PATCH 1/8] stk-webcam: various fixes Hans de Goede
@ 2013-02-04 13:23 ` Ezequiel Garcia
  2013-02-04 13:35   ` Hans Verkuil
  2 siblings, 1 reply; 26+ messages in thread
From: Ezequiel Garcia @ 2013-02-04 13:23 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, Hans de Goede, Arvydas Sidorenko

Hello Hans,

On Mon, Feb 4, 2013 at 9:36 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> This patch series updates this driver to the control framework, switches
> it to unlocked_ioctl, fixes a variety of V4L2 compliance issues.
>
> It compiles, but to my knowledge nobody has hardware to test this :-(
>
> If anyone has hardware to test this, please let me know!
>

I've sent a patch for stk-webcam recently and Arvydas Sidorenko (in
Cc) was kind enough to test it.

@Arvydas: If you're not too busy, we'd really appreciate a lot
if you can test this series.

Thanks a lot,

-- 
    Ezequiel

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-04 13:23 ` Ezequiel Garcia
@ 2013-02-04 13:35   ` Hans Verkuil
  2013-02-05 15:28     ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-04 13:35 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Mon February 4 2013 14:23:55 Ezequiel Garcia wrote:
> Hello Hans,
> 
> On Mon, Feb 4, 2013 at 9:36 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> > This patch series updates this driver to the control framework, switches
> > it to unlocked_ioctl, fixes a variety of V4L2 compliance issues.
> >
> > It compiles, but to my knowledge nobody has hardware to test this :-(
> >
> > If anyone has hardware to test this, please let me know!
> >
> 
> I've sent a patch for stk-webcam recently and Arvydas Sidorenko (in
> Cc) was kind enough to test it.
> 
> @Arvydas: If you're not too busy, we'd really appreciate a lot
> if you can test this series.

Hi Arvydas,

Yes indeed, it would be great if you could test this!

Note that the patch series is also available in my git tree:

http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/stkwebcam

Besides the normal testing that everything works as expected, it would also
be great if you could run the v4l2-compliance tool. It's part of the v4l-utils
repository (http://git.linuxtv.org/v4l-utils.git) and it tests whether a driver
complies to the V4L2 specification.

Just compile the tool from the repository (don't use a distro-provided version)
and run it as 'v4l2-compliance -d /dev/videoX' and mail me the output. You will
get at least one failure at the end, but I'd like to know if there are other
issues remaining.

Regards,

	Hans

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-04 13:35   ` Hans Verkuil
@ 2013-02-05 15:28     ` Arvydas Sidorenko
  2013-02-05 15:35       ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-05 15:28 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Mon, Feb 4, 2013 at 2:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> Hi Arvydas,
>
> Yes indeed, it would be great if you could test this!
>
> Note that the patch series is also available in my git tree:
>
> http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/stkwebcam
>
> Besides the normal testing that everything works as expected, it would also
> be great if you could run the v4l2-compliance tool. It's part of the v4l-utils
> repository (http://git.linuxtv.org/v4l-utils.git) and it tests whether a driver
> complies to the V4L2 specification.
>
> Just compile the tool from the repository (don't use a distro-provided version)
> and run it as 'v4l2-compliance -d /dev/videoX' and mail me the output. You will
> get at least one failure at the end, but I'd like to know if there are other
> issues remaining.
>
> Regards,
>
>         Hans

I have tested the patches using STK-1135 webcam. Everything works well.

$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : stk
	Card type     : stk
	Bus info      :
	Driver version: 0.0.1
	Capabilities  : 0x05000001
		Video Capture
		Read/Write
		Streaming

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
		fail: v4l2-compliance.cpp(224): string empty
		fail: v4l2-compliance.cpp(276): check_ustring(vcap.bus_info,
sizeof(vcap.bus_info))
	test VIDIOC_QUERYCAP: FAIL

Allow for multiple opens:
	test second video open: OK
		fail: v4l2-compliance.cpp(224): string empty
		fail: v4l2-compliance.cpp(276): check_ustring(vcap.bus_info,
sizeof(vcap.bus_info))
	test VIDIOC_QUERYCAP: FAIL
		fail: v4l2-compliance.cpp(334): doioctl(node, VIDIOC_G_PRIORITY, &prio)
	test VIDIOC_G/S_PRIORITY: FAIL

Debug ioctls:
	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
		fail: v4l2-test-input-output.cpp(354): std == 0
		fail: v4l2-test-input-output.cpp(409): invalid attributes for input 0
	test VIDIOC_G/S/ENUMINPUT: FAIL
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Control ioctls:
		fail: v4l2-test-controls.cpp(145): can do querymenu on a non-menu control
		fail: v4l2-test-controls.cpp(254): invalid control 00980900
	test VIDIOC_QUERYCTRL/MENU: FAIL
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 0 Private Controls: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
		fail: v4l2-test-formats.cpp(385): priv is non-zero!
	test VIDIOC_TRY_FMT: FAIL
		fail: v4l2-test-formats.cpp(719): Video Capture is valid, but no
S_FMT was implemented
	test VIDIOC_S_FMT: FAIL
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
		fail: v4l2-test-buffers.cpp(132): ret != -1
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL

Total: 38, Succeeded: 30, Failed: 8, Warnings: 1


Arvydas

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-05 15:28     ` Arvydas Sidorenko
@ 2013-02-05 15:35       ` Hans Verkuil
  2013-02-05 16:56         ` Ezequiel Garcia
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-05 15:35 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Tue February 5 2013 16:28:17 Arvydas Sidorenko wrote:
> On Mon, Feb 4, 2013 at 2:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > Hi Arvydas,
> >
> > Yes indeed, it would be great if you could test this!
> >
> > Note that the patch series is also available in my git tree:
> >
> > http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/stkwebcam
> >
> > Besides the normal testing that everything works as expected, it would also
> > be great if you could run the v4l2-compliance tool. It's part of the v4l-utils
> > repository (http://git.linuxtv.org/v4l-utils.git) and it tests whether a driver
> > complies to the V4L2 specification.
> >
> > Just compile the tool from the repository (don't use a distro-provided version)
> > and run it as 'v4l2-compliance -d /dev/videoX' and mail me the output. You will
> > get at least one failure at the end, but I'd like to know if there are other
> > issues remaining.
> >
> > Regards,
> >
> >         Hans
> 
> I have tested the patches using STK-1135 webcam. Everything works well.
> 
> $ v4l2-compliance -d /dev/video0
> Driver Info:
> 	Driver name   : stk
> 	Card type     : stk
> 	Bus info      :
> 	Driver version: 0.0.1

This is the old version of the driver you are testing with :-)

If you have the right version, then the driver version is much higher,
bus info is filled in and you will see 'Device Caps' after the 'Capabilities'
list.

Regards,

	Hans

> 	Capabilities  : 0x05000001
> 		Video Capture
> 		Read/Write
> 		Streaming
> 
> Compliance test for device /dev/video0 (not using libv4l2):
> 
> Required ioctls:
> 		fail: v4l2-compliance.cpp(224): string empty
> 		fail: v4l2-compliance.cpp(276): check_ustring(vcap.bus_info,
> sizeof(vcap.bus_info))
> 	test VIDIOC_QUERYCAP: FAIL
> 
> Allow for multiple opens:
> 	test second video open: OK
> 		fail: v4l2-compliance.cpp(224): string empty
> 		fail: v4l2-compliance.cpp(276): check_ustring(vcap.bus_info,
> sizeof(vcap.bus_info))
> 	test VIDIOC_QUERYCAP: FAIL
> 		fail: v4l2-compliance.cpp(334): doioctl(node, VIDIOC_G_PRIORITY, &prio)
> 	test VIDIOC_G/S_PRIORITY: FAIL
> 
> Debug ioctls:
> 	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
> 	test VIDIOC_G/S_TUNER: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> 		fail: v4l2-test-input-output.cpp(354): std == 0
> 		fail: v4l2-test-input-output.cpp(409): invalid attributes for input 0
> 	test VIDIOC_G/S/ENUMINPUT: FAIL
> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Control ioctls:
> 		fail: v4l2-test-controls.cpp(145): can do querymenu on a non-menu control
> 		fail: v4l2-test-controls.cpp(254): invalid control 00980900
> 	test VIDIOC_QUERYCTRL/MENU: FAIL
> 	test VIDIOC_G/S_CTRL: OK
> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> 	Standard Controls: 0 Private Controls: 0
> 
> Input/Output configuration ioctls:
> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> 
> Format ioctls:
> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> 	test VIDIOC_G/S_PARM: OK
> 	test VIDIOC_G_FBUF: OK (Not Supported)
> 	test VIDIOC_G_FMT: OK
> 		fail: v4l2-test-formats.cpp(385): priv is non-zero!
> 	test VIDIOC_TRY_FMT: FAIL
> 		fail: v4l2-test-formats.cpp(719): Video Capture is valid, but no
> S_FMT was implemented
> 	test VIDIOC_S_FMT: FAIL
> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> 
> Codec ioctls:
> 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls:
> 		fail: v4l2-test-buffers.cpp(132): ret != -1
> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
> 
> Total: 38, Succeeded: 30, Failed: 8, Warnings: 1
> 
> 
> Arvydas
> 

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-05 15:35       ` Hans Verkuil
@ 2013-02-05 16:56         ` Ezequiel Garcia
  2013-02-05 17:08           ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Ezequiel Garcia @ 2013-02-05 16:56 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: linux-media, Hans de Goede, Hans Verkuil

On Tue, Feb 5, 2013 at 12:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On Tue February 5 2013 16:28:17 Arvydas Sidorenko wrote:
>> On Mon, Feb 4, 2013 at 2:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> >
>> > Hi Arvydas,
>> >
>> > Yes indeed, it would be great if you could test this!
>> >
>> > Note that the patch series is also available in my git tree:
>> >
>> > http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/stkwebcam
>> >
>> > Besides the normal testing that everything works as expected, it would also
>> > be great if you could run the v4l2-compliance tool. It's part of the v4l-utils
>> > repository (http://git.linuxtv.org/v4l-utils.git) and it tests whether a driver
>> > complies to the V4L2 specification.
>> >
>> > Just compile the tool from the repository (don't use a distro-provided version)
>> > and run it as 'v4l2-compliance -d /dev/videoX' and mail me the output. You will
>> > get at least one failure at the end, but I'd like to know if there are other
>> > issues remaining.
>> >
>> > Regards,
>> >
>> >         Hans
>>
>> I have tested the patches using STK-1135 webcam. Everything works well.
>>
>> $ v4l2-compliance -d /dev/video0
>> Driver Info:
>>       Driver name   : stk
>>       Card type     : stk
>>       Bus info      :
>>       Driver version: 0.0.1
>
> This is the old version of the driver you are testing with :-)
>

@Arvydas: First of all, thanks for taking the time to test Hans' patches.

I suggest to double check the old driver
is not loaded and then run "depmod -a" to update modules.

As a last resource you can always wipe out the driver from
/lib/modules/what-ever and reinstall.

Hope this helps!

-- 
    Ezequiel

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-05 16:56         ` Ezequiel Garcia
@ 2013-02-05 17:08           ` Arvydas Sidorenko
  2013-02-05 18:41             ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-05 17:08 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: linux-media, Hans de Goede, Hans Verkuil

On Tue, Feb 5, 2013 at 5:56 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> On Tue, Feb 5, 2013 at 12:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> On Tue February 5 2013 16:28:17 Arvydas Sidorenko wrote:
>>>
>>> I have tested the patches using STK-1135 webcam. Everything works well.
>>>
>>> $ v4l2-compliance -d /dev/video0
>>> Driver Info:
>>>       Driver name   : stk
>>>       Card type     : stk
>>>       Bus info      :
>>>       Driver version: 0.0.1
>>
>> This is the old version of the driver you are testing with :-)
>>
>
> @Arvydas: First of all, thanks for taking the time to test Hans' patches.
>
> I suggest to double check the old driver
> is not loaded and then run "depmod -a" to update modules.
>
> As a last resource you can always wipe out the driver from
> /lib/modules/what-ever and reinstall.
>
> Hope this helps!
>
> --
>     Ezequiel

Yes, I am sorry. I built the wrong branch.

The cam works, but the view is upside down.

$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : stk
	Card type     : stk
	Bus info      : 4-8
	Driver version: 3.1.0
	Capabilities  : 0x85000001
		Video Capture
		Read/Write
		Streaming
		Device Capabilities
	Device Caps   : 0x05000001
		Video Capture
		Read/Write
		Streaming

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
		fail: v4l2-compliance.cpp(285): missing bus_info prefix ('4-8')
	test VIDIOC_QUERYCAP: FAIL

Allow for multiple opens:
	test second video open: OK
		fail: v4l2-compliance.cpp(285): missing bus_info prefix ('4-8')
	test VIDIOC_QUERYCAP: FAIL
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Control ioctls:
	test VIDIOC_QUERYCTRL/MENU: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 4 Private Controls: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
		fail: v4l2-test-formats.cpp(566): Video Capture is valid, but
TRY_FMT failed to return a format
	test VIDIOC_TRY_FMT: FAIL
		fail: v4l2-test-formats.cpp(719): Video Capture is valid, but no
S_FMT was implemented
	test VIDIOC_S_FMT: FAIL
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
		fail: v4l2-test-buffers.cpp(132): ret != -1
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL

Total: 38, Succeeded: 33, Failed: 5, Warnings: 0

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-05 17:08           ` Arvydas Sidorenko
@ 2013-02-05 18:41             ` Hans Verkuil
  2013-02-06  7:32               ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-05 18:41 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Tue February 5 2013 18:08:31 Arvydas Sidorenko wrote:
> On Tue, Feb 5, 2013 at 5:56 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> > On Tue, Feb 5, 2013 at 12:35 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >> On Tue February 5 2013 16:28:17 Arvydas Sidorenko wrote:
> >>>
> >>> I have tested the patches using STK-1135 webcam. Everything works well.
> >>>
> >>> $ v4l2-compliance -d /dev/video0
> >>> Driver Info:
> >>>       Driver name   : stk
> >>>       Card type     : stk
> >>>       Bus info      :
> >>>       Driver version: 0.0.1
> >>
> >> This is the old version of the driver you are testing with :-)
> >>
> >
> > @Arvydas: First of all, thanks for taking the time to test Hans' patches.
> >
> > I suggest to double check the old driver
> > is not loaded and then run "depmod -a" to update modules.
> >
> > As a last resource you can always wipe out the driver from
> > /lib/modules/what-ever and reinstall.
> >
> > Hope this helps!
> >
> > --
> >     Ezequiel
> 
> Yes, I am sorry. I built the wrong branch.
> 
> The cam works, but the view is upside down.

Hmm, can you try this without my patches? Some work has been done recently
regarding upside-down sensors and I need to know whether I broke it or
whether those earlier changes broke it for you. I checked my code and I
didn't see anything obviously wrong.

> 
> $ v4l2-compliance -d /dev/video0
> Driver Info:
> 	Driver name   : stk
> 	Card type     : stk
> 	Bus info      : 4-8
> 	Driver version: 3.1.0
> 	Capabilities  : 0x85000001
> 		Video Capture
> 		Read/Write
> 		Streaming
> 		Device Capabilities
> 	Device Caps   : 0x05000001
> 		Video Capture
> 		Read/Write
> 		Streaming
> 
> Compliance test for device /dev/video0 (not using libv4l2):
> 
> Required ioctls:
> 		fail: v4l2-compliance.cpp(285): missing bus_info prefix ('4-8')

Correct, that's my fault. I've fixed that in my git branch.

> 	test VIDIOC_QUERYCAP: FAIL
> 
> Allow for multiple opens:
> 	test second video open: OK
> 		fail: v4l2-compliance.cpp(285): missing bus_info prefix ('4-8')
> 	test VIDIOC_QUERYCAP: FAIL
> 	test VIDIOC_G/S_PRIORITY: OK
> 
> Debug ioctls:
> 	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> 	test VIDIOC_LOG_STATUS: OK
> 
> Input ioctls:
> 	test VIDIOC_G/S_TUNER: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMINPUT: OK
> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> 	Inputs: 1 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Control ioctls:
> 	test VIDIOC_QUERYCTRL/MENU: OK
> 	test VIDIOC_G/S_CTRL: OK
> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> 	Standard Controls: 4 Private Controls: 0
> 
> Input/Output configuration ioctls:
> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> 
> Format ioctls:
> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> 	test VIDIOC_G/S_PARM: OK
> 	test VIDIOC_G_FBUF: OK (Not Supported)
> 	test VIDIOC_G_FMT: OK
> 		fail: v4l2-test-formats.cpp(566): Video Capture is valid, but
> TRY_FMT failed to return a format
> 	test VIDIOC_TRY_FMT: FAIL
> 		fail: v4l2-test-formats.cpp(719): Video Capture is valid, but no
> S_FMT was implemented

Are you sure you are using the v4l2-compliance from the latest v4l-utils.git
repository? I've made some changes in these format compliance tests and I think
you don't have those changes.

> 	test VIDIOC_S_FMT: FAIL
> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> 
> Codec ioctls:
> 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls:
> 		fail: v4l2-test-buffers.cpp(132): ret != -1

I need to look into this a bit more. I probably need to improve v4l2-compliance
itself so I get better feedback as to which error is actually returned here.

Thank you very much for testing!

Regards,

	Hans

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-05 18:41             ` Hans Verkuil
@ 2013-02-06  7:32               ` Hans Verkuil
  2013-02-07 22:39                 ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-06  7:32 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Tue February 5 2013 19:41:31 Hans Verkuil wrote:
> > Buffer ioctls:
> > 		fail: v4l2-test-buffers.cpp(132): ret != -1
> 
> I need to look into this a bit more. I probably need to improve v4l2-compliance
> itself so I get better feedback as to which error is actually returned here.

I've improved v4l2-compliance a bit, but I've also pushed a fix (I hope) to
my git branch.

It's great if you can test this!

Regards,

	Hans

> 
> Thank you very much for testing!
> 
> Regards,
> 
> 	Hans
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-06  7:32               ` Hans Verkuil
@ 2013-02-07 22:39                 ` Arvydas Sidorenko
  2013-02-08  9:20                   ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-07 22:39 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Wed, Feb 6, 2013 at 8:32 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> I've improved v4l2-compliance a bit, but I've also pushed a fix (I hope) to
> my git branch.
>
> It's great if you can test this!
>

$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : stk
	Card type     : stk
	Bus info      : usb-0000:00:1d.7-8
	Driver version: 3.1.0
	Capabilities  : 0x85000001
		Video Capture
		Read/Write
		Streaming
		Device Capabilities
	Device Caps   : 0x05000001
		Video Capture
		Read/Write
		Streaming

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Control ioctls:
	test VIDIOC_QUERYCTRL/MENU: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 4 Private Controls: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
		warn: v4l2-test-formats.cpp(565): TRY_FMT cannot handle an invalid
pixelformat. This may or may not be a problem.
See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
for more information.
	test VIDIOC_TRY_FMT: OK
		warn: v4l2-test-formats.cpp(723): S_FMT cannot handle an invalid
pixelformat. This may or may not be a problem.
See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
for more information.
		warn: v4l2-test-formats.cpp(658): Could not set fmt1
	test VIDIOC_S_FMT: OK
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
		fail: v4l2-test-buffers.cpp(166): doioctl(node->node2, VIDIOC_REQBUFS, &bufs)
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL

Total: 38, Succeeded: 37, Failed: 1, Warnings: 3


On top of that it generates some dmesg output:
[   70.514849] stkwebcam 5-8:1.0: =================  START STATUS
=================
[   70.514856] stkwebcam 5-8:1.0: Brightness: 96
[   70.514860] stkwebcam 5-8:1.0: Horizontal Flip: true
[   70.514863] stkwebcam 5-8:1.0: Vertical Flip: true
[   70.514866] stkwebcam 5-8:1.0: ==================  END STATUS
==================
[   70.596727] stkwebcam: OmniVision sensor detected, id 9652 at address 60
[   70.859490] stkwebcam: isobufs already allocated. Bad
[   70.859977] stkwebcam: isobuf data already allocated
[   70.860502] stkwebcam: Killing URB
[   70.860990] stkwebcam: isobuf data already allocated
[   70.861478] stkwebcam: Killing URB
[   70.862088] stkwebcam: isobuf data already allocated
[   70.862834] stkwebcam: Killing URB
[   70.863594] stkwebcam: sio_bufs already allocated
[   70.864319] stkwebcam: isobufs already allocated. Bad
[   70.865057] stkwebcam: isobuf data already allocated
[   70.865752] stkwebcam: Killing URB
[   70.866490] stkwebcam: isobuf data already allocated
[   70.867275] stkwebcam: Killing URB
[   70.867980] stkwebcam: isobuf data already allocated
[   70.868721] stkwebcam: Killing URB
[   70.869464] stkwebcam: sio_bufs already allocated
[   70.870244] stkwebcam: isobufs already allocated. Bad
[   70.870968] stkwebcam: isobuf data already allocated
[   70.871704] stkwebcam: Killing URB
[   70.872440] stkwebcam: isobuf data already allocated
[   70.873181] stkwebcam: Killing URB
[   70.873936] stkwebcam: isobuf data already allocated
[   70.874671] stkwebcam: Killing URB
[   70.875414] stkwebcam: sio_bufs already allocated


The view is still upside down, but it is also the same using version
before you patches.

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-07 22:39                 ` Arvydas Sidorenko
@ 2013-02-08  9:20                   ` Hans Verkuil
  2013-02-09 11:22                     ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-08  9:20 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Thu February 7 2013 23:39:58 Arvydas Sidorenko wrote:
> On Wed, Feb 6, 2013 at 8:32 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > I've improved v4l2-compliance a bit, but I've also pushed a fix (I hope) to
> > my git branch.
> >
> > It's great if you can test this!
> >

Thanks for the testing! I've pushed some more improvements to my git branch.
Hopefully the compliance tests are now running OK. Please check the dmesg
output as well.

In addition I've added an 'upside down' message to the kernel log that tells
me whether the driver is aware that your sensor is upside down or not.

Which laptop do you have? Asus G1?

Regards,

	Hans

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-08  9:20                   ` Hans Verkuil
@ 2013-02-09 11:22                     ` Arvydas Sidorenko
  2013-02-10  8:28                       ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-09 11:22 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Fri, Feb 8, 2013 at 10:20 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> Thanks for the testing! I've pushed some more improvements to my git branch.
> Hopefully the compliance tests are now running OK. Please check the dmesg
> output as well.
>
> In addition I've added an 'upside down' message to the kernel log that tells
> me whether the driver is aware that your sensor is upside down or not.
>
> Which laptop do you have? Asus G1?
>
> Regards,
>
>         Hans

Now it looks better, but clearly there is an issue with the upside down thing.
I have ASUS F3Jc laptop.

Although a commit '6f89814d3d' introduced a problem.
> if (rb->count == 0)
>     dev->owner = NULL;
Now 'v4l_stk_release' doesn't release the resources because 'dev->owner != fp'.

$ dmesg | grep upside
[    4.933507] upside down: 0

$ v4l2-compliance -d /dev/video0
Driver Info:
	Driver name   : stk
	Card type     : stk
	Bus info      : usb-0000:00:1d.7-8
	Driver version: 3.1.0
	Capabilities  : 0x85000001
		Video Capture
		Read/Write
		Streaming
		Device Capabilities
	Device Caps   : 0x05000001
		Video Capture
		Read/Write
		Streaming

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK

Input ioctls:
	test VIDIOC_G/S_TUNER: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Control ioctls:
	test VIDIOC_QUERYCTRL/MENU: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 4 Private Controls: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
		warn: v4l2-test-formats.cpp(565): TRY_FMT cannot handle an invalid
pixelformat. This may or may not be a problem.
See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
for more information.
	test VIDIOC_TRY_FMT: OK
		warn: v4l2-test-formats.cpp(723): S_FMT cannot handle an invalid
pixelformat. This may or may not be a problem.
See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
for more information.
	test VIDIOC_S_FMT: OK
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
		warn: v4l2-test-buffers.cpp(175): VIDIOC_CREATE_BUFS not supported
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK

Total: 38, Succeeded: 38, Failed: 0, Warnings: 3


Arvydas

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-09 11:22                     ` Arvydas Sidorenko
@ 2013-02-10  8:28                       ` Hans Verkuil
  2013-02-10 14:46                         ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-10  8:28 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Sat February 9 2013 12:22:12 Arvydas Sidorenko wrote:
> On Fri, Feb 8, 2013 at 10:20 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > Thanks for the testing! I've pushed some more improvements to my git branch.
> > Hopefully the compliance tests are now running OK. Please check the dmesg
> > output as well.
> >
> > In addition I've added an 'upside down' message to the kernel log that tells
> > me whether the driver is aware that your sensor is upside down or not.
> >
> > Which laptop do you have? Asus G1?
> >
> > Regards,
> >
> >         Hans
> 
> Now it looks better, but clearly there is an issue with the upside down thing.
> I have ASUS F3Jc laptop.
> 
> Although a commit '6f89814d3d' introduced a problem.
> > if (rb->count == 0)
> >     dev->owner = NULL;
> Now 'v4l_stk_release' doesn't release the resources because 'dev->owner != fp'.

Fixed.

> 
> $ dmesg | grep upside
> [    4.933507] upside down: 0

I've improved this message, so please run again with the latest code and let me
know what it says. I don't understand all the upside-down problems...

Regards,

	Hans

> 
> $ v4l2-compliance -d /dev/video0
> Driver Info:
> 	Driver name   : stk
> 	Card type     : stk
> 	Bus info      : usb-0000:00:1d.7-8
> 	Driver version: 3.1.0
> 	Capabilities  : 0x85000001
> 		Video Capture
> 		Read/Write
> 		Streaming
> 		Device Capabilities
> 	Device Caps   : 0x05000001
> 		Video Capture
> 		Read/Write
> 		Streaming
> 
> Compliance test for device /dev/video0 (not using libv4l2):
> 
> Required ioctls:
> 	test VIDIOC_QUERYCAP: OK
> 
> Allow for multiple opens:
> 	test second video open: OK
> 	test VIDIOC_QUERYCAP: OK
> 	test VIDIOC_G/S_PRIORITY: OK
> 
> Debug ioctls:
> 	test VIDIOC_DBG_G_CHIP_IDENT: OK (Not Supported)
> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> 	test VIDIOC_LOG_STATUS: OK
> 
> Input ioctls:
> 	test VIDIOC_G/S_TUNER: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMINPUT: OK
> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> 	Inputs: 1 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Control ioctls:
> 	test VIDIOC_QUERYCTRL/MENU: OK
> 	test VIDIOC_G/S_CTRL: OK
> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> 	Standard Controls: 4 Private Controls: 0
> 
> Input/Output configuration ioctls:
> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> 
> Format ioctls:
> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> 	test VIDIOC_G/S_PARM: OK
> 	test VIDIOC_G_FBUF: OK (Not Supported)
> 	test VIDIOC_G_FMT: OK
> 		warn: v4l2-test-formats.cpp(565): TRY_FMT cannot handle an invalid
> pixelformat. This may or may not be a problem.
> See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
> for more information.
> 	test VIDIOC_TRY_FMT: OK
> 		warn: v4l2-test-formats.cpp(723): S_FMT cannot handle an invalid
> pixelformat. This may or may not be a problem.
> See http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
> for more information.
> 	test VIDIOC_S_FMT: OK
> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> 
> Codec ioctls:
> 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls:
> 		warn: v4l2-test-buffers.cpp(175): VIDIOC_CREATE_BUFS not supported
> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> 
> Total: 38, Succeeded: 38, Failed: 0, Warnings: 3
> 
> 
> Arvydas
> 

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-10  8:28                       ` Hans Verkuil
@ 2013-02-10 14:46                         ` Arvydas Sidorenko
  2013-02-10 15:02                           ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-10 14:46 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Sun, Feb 10, 2013 at 8:28 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> I've improved this message, so please run again with the latest code and let me
> know what it says. I don't understand all the upside-down problems...
>

$ dmesg | grep upside
upside down: 0 -1 -1

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-10 14:46                         ` Arvydas Sidorenko
@ 2013-02-10 15:02                           ` Hans Verkuil
  2013-02-10 16:16                             ` Arvydas Sidorenko
  0 siblings, 1 reply; 26+ messages in thread
From: Hans Verkuil @ 2013-02-10 15:02 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Sun February 10 2013 15:46:05 Arvydas Sidorenko wrote:
> On Sun, Feb 10, 2013 at 8:28 AM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > I've improved this message, so please run again with the latest code and let me
> > know what it says. I don't understand all the upside-down problems...
> >
> 
> $ dmesg | grep upside
> upside down: 0 -1 -1
> 

Thanks, I found the bug. It's my fault: I made a logic error w.r.t. setting up
the initial hflip/vflip values. I've read over it dozens of times without
actually catching the - rather obvious - bug :-)

Get the latest code, try again and if everything works fine for you then I'll
clean up my patches and post the final version.

Thanks for testing!

Regards,

	Hans

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-10 15:02                           ` Hans Verkuil
@ 2013-02-10 16:16                             ` Arvydas Sidorenko
  2013-02-10 17:30                               ` Hans Verkuil
  0 siblings, 1 reply; 26+ messages in thread
From: Arvydas Sidorenko @ 2013-02-10 16:16 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Sun, Feb 10, 2013 at 3:02 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> Thanks, I found the bug. It's my fault: I made a logic error w.r.t. setting up
> the initial hflip/vflip values. I've read over it dozens of times without
> actually catching the - rather obvious - bug :-)
>
> Get the latest code, try again and if everything works fine for you then I'll
> clean up my patches and post the final version.
>

Looks good. Thanks for you effort!

Arvydas

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

* Re: [RFC PATCH 1/8] stk-webcam: various fixes.
  2013-02-10 16:16                             ` Arvydas Sidorenko
@ 2013-02-10 17:30                               ` Hans Verkuil
  0 siblings, 0 replies; 26+ messages in thread
From: Hans Verkuil @ 2013-02-10 17:30 UTC (permalink / raw)
  To: Arvydas Sidorenko; +Cc: Ezequiel Garcia, linux-media, Hans de Goede

On Sun February 10 2013 17:16:30 Arvydas Sidorenko wrote:
> On Sun, Feb 10, 2013 at 3:02 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> >
> > Thanks, I found the bug. It's my fault: I made a logic error w.r.t. setting up
> > the initial hflip/vflip values. I've read over it dozens of times without
> > actually catching the - rather obvious - bug :-)

After rechecking I discovered that I didn't introduce this after all. It was
recently introduced in a patch for the 3.9 kernel. Luckily that patch isn't
in the upcoming 3.8 kernel.

> > Get the latest code, try again and if everything works fine for you then I'll
> > clean up my patches and post the final version.
> >
> 
> Looks good. Thanks for you effort!

No problem, nice to have another driver pass the compliance test.

Regards,

	Hans

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

end of thread, other threads:[~2013-02-10 17:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-04 12:36 [RFC PATCH 1/8] stk-webcam: various fixes Hans Verkuil
2013-02-04 12:36 ` [RFC PATCH 1/8] stk-webcam: remove bogus STD support Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 2/8] stk-webcam: add support for struct v4l2_device Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 3/8] stk-webcam: convert to the control framework Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 4/8] stk-webcam: don't use private_data, use video_drvdata Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 5/8] stk-webcam: add support for control events and prio handling Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 6/8] stk-webcam: fix querycap and simplify s_input Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 7/8] stk-webcam: zero the priv field of v4l2_pix_format Hans Verkuil
2013-02-04 12:36   ` [RFC PATCH 8/8] stk-webcam: enable core-locking Hans Verkuil
2013-02-04 13:13 ` [RFC PATCH 1/8] stk-webcam: various fixes Hans de Goede
2013-02-04 13:23 ` Ezequiel Garcia
2013-02-04 13:35   ` Hans Verkuil
2013-02-05 15:28     ` Arvydas Sidorenko
2013-02-05 15:35       ` Hans Verkuil
2013-02-05 16:56         ` Ezequiel Garcia
2013-02-05 17:08           ` Arvydas Sidorenko
2013-02-05 18:41             ` Hans Verkuil
2013-02-06  7:32               ` Hans Verkuil
2013-02-07 22:39                 ` Arvydas Sidorenko
2013-02-08  9:20                   ` Hans Verkuil
2013-02-09 11:22                     ` Arvydas Sidorenko
2013-02-10  8:28                       ` Hans Verkuil
2013-02-10 14:46                         ` Arvydas Sidorenko
2013-02-10 15:02                           ` Hans Verkuil
2013-02-10 16:16                             ` Arvydas Sidorenko
2013-02-10 17:30                               ` 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.