GNOME Bugzilla – Bug 698825
v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
Last modified: 2013-05-01 13:35:24 UTC
Created attachment 242398 [details] [review] patch Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl is not implemented. With this patch, GStreamer handles both cases.
ENOTTY seems semantically wrong for this, and wasn't this only in a single kernel version and this change was reverted again later?
I think that was ENOENT for VIDIOC_QUERYCTRL, bug #691098 ?
You're right this patch is bogus.
I couldn't find the code path in the kernel that caused this issue so I dropped the patch. Now I came across the issue again. It exists in v3.9 and has existed for some time. What happens is basically this: drivers/media/v4l2-core/v4l2-ioctl.c: __video_do_ioctl(...) { [...] long ret = -ENOTTY; [...] if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) ...) goto done; [...] done: [...] return ret; }
commit 4d3f6850cac63145b119ffe60cfb197e5d7e77cd Author: Philipp Zabel <p.zabel@pengutronix.de> Date: Thu Jul 5 18:02:27 2012 +0200 v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl is not implemented. With this patch, GStreamer handles both cases. https://bugzilla.gnome.org/show_bug.cgi?id=698825