From e2d71728bcc72b8dc1cb726c222756c14e113794 Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Tue, 31 Aug 2004 14:46:49 +0000 Subject: - cx88: make cx88_wakeup() work correctly after waking 2^16 buffers. --- linux/drivers/media/video/cx88/cx88-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index eaee42b9d..935234201 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -592,8 +592,16 @@ void cx88_wakeup(struct cx88_core *core, break; buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); +#if 0 if (buf->count > count) break; +#else + /* count comes from the hw and is is 16bit wide -- + * this trick is taken from the time_after() macro and + * hopefully handles wrap-arounds correctly ... */ + if ((s16)count - (s16)buf->count < 0) + break; +#endif do_gettimeofday(&buf->vb.ts); dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i, count, buf->count); -- cgit v1.2.3