diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-14 23:10:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-14 23:10:00 -0400 |
commit | 4c0e176dd5e4c44dd60f398518f75eedbe1a65f3 (patch) | |
tree | 07aea7539f78f221c6fc535a94a07befa2afdb63 /drivers/media/video/bttv-driver.c | |
parent | f241be74b803dcf9d70c9978292946370654320f (diff) | |
parent | 2ba84684e8cf6f980e4e95a2300f53a505eb794e (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/media/video/bttv-driver.c')
-rw-r--r-- | drivers/media/video/bttv-driver.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 51a0f6d68e73..eee9322ce21b 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | $Id: bttv-driver.c,v 1.42 2005/07/05 17:37:35 nsh Exp $ | 2 | $Id: bttv-driver.c,v 1.52 2005/08/04 00:55:16 mchehab Exp $ |
3 | 3 | ||
4 | bttv - Bt848 frame grabber driver | 4 | bttv - Bt848 frame grabber driver |
5 | 5 | ||
@@ -80,6 +80,7 @@ static unsigned int irq_iswitch = 0; | |||
80 | static unsigned int uv_ratio = 50; | 80 | static unsigned int uv_ratio = 50; |
81 | static unsigned int full_luma_range = 0; | 81 | static unsigned int full_luma_range = 0; |
82 | static unsigned int coring = 0; | 82 | static unsigned int coring = 0; |
83 | extern int no_overlay; | ||
83 | 84 | ||
84 | /* API features (turn on/off stuff for testing) */ | 85 | /* API features (turn on/off stuff for testing) */ |
85 | static unsigned int v4l2 = 1; | 86 | static unsigned int v4l2 = 1; |
@@ -2151,6 +2152,10 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv, | |||
2151 | return 0; | 2152 | return 0; |
2152 | } | 2153 | } |
2153 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 2154 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
2155 | if (no_overlay > 0) { | ||
2156 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
2157 | return -EINVAL; | ||
2158 | } | ||
2154 | return setup_window(fh, btv, &f->fmt.win, 1); | 2159 | return setup_window(fh, btv, &f->fmt.win, 1); |
2155 | case V4L2_BUF_TYPE_VBI_CAPTURE: | 2160 | case V4L2_BUF_TYPE_VBI_CAPTURE: |
2156 | retval = bttv_switch_type(fh,f->type); | 2161 | retval = bttv_switch_type(fh,f->type); |
@@ -2224,9 +2229,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2224 | /* others */ | 2229 | /* others */ |
2225 | cap->type = VID_TYPE_CAPTURE| | 2230 | cap->type = VID_TYPE_CAPTURE| |
2226 | VID_TYPE_TUNER| | 2231 | VID_TYPE_TUNER| |
2227 | VID_TYPE_OVERLAY| | ||
2228 | VID_TYPE_CLIPPING| | 2232 | VID_TYPE_CLIPPING| |
2229 | VID_TYPE_SCALES; | 2233 | VID_TYPE_SCALES; |
2234 | if (no_overlay <= 0) | ||
2235 | cap->type |= VID_TYPE_OVERLAY; | ||
2236 | |||
2230 | cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth; | 2237 | cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth; |
2231 | cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight; | 2238 | cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight; |
2232 | cap->minwidth = 48; | 2239 | cap->minwidth = 48; |
@@ -2302,6 +2309,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2302 | struct video_window *win = arg; | 2309 | struct video_window *win = arg; |
2303 | struct v4l2_window w2; | 2310 | struct v4l2_window w2; |
2304 | 2311 | ||
2312 | if (no_overlay > 0) { | ||
2313 | printk ("VIDIOCSWIN: no_overlay\n"); | ||
2314 | return -EINVAL; | ||
2315 | } | ||
2316 | |||
2305 | w2.field = V4L2_FIELD_ANY; | 2317 | w2.field = V4L2_FIELD_ANY; |
2306 | w2.w.left = win->x; | 2318 | w2.w.left = win->x; |
2307 | w2.w.top = win->y; | 2319 | w2.w.top = win->y; |
@@ -2577,10 +2589,12 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2577 | cap->version = BTTV_VERSION_CODE; | 2589 | cap->version = BTTV_VERSION_CODE; |
2578 | cap->capabilities = | 2590 | cap->capabilities = |
2579 | V4L2_CAP_VIDEO_CAPTURE | | 2591 | V4L2_CAP_VIDEO_CAPTURE | |
2580 | V4L2_CAP_VIDEO_OVERLAY | | ||
2581 | V4L2_CAP_VBI_CAPTURE | | 2592 | V4L2_CAP_VBI_CAPTURE | |
2582 | V4L2_CAP_READWRITE | | 2593 | V4L2_CAP_READWRITE | |
2583 | V4L2_CAP_STREAMING; | 2594 | V4L2_CAP_STREAMING; |
2595 | if (no_overlay <= 0) | ||
2596 | cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY; | ||
2597 | |||
2584 | if (bttv_tvcards[btv->c.type].tuner != UNSET && | 2598 | if (bttv_tvcards[btv->c.type].tuner != UNSET && |
2585 | bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) | 2599 | bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) |
2586 | cap->capabilities |= V4L2_CAP_TUNER; | 2600 | cap->capabilities |= V4L2_CAP_TUNER; |
@@ -3076,7 +3090,7 @@ static struct file_operations bttv_fops = | |||
3076 | static struct video_device bttv_video_template = | 3090 | static struct video_device bttv_video_template = |
3077 | { | 3091 | { |
3078 | .name = "UNSET", | 3092 | .name = "UNSET", |
3079 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| | 3093 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| |
3080 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, | 3094 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, |
3081 | .hardware = VID_HARDWARE_BT848, | 3095 | .hardware = VID_HARDWARE_BT848, |
3082 | .fops = &bttv_fops, | 3096 | .fops = &bttv_fops, |
@@ -3756,6 +3770,12 @@ static void bttv_unregister_video(struct bttv *btv) | |||
3756 | /* register video4linux devices */ | 3770 | /* register video4linux devices */ |
3757 | static int __devinit bttv_register_video(struct bttv *btv) | 3771 | static int __devinit bttv_register_video(struct bttv *btv) |
3758 | { | 3772 | { |
3773 | if (no_overlay <= 0) { | ||
3774 | bttv_video_template.type |= VID_TYPE_OVERLAY; | ||
3775 | } else { | ||
3776 | printk("bttv: Overlay support disabled.\n"); | ||
3777 | } | ||
3778 | |||
3759 | /* video */ | 3779 | /* video */ |
3760 | btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); | 3780 | btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); |
3761 | if (NULL == btv->video_dev) | 3781 | if (NULL == btv->video_dev) |
@@ -3869,11 +3889,6 @@ static int __devinit bttv_probe(struct pci_dev *dev, | |||
3869 | pci_set_master(dev); | 3889 | pci_set_master(dev); |
3870 | pci_set_command(dev); | 3890 | pci_set_command(dev); |
3871 | pci_set_drvdata(dev,btv); | 3891 | pci_set_drvdata(dev,btv); |
3872 | if (!pci_dma_supported(dev,0xffffffff)) { | ||
3873 | printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->c.nr); | ||
3874 | result = -EIO; | ||
3875 | goto fail1; | ||
3876 | } | ||
3877 | 3892 | ||
3878 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); | 3893 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); |
3879 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); | 3894 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); |