<modified the CC list to be more appropriate> Hi, On 12/25/2012 05:56 AM, Mauro Carvalho Chehab wrote:
The pwc driver can currently return -ENOENT at VIDIOC_S_FMT ioctl. This doesn't seem right. Instead, it should be getting the closest format to the requested one and return 0, passing the selected format back to userspace, just like the other drivers do. I'm c/c Hans de Goede for him to take a look on it.
I've been looking into this today, and the ENOENT gets returned by pwc_set_video_mode and through that by: 1) Device init 2) VIDIOC_STREAMON 3) VIDIOC_S_PARM 4) VIDIOC_S_FMT But only when the requested width + height + pixelformat is an unsupported combination, and it being a supported combination already gets enforced by a call to pwc_get_size in pwc_vidioc_try_fmt, which also gets called from pwc_s_fmt_vid_cap before it does anything else. So the ENOENT can only happen on some internal driver error, I'm open for suggestions for a better error code to return in this case. What I did notice is that pwc_vidioc_try_fmt returns EINVAL when an unsupported pixelformat is requested. IIRC we agreed that the correct behavior in this case is to instead just change the pixelformat to a default format, so I'll write a patch fixing this. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html