提交 13c72805 编写于 作者: M Michael H. Schimek 提交者: Linus Torvalds

[PATCH] V4L: Fixes Bttv raw format to fix VIDIOCSPICT ioctl

Fixes Bttv raw format to fix VIDIOCSPICT ioctl.
Signed-off-by: NMichael H. Schimek <mschimek@gmx.at>
Signed-off-by: NNickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: NMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 943a4902
......@@ -2290,6 +2290,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;
......
......@@ -816,6 +816,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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册