summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2003-09-29 21:00:39 +0000
committerJohannes Stezenbach <devnull@localhost>2003-09-29 21:00:39 +0000
commit70256028c2bf9558289ee959ce8dd97cbadc33fb (patch)
tree82ba0c3ee92dbf707e06718c46fb23995fa7ea8b /linux/drivers/media
parentb890dd4f644a3eadc8adf030a52febc2eeb2b21c (diff)
downloadmediapointer-dvb-s2-70256028c2bf9558289ee959ce8dd97cbadc33fb.tar.gz
mediapointer-dvb-s2-70256028c2bf9558289ee959ce8dd97cbadc33fb.tar.bz2
fix VIDIOC_S_FBUF for v4l1 backward compatility with xfree86 / v4l_drv
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/common/saa7146_video.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index e0bf38f16..096310670 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -904,6 +904,8 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
{
struct v4l2_framebuffer *fb = arg;
struct saa7146_format *fmt;
+ struct saa7146_fh *ov_fh = NULL;
+ int restart_overlay = 0;
DEB_EE(("VIDIOC_S_FBUF\n"));
@@ -913,23 +915,34 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
return -EPERM;
}
*/
- if( 0 != vv->ov_data ) {
- DEB_D(("VIDIOC_S_FBUF: overlay is active.\n"));
- return -EPERM;
- }
/* check args */
fmt = format_by_fourcc(dev,fb->fmt.pixelformat);
if (NULL == fmt) {
return -EINVAL;
}
-
+
+ down(&dev->lock);
+
+ if( vv->ov_data != NULL ) {
+ ov_fh = vv->ov_data->fh;
+ saa7146_stop_preview(ov_fh);
+ restart_overlay = 1;
+ }
+
/* ok, accept it */
vv->ov_fb = *fb;
vv->ov_fmt = fmt;
if (0 == vv->ov_fb.fmt.bytesperline)
vv->ov_fb.fmt.bytesperline =
vv->ov_fb.fmt.width*fmt->depth/8;
+
+ if( 0 != restart_overlay ) {
+ saa7146_start_preview(ov_fh);
+ }
+
+ up(&dev->lock);
+
return 0;
}
case VIDIOC_ENUM_FMT: