Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37393
b: refs/heads/master
c: 3702627
h: refs/heads/master
i:
  37391: 1c16ab0
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Sep 26, 2006
1 parent b8044a7 commit 400ac0c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a202a5bfb6c1d7c778f67f28b5f2caac21beafce
refs/heads/master: 3702627899db1d6a818c6e0b4ba5205f94bfbef4
8 changes: 8 additions & 0 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,14 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
fbuf->bytesperline = btv->fbuf.fmt.bytesperline;
if (fh->ovfmt)
fbuf->depth = fh->ovfmt->depth;
else {
if (fbuf->width)
fbuf->depth = ((fbuf->bytesperline<<3)
+ (fbuf->width-1) )
/fbuf->width;
else
fbuf->depth = 0;
}
return 0;
}
case VIDIOCSFBUF:
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/media/video/v4l1-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_buffer *buffer = arg;

memset(buffer, 0, sizeof(*buffer));

err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2);
if (err < 0) {
dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n",err);
Expand All @@ -361,7 +363,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
switch (fbuf2.fmt.pixelformat) {
case V4L2_PIX_FMT_RGB332:
buffer->depth = 8;
break;
break;
case V4L2_PIX_FMT_RGB555:
buffer->depth = 15;
break;
Expand All @@ -377,9 +379,13 @@ v4l_compat_translate_ioctl(struct inode *inode,
default:
buffer->depth = 0;
}
if (0 != fbuf2.fmt.bytesperline)
if (fbuf2.fmt.bytesperline) {
buffer->bytesperline = fbuf2.fmt.bytesperline;
else {
if (!buffer->depth && buffer->width)
buffer->depth = ((fbuf2.fmt.bytesperline<<3)
+ (buffer->width-1) )
/buffer->width;
} else {
buffer->bytesperline =
(buffer->width * buffer->depth + 7) & 7;
buffer->bytesperline >>= 3;
Expand Down

0 comments on commit 400ac0c

Please sign in to comment.