diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-17 18:54:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 11:54:02 -0500 |
commit | ecb73774e5f5b5f635a70073086c3f57b4ca4ae6 (patch) | |
tree | d8313c4007896c78dfe05884a7740cb048ffd62a /drivers/media/video/saa7134/saa7134-video.c | |
parent | 08f1d0b99f4e2203935d86640a7fec5c233b777c (diff) |
V4L/DVB (3545): Fixed no_overlay option and quirks on saa7134 driver
Some chipsets have several problems when pci to pci transfers are activated
on overlay mode. the option no_overlay allows disabling such feature of
the driver, in favor of keeping the system stable.
The default is to use pcipci_fail flag defined on drivers/pci/quirks.c.
It also allows the user to override it by forcing disable overlay or forcing
enable. Forcing enable may generate PCI transfer corruption, including disk
mass corruption, so should be used with care.
Added a text description to this option and make messages looks the same at
both bttv and saa7134 drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 600c3c7e3dca..57a11e71d996 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1462,6 +1462,10 @@ static int saa7134_g_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, | |||
1462 | f->fmt.pix.height * f->fmt.pix.bytesperline; | 1462 | f->fmt.pix.height * f->fmt.pix.bytesperline; |
1463 | return 0; | 1463 | return 0; |
1464 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 1464 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
1465 | if (saa7134_no_overlay > 0) { | ||
1466 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
1467 | return -EINVAL; | ||
1468 | } | ||
1465 | f->fmt.win = fh->win; | 1469 | f->fmt.win = fh->win; |
1466 | return 0; | 1470 | return 0; |
1467 | case V4L2_BUF_TYPE_VBI_CAPTURE: | 1471 | case V4L2_BUF_TYPE_VBI_CAPTURE: |
@@ -1526,6 +1530,10 @@ static int saa7134_try_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, | |||
1526 | return 0; | 1530 | return 0; |
1527 | } | 1531 | } |
1528 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 1532 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
1533 | if (saa7134_no_overlay > 0) { | ||
1534 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
1535 | return -EINVAL; | ||
1536 | } | ||
1529 | err = verify_preview(dev,&f->fmt.win); | 1537 | err = verify_preview(dev,&f->fmt.win); |
1530 | if (0 != err) | 1538 | if (0 != err) |
1531 | return err; | 1539 | return err; |
@@ -1556,6 +1564,10 @@ static int saa7134_s_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, | |||
1556 | fh->cap.field = f->fmt.pix.field; | 1564 | fh->cap.field = f->fmt.pix.field; |
1557 | return 0; | 1565 | return 0; |
1558 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 1566 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
1567 | if (saa7134_no_overlay > 0) { | ||
1568 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
1569 | return -EINVAL; | ||
1570 | } | ||
1559 | err = verify_preview(dev,&f->fmt.win); | 1571 | err = verify_preview(dev,&f->fmt.win); |
1560 | if (0 != err) | 1572 | if (0 != err) |
1561 | return err; | 1573 | return err; |
@@ -1715,11 +1727,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1715 | cap->version = SAA7134_VERSION_CODE; | 1727 | cap->version = SAA7134_VERSION_CODE; |
1716 | cap->capabilities = | 1728 | cap->capabilities = |
1717 | V4L2_CAP_VIDEO_CAPTURE | | 1729 | V4L2_CAP_VIDEO_CAPTURE | |
1718 | V4L2_CAP_VIDEO_OVERLAY | | ||
1719 | V4L2_CAP_VBI_CAPTURE | | 1730 | V4L2_CAP_VBI_CAPTURE | |
1720 | V4L2_CAP_READWRITE | | 1731 | V4L2_CAP_READWRITE | |
1721 | V4L2_CAP_STREAMING | | 1732 | V4L2_CAP_STREAMING | |
1722 | V4L2_CAP_TUNER; | 1733 | V4L2_CAP_TUNER; |
1734 | if (saa7134_no_overlay <= 0) { | ||
1735 | cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY; | ||
1736 | } | ||
1723 | 1737 | ||
1724 | if ((tuner_type == TUNER_ABSENT) || (tuner_type == UNSET)) | 1738 | if ((tuner_type == TUNER_ABSENT) || (tuner_type == UNSET)) |
1725 | cap->capabilities &= ~V4L2_CAP_TUNER; | 1739 | cap->capabilities &= ~V4L2_CAP_TUNER; |
@@ -1970,6 +1984,10 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1970 | switch (type) { | 1984 | switch (type) { |
1971 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: | 1985 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: |
1972 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 1986 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
1987 | if (saa7134_no_overlay > 0) { | ||
1988 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
1989 | return -EINVAL; | ||
1990 | } | ||
1973 | if (index >= FORMATS) | 1991 | if (index >= FORMATS) |
1974 | return -EINVAL; | 1992 | return -EINVAL; |
1975 | if (f->type == V4L2_BUF_TYPE_VIDEO_OVERLAY && | 1993 | if (f->type == V4L2_BUF_TYPE_VIDEO_OVERLAY && |
@@ -2030,6 +2048,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
2030 | int *on = arg; | 2048 | int *on = arg; |
2031 | 2049 | ||
2032 | if (*on) { | 2050 | if (*on) { |
2051 | if (saa7134_no_overlay > 0) { | ||
2052 | printk ("no_overlay\n"); | ||
2053 | return -EINVAL; | ||
2054 | } | ||
2055 | |||
2033 | if (!res_get(dev,fh,RESOURCE_OVERLAY)) | 2056 | if (!res_get(dev,fh,RESOURCE_OVERLAY)) |
2034 | return -EBUSY; | 2057 | return -EBUSY; |
2035 | spin_lock_irqsave(&dev->slock,flags); | 2058 | spin_lock_irqsave(&dev->slock,flags); |
@@ -2281,7 +2304,7 @@ static struct file_operations radio_fops = | |||
2281 | struct video_device saa7134_video_template = | 2304 | struct video_device saa7134_video_template = |
2282 | { | 2305 | { |
2283 | .name = "saa7134-video", | 2306 | .name = "saa7134-video", |
2284 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| | 2307 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| |
2285 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, | 2308 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, |
2286 | .hardware = 0, | 2309 | .hardware = 0, |
2287 | .fops = &video_fops, | 2310 | .fops = &video_fops, |