Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92492
b: refs/heads/master
c: 76e41e4
h: refs/heads/master
v: v3
  • Loading branch information
Marcin Slusarz authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 23e46ac commit 869af3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: b524f7b02d70204444441e4805fb3a71981e9018
refs/heads/master: 76e41e4851e0c8b642e348d8489d7645b8dae21e
14 changes: 8 additions & 6 deletions trunk/drivers/media/video/v4l1-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ pixelformat_to_palette(unsigned int pixelformat)

/* ----------------------------------------------------------------- */

static int poll_one(struct file *file)
static int poll_one(struct file *file, struct poll_wqueues *pwq)
{
int retval = 1;
poll_table *table;
struct poll_wqueues pwq; /*TODO: allocate dynamically*/

poll_initwait(&pwq);
table = &pwq.pt;
poll_initwait(pwq);
table = &pwq->pt;
for (;;) {
int mask;
set_current_state(TASK_INTERRUPTIBLE);
Expand All @@ -221,7 +220,7 @@ static int poll_one(struct file *file)
schedule();
}
set_current_state(TASK_RUNNING);
poll_freewait(&pwq);
poll_freewait(pwq);
return retval;
}

Expand Down Expand Up @@ -1068,6 +1067,7 @@ static noinline int v4l1_compat_sync(
int err;
enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
struct v4l2_buffer buf;
struct poll_wqueues *pwq;

memset(&buf, 0, sizeof(buf));
buf.index = *i;
Expand All @@ -1091,17 +1091,19 @@ static noinline int v4l1_compat_sync(
goto done;
}

pwq = kmalloc(sizeof(*pwq), GFP_KERNEL);
/* Loop as long as the buffer is queued, but not done */
while ((buf.flags & (V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE))
== V4L2_BUF_FLAG_QUEUED) {
err = poll_one(file);
err = poll_one(file, pwq);
if (err < 0 || /* error or sleep was interrupted */
err == 0) /* timeout? Shouldn't occur. */
break;
err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
if (err < 0)
dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
}
kfree(pwq);
if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
goto done;
do {
Expand Down

0 comments on commit 869af3f

Please sign in to comment.