Commit 7b9f31f3 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] sta2x11_vip: fix s_std

The s_std ioctl was broken in this driver, partially due to the
changes to the adv7180 driver (this affected the handling of
V4L2_STD_ALL) and partially because the new standard was never
stored in vip->std.

The handling of V4L2_STD_ALL has been rewritten to just call querystd
and the new standard is now stored correctly.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 937feeed
...@@ -444,27 +444,21 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -444,27 +444,21 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std) static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id std)
{ {
struct sta2x11_vip *vip = video_drvdata(file); struct sta2x11_vip *vip = video_drvdata(file);
v4l2_std_id oldstd = vip->std, newstd; v4l2_std_id oldstd = vip->std;
int status; int status;
if (V4L2_STD_ALL == std) { /*
v4l2_subdev_call(vip->decoder, video, s_std, std); * This is here for backwards compatibility only.
ssleep(2); * The use of V4L2_STD_ALL to trigger a querystd is non-standard.
v4l2_subdev_call(vip->decoder, video, querystd, &newstd); */
v4l2_subdev_call(vip->decoder, video, g_input_status, &status); if (std == V4L2_STD_ALL) {
if (status & V4L2_IN_ST_NO_SIGNAL) v4l2_subdev_call(vip->decoder, video, querystd, &std);
if (std == V4L2_STD_UNKNOWN)
return -EIO; return -EIO;
std = vip->std = newstd;
if (oldstd != std) {
if (V4L2_STD_525_60 & std)
vip->format = formats_60[0];
else
vip->format = formats_50[0];
}
return 0;
} }
if (oldstd != std) { if (vip->std != std) {
vip->std = std;
if (V4L2_STD_525_60 & std) if (V4L2_STD_525_60 & std)
vip->format = formats_60[0]; vip->format = formats_60[0];
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment