From 2356e0a7e4bb7f34989f32c0fd94cca6e703eb31 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Thu, 24 Nov 2005 09:12:53 +0000 Subject: bttv raw format fix to fix VIDIOCSPICT ioctl. From: Michael H. Schimek * ../v4l/linux/drivers/media/video/bttv-driver.c: * ../v4l/linux/drivers/media/video/video-buf.c: bttv raw format fix to fix VIDIOCSPICT ioctl. Signed-off-by: Michael H. Schimek Signed-off-by: Nickolay V. Shmyrev --- linux/drivers/media/video/bttv-driver.c | 11 ++++++++++- linux/drivers/media/video/video-buf.c | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c index 68b8c339d..2940b9016 100644 --- a/linux/drivers/media/video/bttv-driver.c +++ b/linux/drivers/media/video/bttv-driver.c @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.71 2005/11/18 15:35:33 nsh Exp $ + $Id: bttv-driver.c,v 1.72 2005/11/24 09:12:53 nsh Exp $ bttv - Bt848 frame grabber driver @@ -2317,6 +2317,15 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, retval = -EINVAL; goto fh_unlock_and_return; } + if (fmt->flags & FORMAT_FLAGS_RAW) { + /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * + RAW_LINES * 2. F1 is stored at offset 0, F2 + at buffer size / 2. */ + fh->width = RAW_BPL; + fh->height = gbufsize / RAW_BPL; + btv->init.width = RAW_BPL; + btv->init.height = gbufsize / RAW_BPL; + } fh->ovfmt = fmt; fh->fmt = fmt; btv->init.ovfmt = fmt; diff --git a/linux/drivers/media/video/video-buf.c b/linux/drivers/media/video/video-buf.c index 6d082f3ef..27980d034 100644 --- a/linux/drivers/media/video/video-buf.c +++ b/linux/drivers/media/video/video-buf.c @@ -1,5 +1,5 @@ /* - * $Id: video-buf.c,v 1.22 2005/11/18 15:31:12 nsh Exp $ + * $Id: video-buf.c,v 1.23 2005/11/24 09:12:53 nsh Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -823,6 +823,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, if (NULL == q->read_buf) goto done; q->read_buf->memory = V4L2_MEMORY_USERPTR; + q->read_buf->bsize = count; /* preferred size */ field = videobuf_next_field(q); retval = q->ops->buf_prepare(q,q->read_buf,field); if (0 != retval) { -- cgit v1.2.3