diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-05-06 12:31:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 14:04:11 -0400 |
commit | a299e407b9ef356bf14fbb49793dc026877440df (patch) | |
tree | fa83baff4fe3ac75c801d6295cd3c2b0e08d2647 /drivers/media/common | |
parent | 7088f4df4c489811f6a5ad9a883b7dd259adfb6a (diff) |
[media] av7110: fix v4l2_compliance test issues
Besides the usual inconsistencies in input enumeration there was also a
kernel crash if you tried to poll on a vbi node. The checks for sliced
vbi output vs vbi capture were not complete enough.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/saa7146_fops.c | 4 | ||||
-rw-r--r-- | drivers/media/common/saa7146_video.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index 428a543ec2ce..7d42c11c8684 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c | |||
@@ -309,6 +309,8 @@ static int fops_mmap(struct file *file, struct vm_area_struct * vma) | |||
309 | case VFL_TYPE_VBI: { | 309 | case VFL_TYPE_VBI: { |
310 | DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, vma:%p\n", | 310 | DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, vma:%p\n", |
311 | file, vma); | 311 | file, vma); |
312 | if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT) | ||
313 | return -ENODEV; | ||
312 | q = &fh->vbi_q; | 314 | q = &fh->vbi_q; |
313 | break; | 315 | break; |
314 | } | 316 | } |
@@ -331,6 +333,8 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) | |||
331 | DEB_EE("file:%p, poll:%p\n", file, wait); | 333 | DEB_EE("file:%p, poll:%p\n", file, wait); |
332 | 334 | ||
333 | if (vdev->vfl_type == VFL_TYPE_VBI) { | 335 | if (vdev->vfl_type == VFL_TYPE_VBI) { |
336 | if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT) | ||
337 | return res | POLLOUT | POLLWRNORM; | ||
334 | if( 0 == fh->vbi_q.streaming ) | 338 | if( 0 == fh->vbi_q.streaming ) |
335 | return res | videobuf_poll_stream(file, &fh->vbi_q, wait); | 339 | return res | videobuf_poll_stream(file, &fh->vbi_q, wait); |
336 | q = &fh->vbi_q; | 340 | q = &fh->vbi_q; |
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index 9d193208b892..6d14785d4747 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c | |||
@@ -458,13 +458,13 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability * | |||
458 | V4L2_CAP_READWRITE | | 458 | V4L2_CAP_READWRITE | |
459 | V4L2_CAP_STREAMING; | 459 | V4L2_CAP_STREAMING; |
460 | cap->device_caps |= dev->ext_vv_data->capabilities; | 460 | cap->device_caps |= dev->ext_vv_data->capabilities; |
461 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; | ||
461 | if (vdev->vfl_type == VFL_TYPE_GRABBER) | 462 | if (vdev->vfl_type == VFL_TYPE_GRABBER) |
462 | cap->device_caps &= | 463 | cap->device_caps &= |
463 | ~(V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_OUTPUT); | 464 | ~(V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_OUTPUT); |
464 | else | 465 | else |
465 | cap->device_caps &= | 466 | cap->device_caps &= |
466 | ~(V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY); | 467 | ~(V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_AUDIO); |
467 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; | ||
468 | return 0; | 468 | return 0; |
469 | } | 469 | } |
470 | 470 | ||