Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65959
b: refs/heads/master
c: 49ee718
h: refs/heads/master
i:
  65957: 43d8706
  65955: efc11a1
  65951: 1d0e594
v: v3
  • Loading branch information
Brandon Philips authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent 7d658ed commit dc44181
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 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: c726b65d079cafabc558616badbeead442e2b114
refs/heads/master: 49ee718ef51f4d938f80f67207e1bfa2a38897a4
2 changes: 2 additions & 0 deletions trunk/drivers/media/common/saa7146_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,8 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
mutex_unlock(&q->lock);
return err;
}

gbuffers = err;
memset(mbuf,0,sizeof(*mbuf));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3072,6 +3072,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
V4L2_MEMORY_MMAP);
if (retval < 0)
goto fh_unlock_and_return;

gbuffers = retval;
memset(mbuf,0,sizeof(*mbuf));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
Expand Down
18 changes: 13 additions & 5 deletions trunk/drivers/media/video/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ int videobuf_reqbufs(struct videobuf_queue *q,
goto done;
}

req->count = count;
req->count = retval;

done:
mutex_unlock(&q->lock);
Expand Down Expand Up @@ -698,7 +698,7 @@ int videobuf_read_start(struct videobuf_queue *q)
{
enum v4l2_field field;
unsigned long flags=0;
int count = 0, size = 0;
unsigned int count = 0, size = 0;
int err, i;

q->ops->buf_setup(q,&count,&size);
Expand All @@ -709,9 +709,11 @@ int videobuf_read_start(struct videobuf_queue *q)
size = PAGE_ALIGN(size);

err = videobuf_mmap_setup(q, count, size, V4L2_MEMORY_USERPTR);
if (err)
if (err < 0)
return err;

count = err;

for (i = 0; i < count; i++) {
field = videobuf_next_field(q);
err = q->ops->buf_prepare(q,q->bufs[i],field);
Expand Down Expand Up @@ -876,6 +878,9 @@ int videobuf_mmap_setup(struct videobuf_queue *q,
for (i = 0; i < bcount; i++) {
q->bufs[i] = videobuf_alloc(q);

if (q->bufs[i] == NULL)
break;

q->bufs[i]->i = i;
q->bufs[i]->input = UNSET;
q->bufs[i]->memory = memory;
Expand All @@ -891,10 +896,13 @@ int videobuf_mmap_setup(struct videobuf_queue *q,
}
}

if (!i)
return -ENOMEM;

dprintk(1,"mmap setup: %d buffers, %d bytes each\n",
bcount,bsize);
i, bsize);

return 0;
return i;
}

int videobuf_mmap_free(struct videobuf_queue *q)
Expand Down

0 comments on commit dc44181

Please sign in to comment.