diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-27 10:19:05 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-27 10:19:05 -0200 |
commit | bd66ade9cd6ebcb354b5dff70798ee3df7eb02c0 (patch) | |
tree | 25e0403b64e4e62cfb972fddf1b2e5c83920565a /linux/drivers | |
parent | e6cc6013f48d85e640660ad8017e735f025dfc6d (diff) | |
download | mediapointer-dvb-s2-bd66ade9cd6ebcb354b5dff70798ee3df7eb02c0.tar.gz mediapointer-dvb-s2-bd66ade9cd6ebcb354b5dff70798ee3df7eb02c0.tar.bz2 |
Fix some troubles at the previous patch
From: Mauro Carvalho Chehab <mchehab@infradead.org>
One test with vivi driver were comitted together by mistake;
The whitespace identation were wrong at the previous patch.
kernel-sync:
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/usbvision/usbvision-core.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/vivi.c | 23 |
2 files changed, 16 insertions, 9 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c index 5929bcd1b..07045f7a3 100644 --- a/linux/drivers/media/video/usbvision/usbvision-core.c +++ b/linux/drivers/media/video/usbvision/usbvision-core.c @@ -2391,7 +2391,7 @@ int usbvision_restart_isoc(struct usb_usbvision *usbvision) usbvision->Vin_Reg2_Preset)) < 0) return ret; /* TODO: schedule timeout */ - while ((usbvision_read_reg(usbvision, USBVISION_STATUS_REG) & 0x01) != 1); + while ((usbvision_read_reg(usbvision, USBVISION_STATUS_REG) & 0x01) != 1); return 0; } diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 6cfac3836..5370538bc 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -744,8 +744,8 @@ static void free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf) buf->vb.state = STATE_NEEDS_INIT; } -#define norm_maxw() 720 -#define norm_maxh() 480 +#define norm_maxw() 1024 +#define norm_maxh() 768 static int buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field) @@ -757,8 +757,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, // dprintk(1,"%s, field=%d\n",__FUNCTION__,field); BUG_ON(NULL == fh->fmt); - if (fh->width != norm_maxw() || - fh->height != norm_maxh()) + if (fh->width < 48 || fh->width > norm_maxw() || + fh->height < 32 || fh->height > norm_maxh()) return -EINVAL; buf->vb.size = fh->width*fh->height*2; if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size) @@ -1001,8 +1001,15 @@ static int vidioc_try_fmt_cap (struct file *file, void *priv, maxh = norm_maxh(); f->fmt.pix.field = field; - f->fmt.pix.height = maxh; - f->fmt.pix.width = maxw; + if (f->fmt.pix.height < 32) + f->fmt.pix.height = 32; + if (f->fmt.pix.height > maxh) + f->fmt.pix.height = maxh; + if (f->fmt.pix.width < 48) + f->fmt.pix.width = 48; + if (f->fmt.pix.width > maxw) + f->fmt.pix.width = maxw; + f->fmt.pix.width &= ~0x03; f->fmt.pix.bytesperline = (f->fmt.pix.width * fmt->depth) >> 3; f->fmt.pix.sizeimage = @@ -1249,8 +1256,8 @@ static int vivi_open(struct inode *inode, struct file *file) fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fh->fmt = &format; - fh->width = norm_maxw(); - fh->height = norm_maxh(); + fh->width = 640; + fh->height = 480; /* Put all controls at a sane state */ for (i = 0; i < ARRAY_SIZE(vivi_qctrl); i++) |