V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_

s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g
s/STATE_PREPARED/VIDEOBUF_PREPARED/g
s/STATE_QUEUED/VIDEOBUF_QUEUED/g
s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g
s/STATE_DONE/VIDEOBUF_DONE/g
s/STATE_ERROR/VIDEOBUF_ERROR/g
s/STATE_IDLE/VIDEOBUF_IDLE/g

Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Brandon Philips 2007-11-06 20:02:36 -03:00 committed by Mauro Carvalho Chehab
parent 1414becf15
commit 0fc0686e64
20 changed files with 134 additions and 134 deletions

View File

@ -61,7 +61,7 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q,
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_unmap(q, dma); videobuf_dma_unmap(q, dma);
videobuf_dma_free(dma); videobuf_dma_free(dma);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
@ -83,7 +83,7 @@ int saa7146_buffer_queue(struct saa7146_dev *dev,
buf->activate(dev,buf,NULL); buf->activate(dev,buf,NULL);
} else { } else {
list_add_tail(&buf->vb.queue,&q->queue); list_add_tail(&buf->vb.queue,&q->queue);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
DEB_D(("adding buffer %p to queue. (active buffer present)\n", buf)); DEB_D(("adding buffer %p to queue. (active buffer present)\n", buf));
} }
return 0; return 0;
@ -174,7 +174,7 @@ void saa7146_buffer_timeout(unsigned long data)
spin_lock_irqsave(&dev->slock,flags); spin_lock_irqsave(&dev->slock,flags);
if (q->curr) { if (q->curr) {
DEB_D(("timeout on %p\n", q->curr)); DEB_D(("timeout on %p\n", q->curr));
saa7146_buffer_finish(dev,q,STATE_ERROR); saa7146_buffer_finish(dev,q,VIDEOBUF_ERROR);
} }
/* we don't restart the transfer here like other drivers do. when /* we don't restart the transfer here like other drivers do. when
@ -366,7 +366,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
} }
poll_wait(file, &buf->done, wait); poll_wait(file, &buf->done, wait);
if (buf->state == STATE_DONE || buf->state == STATE_ERROR) { if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) {
DEB_D(("poll succeeded!\n")); DEB_D(("poll succeeded!\n"));
return POLLIN|POLLRDNORM; return POLLIN|POLLRDNORM;
} }

View File

@ -205,7 +205,7 @@ static int buffer_activate(struct saa7146_dev *dev,
struct saa7146_buf *next) struct saa7146_buf *next)
{ {
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
DEB_VBI(("dev:%p, buf:%p, next:%p\n",dev,buf,next)); DEB_VBI(("dev:%p, buf:%p, next:%p\n",dev,buf,next));
saa7146_set_vbi_capture(dev,buf,next); saa7146_set_vbi_capture(dev,buf,next);
@ -238,7 +238,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
if (buf->vb.size != size) if (buf->vb.size != size)
saa7146_dma_free(dev,q,buf); saa7146_dma_free(dev,q,buf);
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
buf->vb.width = llength; buf->vb.width = llength;
@ -257,7 +257,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
if (0 != err) if (0 != err)
return err; return err;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->activate = buffer_activate; buf->activate = buffer_activate;
return 0; return 0;
@ -335,7 +335,7 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file)
saa7146_write(dev, MC1, MASK_20); saa7146_write(dev, MC1, MASK_20);
if (vv->vbi_q.curr) { if (vv->vbi_q.curr) {
saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE);
} }
videobuf_queue_cancel(&fh->vbi_q); videobuf_queue_cancel(&fh->vbi_q);
@ -458,7 +458,7 @@ static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status)
/* this must be += 2, one count for each field */ /* this must be += 2, one count for each field */
vv->vbi_fieldcount+=2; vv->vbi_fieldcount+=2;
vv->vbi_q.curr->vb.field_count = vv->vbi_fieldcount; vv->vbi_q.curr->vb.field_count = vv->vbi_fieldcount;
saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE);
} else { } else {
DEB_VBI(("dev:%p\n",dev)); DEB_VBI(("dev:%p\n",dev));
} }

View File

@ -1235,7 +1235,7 @@ static int buffer_activate (struct saa7146_dev *dev,
{ {
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
saa7146_set_capture(dev,buf,next); saa7146_set_capture(dev,buf,next);
mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT);
@ -1281,7 +1281,7 @@ static int buffer_prepare(struct videobuf_queue *q,
saa7146_dma_free(dev,q,buf); saa7146_dma_free(dev,q,buf);
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct saa7146_format *sfmt; struct saa7146_format *sfmt;
buf->vb.bytesperline = fh->video_fmt.bytesperline; buf->vb.bytesperline = fh->video_fmt.bytesperline;
@ -1314,7 +1314,7 @@ static int buffer_prepare(struct videobuf_queue *q,
if (err) if (err)
goto oops; goto oops;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->activate = buffer_activate; buf->activate = buffer_activate;
return 0; return 0;
@ -1453,7 +1453,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st)
/* only finish the buffer if we have one... */ /* only finish the buffer if we have one... */
if( NULL != q->curr ) { if( NULL != q->curr ) {
saa7146_buffer_finish(dev,q,STATE_DONE); saa7146_buffer_finish(dev,q,VIDEOBUF_DONE);
} }
saa7146_buffer_next(dev,q,0); saa7146_buffer_next(dev,q,0);

View File

@ -1638,7 +1638,7 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
dprintk("switch_overlay: enter [new=%p]\n",new); dprintk("switch_overlay: enter [new=%p]\n",new);
if (new) if (new)
new->vb.state = STATE_DONE; new->vb.state = VIDEOBUF_DONE;
spin_lock_irqsave(&btv->s_lock,flags); spin_lock_irqsave(&btv->s_lock,flags);
old = btv->screen; old = btv->screen;
btv->screen = new; btv->screen = new;
@ -1749,7 +1749,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
} }
/* alloc risc memory */ /* alloc risc memory */
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
redo_dma_risc = 1; redo_dma_risc = 1;
if (0 != (rc = videobuf_iolock(q,&buf->vb,&btv->fbuf))) if (0 != (rc = videobuf_iolock(q,&buf->vb,&btv->fbuf)))
goto fail; goto fail;
@ -1759,7 +1759,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
if (0 != (rc = bttv_buffer_risc(btv,buf))) if (0 != (rc = bttv_buffer_risc(btv,buf)))
goto fail; goto fail;
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
fail: fail:
@ -1798,7 +1798,7 @@ buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
struct bttv_fh *fh = q->priv_data; struct bttv_fh *fh = q->priv_data;
struct bttv *btv = fh->btv; struct bttv *btv = fh->btv;
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
list_add_tail(&buf->vb.queue,&btv->capture); list_add_tail(&buf->vb.queue,&btv->capture);
if (!btv->curr.frame_irq) { if (!btv->curr.frame_irq) {
btv->loop_irq |= 1; btv->loop_irq |= 1;
@ -3102,8 +3102,8 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
} }
poll_wait(file, &buf->vb.done, wait); poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == STATE_DONE || if (buf->vb.state == VIDEOBUF_DONE ||
buf->vb.state == STATE_ERROR) buf->vb.state == VIDEOBUF_ERROR)
return POLLIN|POLLRDNORM; return POLLIN|POLLRDNORM;
return 0; return 0;
} }
@ -3699,20 +3699,20 @@ static void bttv_irq_timeout(unsigned long data)
bttv_set_dma(btv, 0); bttv_set_dma(btv, 0);
/* wake up */ /* wake up */
bttv_irq_wakeup_video(btv, &old, &new, STATE_ERROR); bttv_irq_wakeup_video(btv, &old, &new, VIDEOBUF_ERROR);
bttv_irq_wakeup_vbi(btv, ovbi, STATE_ERROR); bttv_irq_wakeup_vbi(btv, ovbi, VIDEOBUF_ERROR);
/* cancel all outstanding capture / vbi requests */ /* cancel all outstanding capture / vbi requests */
while (!list_empty(&btv->capture)) { while (!list_empty(&btv->capture)) {
item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue); item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue); list_del(&item->vb.queue);
item->vb.state = STATE_ERROR; item->vb.state = VIDEOBUF_ERROR;
wake_up(&item->vb.done); wake_up(&item->vb.done);
} }
while (!list_empty(&btv->vcapture)) { while (!list_empty(&btv->vcapture)) {
item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue); item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue); list_del(&item->vb.queue);
item->vb.state = STATE_ERROR; item->vb.state = VIDEOBUF_ERROR;
wake_up(&item->vb.done); wake_up(&item->vb.done);
} }
@ -3735,7 +3735,7 @@ bttv_irq_wakeup_top(struct bttv *btv)
do_gettimeofday(&wakeup->vb.ts); do_gettimeofday(&wakeup->vb.ts);
wakeup->vb.field_count = btv->field_count; wakeup->vb.field_count = btv->field_count;
wakeup->vb.state = STATE_DONE; wakeup->vb.state = VIDEOBUF_DONE;
wake_up(&wakeup->vb.done); wake_up(&wakeup->vb.done);
spin_unlock(&btv->s_lock); spin_unlock(&btv->s_lock);
} }
@ -3784,7 +3784,7 @@ bttv_irq_switch_video(struct bttv *btv)
} }
/* wake up finished buffers */ /* wake up finished buffers */
bttv_irq_wakeup_video(btv, &old, &new, STATE_DONE); bttv_irq_wakeup_video(btv, &old, &new, VIDEOBUF_DONE);
spin_unlock(&btv->s_lock); spin_unlock(&btv->s_lock);
} }
@ -3817,7 +3817,7 @@ bttv_irq_switch_vbi(struct bttv *btv)
bttv_buffer_activate_vbi(btv, new); bttv_buffer_activate_vbi(btv, new);
bttv_set_dma(btv, 0); bttv_set_dma(btv, 0);
bttv_irq_wakeup_vbi(btv, old, STATE_DONE); bttv_irq_wakeup_vbi(btv, old, VIDEOBUF_DONE);
spin_unlock(&btv->s_lock); spin_unlock(&btv->s_lock);
} }

View File

@ -582,7 +582,7 @@ bttv_dma_free(struct videobuf_queue *q,struct bttv *btv, struct bttv_buffer *buf
videobuf_dma_free(dma); videobuf_dma_free(dma);
btcx_riscmem_free(btv->c.pci,&buf->bottom); btcx_riscmem_free(btv->c.pci,&buf->bottom);
btcx_riscmem_free(btv->c.pci,&buf->top); btcx_riscmem_free(btv->c.pci,&buf->top);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
int int
@ -602,7 +602,7 @@ bttv_buffer_activate_vbi(struct bttv *btv,
if (vbi) { if (vbi) {
unsigned int crop, vdelay; unsigned int crop, vdelay;
vbi->vb.state = STATE_ACTIVE; vbi->vb.state = VIDEOBUF_ACTIVE;
list_del(&vbi->vb.queue); list_del(&vbi->vb.queue);
/* VDELAY is start of video, end of VBI capturing. */ /* VDELAY is start of video, end of VBI capturing. */
@ -644,12 +644,12 @@ bttv_buffer_activate_video(struct bttv *btv,
/* video capture */ /* video capture */
if (NULL != set->top && NULL != set->bottom) { if (NULL != set->top && NULL != set->bottom) {
if (set->top == set->bottom) { if (set->top == set->bottom) {
set->top->vb.state = STATE_ACTIVE; set->top->vb.state = VIDEOBUF_ACTIVE;
if (set->top->vb.queue.next) if (set->top->vb.queue.next)
list_del(&set->top->vb.queue); list_del(&set->top->vb.queue);
} else { } else {
set->top->vb.state = STATE_ACTIVE; set->top->vb.state = VIDEOBUF_ACTIVE;
set->bottom->vb.state = STATE_ACTIVE; set->bottom->vb.state = VIDEOBUF_ACTIVE;
if (set->top->vb.queue.next) if (set->top->vb.queue.next)
list_del(&set->top->vb.queue); list_del(&set->top->vb.queue);
if (set->bottom->vb.queue.next) if (set->bottom->vb.queue.next)
@ -666,7 +666,7 @@ bttv_buffer_activate_video(struct bttv *btv,
btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05), btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05),
~0x0f, BT848_COLOR_CTL); ~0x0f, BT848_COLOR_CTL);
} else if (NULL != set->top) { } else if (NULL != set->top) {
set->top->vb.state = STATE_ACTIVE; set->top->vb.state = VIDEOBUF_ACTIVE;
if (set->top->vb.queue.next) if (set->top->vb.queue.next)
list_del(&set->top->vb.queue); list_del(&set->top->vb.queue);
bttv_apply_geo(btv, &set->top->geo,1); bttv_apply_geo(btv, &set->top->geo,1);
@ -677,7 +677,7 @@ bttv_buffer_activate_video(struct bttv *btv,
btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT); btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT);
btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL);
} else if (NULL != set->bottom) { } else if (NULL != set->bottom) {
set->bottom->vb.state = STATE_ACTIVE; set->bottom->vb.state = VIDEOBUF_ACTIVE;
if (set->bottom->vb.queue.next) if (set->bottom->vb.queue.next)
list_del(&set->bottom->vb.queue); list_del(&set->bottom->vb.queue);
bttv_apply_geo(btv, &set->bottom->geo,1); bttv_apply_geo(btv, &set->bottom->geo,1);

View File

@ -142,7 +142,7 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
redo_dma_risc = 1; redo_dma_risc = 1;
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
redo_dma_risc = 1; redo_dma_risc = 1;
if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL))) if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL)))
goto fail; goto fail;
@ -189,7 +189,7 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
/* For bttv_buffer_activate_vbi(). */ /* For bttv_buffer_activate_vbi(). */
buf->geo.vdelay = min_vdelay; buf->geo.vdelay = min_vdelay;
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->vb.field = field; buf->vb.field = field;
dprintk("buf prepare %p: top=%p bottom=%p field=%s\n", dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
vb, &buf->top, &buf->bottom, vb, &buf->top, &buf->bottom,
@ -209,7 +209,7 @@ vbi_buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
dprintk("queue %p\n",vb); dprintk("queue %p\n",vb);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
list_add_tail(&buf->vb.queue,&btv->vcapture); list_add_tail(&buf->vb.queue,&btv->vcapture);
if (NULL == btv->cvbi) { if (NULL == btv->cvbi) {
fh->btv->loop_irq |= 4; fh->btv->loop_irq |= 4;

View File

@ -378,7 +378,7 @@ static void cx23885_wakeup(struct cx23885_tsport *port,
do_gettimeofday(&buf->vb.ts); do_gettimeofday(&buf->vb.ts);
dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i, dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i,
count, buf->count); count, buf->count);
buf->vb.state = STATE_DONE; buf->vb.state = VIDEOBUF_DONE;
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
} }
@ -972,7 +972,7 @@ void cx23885_free_buffer(struct videobuf_queue *q, struct cx23885_buffer *buf)
videobuf_dma_unmap(q, dma); videobuf_dma_unmap(q, dma);
videobuf_dma_free(dma); videobuf_dma_free(dma);
btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc); btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
static int cx23885_start_dma(struct cx23885_tsport *port, static int cx23885_start_dma(struct cx23885_tsport *port,
@ -1075,7 +1075,7 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
list_add_tail(&buf->vb.queue, &q->active); list_add_tail(&buf->vb.queue, &q->active);
cx23885_start_dma(port, q, buf); cx23885_start_dma(port, q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(5, "[%p/%d] restart_queue - first active\n", dprintk(5, "[%p/%d] restart_queue - first active\n",
@ -1086,7 +1086,7 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
list_add_tail(&buf->vb.queue, &q->active); list_add_tail(&buf->vb.queue, &q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */ prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */
@ -1123,7 +1123,7 @@ int cx23885_buf_prepare(struct videobuf_queue *q, struct cx23885_tsport *port,
if (0 != buf->vb.baddr && buf->vb.bsize < size) if (0 != buf->vb.baddr && buf->vb.bsize < size)
return -EINVAL; return -EINVAL;
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
buf->vb.width = port->ts_packet_size; buf->vb.width = port->ts_packet_size;
buf->vb.height = port->ts_packet_count; buf->vb.height = port->ts_packet_count;
buf->vb.size = size; buf->vb.size = size;
@ -1135,7 +1135,7 @@ int cx23885_buf_prepare(struct videobuf_queue *q, struct cx23885_tsport *port,
videobuf_to_dma(&buf->vb)->sglist, videobuf_to_dma(&buf->vb)->sglist,
buf->vb.width, buf->vb.height); buf->vb.width, buf->vb.height);
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
fail: fail:
@ -1158,7 +1158,7 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf)
dprintk( 1, "queue is empty - first active\n" ); dprintk( 1, "queue is empty - first active\n" );
list_add_tail(&buf->vb.queue, &cx88q->active); list_add_tail(&buf->vb.queue, &cx88q->active);
cx23885_start_dma(port, cx88q, buf); cx23885_start_dma(port, cx88q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = cx88q->count++; buf->count = cx88q->count++;
mod_timer(&cx88q->timeout, jiffies + BUFFER_TIMEOUT); mod_timer(&cx88q->timeout, jiffies + BUFFER_TIMEOUT);
dprintk(1, "[%p/%d] %s - first active\n", dprintk(1, "[%p/%d] %s - first active\n",
@ -1168,7 +1168,7 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf)
prev = list_entry(cx88q->active.prev, struct cx23885_buffer, prev = list_entry(cx88q->active.prev, struct cx23885_buffer,
vb.queue); vb.queue);
list_add_tail(&buf->vb.queue, &cx88q->active); list_add_tail(&buf->vb.queue, &cx88q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = cx88q->count++; buf->count = cx88q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */ prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */
@ -1192,7 +1192,7 @@ static void do_cancel_buffers(struct cx23885_tsport *port, char *reason,
buf = list_entry(q->active.next, struct cx23885_buffer, buf = list_entry(q->active.next, struct cx23885_buffer,
vb.queue); vb.queue);
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
dprintk(1, "[%p/%d] %s - dma=0x%08lx\n", dprintk(1, "[%p/%d] %s - dma=0x%08lx\n",
buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);

View File

@ -417,7 +417,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC); buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC);
buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma); buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
chip->buf = buf; chip->buf = buf;
chip->dma_risc = dma; chip->dma_risc = dma;

View File

@ -220,7 +220,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf)
videobuf_dma_unmap(q, dma); videobuf_dma_unmap(q, dma);
videobuf_dma_free(dma); videobuf_dma_free(dma);
btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc); btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
@ -538,7 +538,7 @@ void cx88_wakeup(struct cx88_core *core,
do_gettimeofday(&buf->vb.ts); do_gettimeofday(&buf->vb.ts);
dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i, dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i,
count, buf->count); count, buf->count);
buf->vb.state = STATE_DONE; buf->vb.state = VIDEOBUF_DONE;
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
} }

View File

@ -195,7 +195,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
cx8802_start_dma(dev, q, buf); cx8802_start_dma(dev, q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(1,"[%p/%d] restart_queue - first active\n", dprintk(1,"[%p/%d] restart_queue - first active\n",
@ -206,7 +206,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
dprintk(1,"[%p/%d] restart_queue - move to active\n", dprintk(1,"[%p/%d] restart_queue - move to active\n",
@ -242,7 +242,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
if (0 != buf->vb.baddr && buf->vb.bsize < size) if (0 != buf->vb.baddr && buf->vb.bsize < size)
return -EINVAL; return -EINVAL;
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
buf->vb.width = dev->ts_packet_size; buf->vb.width = dev->ts_packet_size;
buf->vb.height = dev->ts_packet_count; buf->vb.height = dev->ts_packet_count;
buf->vb.size = size; buf->vb.size = size;
@ -254,7 +254,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
dma->sglist, dma->sglist,
buf->vb.width, buf->vb.height, 0); buf->vb.width, buf->vb.height, 0);
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
fail: fail:
@ -276,7 +276,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
dprintk( 1, "queue is empty - first active\n" ); dprintk( 1, "queue is empty - first active\n" );
list_add_tail(&buf->vb.queue,&cx88q->active); list_add_tail(&buf->vb.queue,&cx88q->active);
cx8802_start_dma(dev, cx88q, buf); cx8802_start_dma(dev, cx88q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = cx88q->count++; buf->count = cx88q->count++;
mod_timer(&cx88q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&cx88q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(1,"[%p/%d] %s - first active\n", dprintk(1,"[%p/%d] %s - first active\n",
@ -286,7 +286,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
dprintk( 1, "queue is not empty - append to active\n" ); dprintk( 1, "queue is not empty - append to active\n" );
prev = list_entry(cx88q->active.prev, struct cx88_buffer, vb.queue); prev = list_entry(cx88q->active.prev, struct cx88_buffer, vb.queue);
list_add_tail(&buf->vb.queue,&cx88q->active); list_add_tail(&buf->vb.queue,&cx88q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = cx88q->count++; buf->count = cx88q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
dprintk( 1, "[%p/%d] %s - append to active\n", dprintk( 1, "[%p/%d] %s - append to active\n",
@ -306,7 +306,7 @@ static void do_cancel_buffers(struct cx8802_dev *dev, char *reason, int restart)
while (!list_empty(&q->active)) { while (!list_empty(&q->active)) {
buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
dprintk(1,"[%p/%d] %s - dma=0x%08lx\n", dprintk(1,"[%p/%d] %s - dma=0x%08lx\n",
buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);

View File

@ -130,7 +130,7 @@ void cx8800_vbi_timeout(unsigned long data)
while (!list_empty(&q->active)) { while (!list_empty(&q->active)) {
buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", dev->core->name, printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", dev->core->name,
buf, buf->vb.i, (unsigned long)buf->risc.dma); buf, buf->vb.i, (unsigned long)buf->risc.dma);
@ -168,7 +168,7 @@ vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
if (0 != buf->vb.baddr && buf->vb.bsize < size) if (0 != buf->vb.baddr && buf->vb.bsize < size)
return -EINVAL; return -EINVAL;
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
buf->vb.width = VBI_LINE_LENGTH; buf->vb.width = VBI_LINE_LENGTH;
buf->vb.height = VBI_LINE_COUNT; buf->vb.height = VBI_LINE_COUNT;
@ -183,7 +183,7 @@ vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
buf->vb.width, 0, buf->vb.width, 0,
buf->vb.height); buf->vb.height);
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
fail: fail:
@ -207,7 +207,7 @@ vbi_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
if (list_empty(&q->active)) { if (list_empty(&q->active)) {
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
cx8800_start_vbi_dma(dev, q, buf); cx8800_start_vbi_dma(dev, q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2,"[%p/%d] vbi_queue - first active\n", dprintk(2,"[%p/%d] vbi_queue - first active\n",
@ -216,7 +216,7 @@ vbi_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
} else { } else {
prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue);
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
dprintk(2,"[%p/%d] buffer_queue - append to active\n", dprintk(2,"[%p/%d] buffer_queue - append to active\n",

View File

@ -486,7 +486,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
if (NULL == prev) { if (NULL == prev) {
list_move_tail(&buf->vb.queue, &q->active); list_move_tail(&buf->vb.queue, &q->active);
start_video_dma(dev, q, buf); start_video_dma(dev, q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2,"[%p/%d] restart_queue - first active\n", dprintk(2,"[%p/%d] restart_queue - first active\n",
@ -496,7 +496,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
prev->vb.height == buf->vb.height && prev->vb.height == buf->vb.height &&
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_move_tail(&buf->vb.queue, &q->active); list_move_tail(&buf->vb.queue, &q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
dprintk(2,"[%p/%d] restart_queue - move to active\n", dprintk(2,"[%p/%d] restart_queue - move to active\n",
@ -553,7 +553,7 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
init_buffer = 1; init_buffer = 1;
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
init_buffer = 1; init_buffer = 1;
if (0 != (rc = videobuf_iolock(q,&buf->vb,NULL))) if (0 != (rc = videobuf_iolock(q,&buf->vb,NULL)))
goto fail; goto fail;
@ -601,7 +601,7 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
fh->width, fh->height, fh->fmt->depth, fh->fmt->name, fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
(unsigned long)buf->risc.dma); (unsigned long)buf->risc.dma);
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
fail: fail:
@ -625,14 +625,14 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
if (!list_empty(&q->queued)) { if (!list_empty(&q->queued)) {
list_add_tail(&buf->vb.queue,&q->queued); list_add_tail(&buf->vb.queue,&q->queued);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2,"[%p/%d] buffer_queue - append to queued\n", dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
buf, buf->vb.i); buf, buf->vb.i);
} else if (list_empty(&q->active)) { } else if (list_empty(&q->active)) {
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
start_video_dma(dev, q, buf); start_video_dma(dev, q, buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2,"[%p/%d] buffer_queue - first active\n", dprintk(2,"[%p/%d] buffer_queue - first active\n",
@ -644,7 +644,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
prev->vb.height == buf->vb.height && prev->vb.height == buf->vb.height &&
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_add_tail(&buf->vb.queue,&q->active); list_add_tail(&buf->vb.queue,&q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->count = q->count++; buf->count = q->count++;
prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
dprintk(2,"[%p/%d] buffer_queue - append to active\n", dprintk(2,"[%p/%d] buffer_queue - append to active\n",
@ -652,7 +652,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
} else { } else {
list_add_tail(&buf->vb.queue,&q->queued); list_add_tail(&buf->vb.queue,&q->queued);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2,"[%p/%d] buffer_queue - first queued\n", dprintk(2,"[%p/%d] buffer_queue - first queued\n",
buf, buf->vb.i); buf, buf->vb.i);
} }
@ -822,8 +822,8 @@ video_poll(struct file *file, struct poll_table_struct *wait)
return POLLERR; return POLLERR;
} }
poll_wait(file, &buf->vb.done, wait); poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == STATE_DONE || if (buf->vb.state == VIDEOBUF_DONE ||
buf->vb.state == STATE_ERROR) buf->vb.state == VIDEOBUF_ERROR)
return POLLIN|POLLRDNORM; return POLLIN|POLLRDNORM;
return 0; return 0;
} }
@ -1496,7 +1496,7 @@ static void cx8800_vid_timeout(unsigned long data)
while (!list_empty(&q->active)) { while (!list_empty(&q->active)) {
buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", core->name, printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", core->name,
buf, buf->vb.i, (unsigned long)buf->risc.dma); buf, buf->vb.i, (unsigned long)buf->risc.dma);

View File

@ -294,7 +294,7 @@ void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf)
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_unmap(q, dma); videobuf_dma_unmap(q, dma);
videobuf_dma_free(dma); videobuf_dma_free(dma);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
@ -313,7 +313,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev,
buf->activate(dev,buf,NULL); buf->activate(dev,buf,NULL);
} else if (list_empty(&q->queue)) { } else if (list_empty(&q->queue)) {
list_add_tail(&buf->vb.queue,&q->queue); list_add_tail(&buf->vb.queue,&q->queue);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
} else { } else {
next = list_entry(q->queue.next,struct saa7134_buf, next = list_entry(q->queue.next,struct saa7134_buf,
vb.queue); vb.queue);
@ -322,7 +322,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev,
} }
} else { } else {
list_add_tail(&buf->vb.queue,&q->queue); list_add_tail(&buf->vb.queue,&q->queue);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
} }
return 0; return 0;
} }
@ -387,7 +387,7 @@ void saa7134_buffer_timeout(unsigned long data)
try to start over with the next one. */ try to start over with the next one. */
if (q->curr) { if (q->curr) {
dprintk("timeout on %p\n",q->curr); dprintk("timeout on %p\n",q->curr);
saa7134_buffer_finish(dev,q,STATE_ERROR); saa7134_buffer_finish(dev,q,VIDEOBUF_ERROR);
} }
saa7134_buffer_next(dev,q); saa7134_buffer_next(dev,q);
spin_unlock_irqrestore(&dev->slock,flags); spin_unlock_irqrestore(&dev->slock,flags);

View File

@ -47,7 +47,7 @@ static int buffer_activate(struct saa7134_dev *dev,
{ {
dprintk("buffer_activate [%p]",buf); dprintk("buffer_activate [%p]",buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->top_seen = 0; buf->top_seen = 0;
if (NULL == next) if (NULL == next)
@ -91,7 +91,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
saa7134_dma_free(q,buf); saa7134_dma_free(q,buf);
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
buf->vb.width = llength; buf->vb.width = llength;
@ -121,7 +121,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
saa_writel(SAA7134_RS_PITCH(5),TS_PACKET_SIZE); saa_writel(SAA7134_RS_PITCH(5),TS_PACKET_SIZE);
saa_writel(SAA7134_RS_CONTROL(5),control); saa_writel(SAA7134_RS_CONTROL(5),control);
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->activate = buffer_activate; buf->activate = buffer_activate;
buf->vb.field = field; buf->vb.field = field;
return 0; return 0;
@ -242,7 +242,7 @@ void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status)
if ((status & 0x100000) != 0x100000) if ((status & 0x100000) != 0x100000)
goto done; goto done;
} }
saa7134_buffer_finish(dev,&dev->ts_q,STATE_DONE); saa7134_buffer_finish(dev,&dev->ts_q,VIDEOBUF_DONE);
} }
saa7134_buffer_next(dev,&dev->ts_q); saa7134_buffer_next(dev,&dev->ts_q);

View File

@ -85,7 +85,7 @@ static int buffer_activate(struct saa7134_dev *dev,
unsigned long control,base; unsigned long control,base;
dprintk("buffer_activate [%p]\n",buf); dprintk("buffer_activate [%p]\n",buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->top_seen = 0; buf->top_seen = 0;
task_init(dev,buf,TASK_A); task_init(dev,buf,TASK_A);
@ -136,7 +136,7 @@ static int buffer_prepare(struct videobuf_queue *q,
if (buf->vb.size != size) if (buf->vb.size != size)
saa7134_dma_free(q,buf); saa7134_dma_free(q,buf);
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
buf->vb.width = llength; buf->vb.width = llength;
@ -154,7 +154,7 @@ static int buffer_prepare(struct videobuf_queue *q,
if (err) if (err)
goto oops; goto oops;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->activate = buffer_activate; buf->activate = buffer_activate;
buf->vb.field = field; buf->vb.field = field;
return 0; return 0;
@ -240,7 +240,7 @@ void saa7134_irq_vbi_done(struct saa7134_dev *dev, unsigned long status)
goto done; goto done;
dev->vbi_q.curr->vb.field_count = dev->vbi_fieldcount; dev->vbi_q.curr->vb.field_count = dev->vbi_fieldcount;
saa7134_buffer_finish(dev,&dev->vbi_q,STATE_DONE); saa7134_buffer_finish(dev,&dev->vbi_q,VIDEOBUF_DONE);
} }
saa7134_buffer_next(dev,&dev->vbi_q); saa7134_buffer_next(dev,&dev->vbi_q);

View File

@ -945,7 +945,7 @@ static int buffer_activate(struct saa7134_dev *dev,
unsigned long bpl_uv,lines_uv,base2,base3,tmp; /* planar */ unsigned long bpl_uv,lines_uv,base2,base3,tmp; /* planar */
dprintk("buffer_activate buf=%p\n",buf); dprintk("buffer_activate buf=%p\n",buf);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
buf->top_seen = 0; buf->top_seen = 0;
set_size(dev,TASK_A,buf->vb.width,buf->vb.height, set_size(dev,TASK_A,buf->vb.width,buf->vb.height,
@ -1054,7 +1054,7 @@ static int buffer_prepare(struct videobuf_queue *q,
saa7134_dma_free(q,buf); saa7134_dma_free(q,buf);
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
buf->vb.width = fh->width; buf->vb.width = fh->width;
@ -1074,7 +1074,7 @@ static int buffer_prepare(struct videobuf_queue *q,
if (err) if (err)
goto oops; goto oops;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
buf->activate = buffer_activate; buf->activate = buffer_activate;
return 0; return 0;
@ -1421,8 +1421,8 @@ video_poll(struct file *file, struct poll_table_struct *wait)
return POLLERR; return POLLERR;
poll_wait(file, &buf->done, wait); poll_wait(file, &buf->done, wait);
if (buf->state == STATE_DONE || if (buf->state == VIDEOBUF_DONE ||
buf->state == STATE_ERROR) buf->state == VIDEOBUF_ERROR)
return POLLIN|POLLRDNORM; return POLLIN|POLLRDNORM;
return 0; return 0;
} }
@ -2519,7 +2519,7 @@ void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status)
goto done; goto done;
} }
dev->video_q.curr->vb.field_count = dev->video_fieldcount; dev->video_q.curr->vb.field_count = dev->video_fieldcount;
saa7134_buffer_finish(dev,&dev->video_q,STATE_DONE); saa7134_buffer_finish(dev,&dev->video_q,VIDEOBUF_DONE);
} }
saa7134_buffer_next(dev,&dev->video_q); saa7134_buffer_next(dev,&dev->video_q);

View File

@ -68,14 +68,14 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
MAGIC_CHECK(vb->magic,MAGIC_BUFFER); MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
add_wait_queue(&vb->done, &wait); add_wait_queue(&vb->done, &wait);
while (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) { while (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) {
if (non_blocking) { if (non_blocking) {
retval = -EAGAIN; retval = -EAGAIN;
break; break;
} }
set_current_state(intr ? TASK_INTERRUPTIBLE set_current_state(intr ? TASK_INTERRUPTIBLE
: TASK_UNINTERRUPTIBLE); : TASK_UNINTERRUPTIBLE);
if (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED)
schedule(); schedule();
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
if (intr && signal_pending(current)) { if (intr && signal_pending(current)) {
@ -167,11 +167,11 @@ int videobuf_queue_is_busy(struct videobuf_queue *q)
dprintk(1,"busy: buffer #%d mapped\n",i); dprintk(1,"busy: buffer #%d mapped\n",i);
return 1; return 1;
} }
if (q->bufs[i]->state == STATE_QUEUED) { if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
dprintk(1,"busy: buffer #%d queued\n",i); dprintk(1,"busy: buffer #%d queued\n",i);
return 1; return 1;
} }
if (q->bufs[i]->state == STATE_ACTIVE) { if (q->bufs[i]->state == VIDEOBUF_ACTIVE) {
dprintk(1,"busy: buffer #%d avtive\n",i); dprintk(1,"busy: buffer #%d avtive\n",i);
return 1; return 1;
} }
@ -191,9 +191,9 @@ void videobuf_queue_cancel(struct videobuf_queue *q)
for (i = 0; i < VIDEO_MAX_FRAME; i++) { for (i = 0; i < VIDEO_MAX_FRAME; i++) {
if (NULL == q->bufs[i]) if (NULL == q->bufs[i])
continue; continue;
if (q->bufs[i]->state == STATE_QUEUED) { if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
list_del(&q->bufs[i]->queue); list_del(&q->bufs[i]->queue);
q->bufs[i]->state = STATE_ERROR; q->bufs[i]->state = VIDEOBUF_ERROR;
} }
} }
if (q->irqlock) if (q->irqlock)
@ -259,17 +259,17 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
b->flags |= V4L2_BUF_FLAG_MAPPED; b->flags |= V4L2_BUF_FLAG_MAPPED;
switch (vb->state) { switch (vb->state) {
case STATE_PREPARED: case VIDEOBUF_PREPARED:
case STATE_QUEUED: case VIDEOBUF_QUEUED:
case STATE_ACTIVE: case VIDEOBUF_ACTIVE:
b->flags |= V4L2_BUF_FLAG_QUEUED; b->flags |= V4L2_BUF_FLAG_QUEUED;
break; break;
case STATE_DONE: case VIDEOBUF_DONE:
case STATE_ERROR: case VIDEOBUF_ERROR:
b->flags |= V4L2_BUF_FLAG_DONE; b->flags |= V4L2_BUF_FLAG_DONE;
break; break;
case STATE_NEEDS_INIT: case VIDEOBUF_NEEDS_INIT:
case STATE_IDLE: case VIDEOBUF_IDLE:
/* nothing */ /* nothing */
break; break;
} }
@ -498,7 +498,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
dprintk(1,"qbuf: memory type is wrong.\n"); dprintk(1,"qbuf: memory type is wrong.\n");
goto done; goto done;
} }
if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) { if (buf->state != VIDEOBUF_NEEDS_INIT && buf->state != VIDEOBUF_IDLE) {
dprintk(1,"qbuf: buffer is already queued or active.\n"); dprintk(1,"qbuf: buffer is already queued or active.\n");
goto done; goto done;
} }
@ -525,7 +525,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
dprintk(1,"qbuf: buffer length is not enough\n"); dprintk(1,"qbuf: buffer length is not enough\n");
goto done; goto done;
} }
if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
q->ops->buf_release(q,buf); q->ops->buf_release(q,buf);
buf->baddr = b->m.userptr; buf->baddr = b->m.userptr;
break; break;
@ -595,16 +595,16 @@ int videobuf_dqbuf(struct videobuf_queue *q,
goto done; goto done;
} }
switch (buf->state) { switch (buf->state) {
case STATE_ERROR: case VIDEOBUF_ERROR:
dprintk(1,"dqbuf: state is error\n"); dprintk(1,"dqbuf: state is error\n");
retval = -EIO; retval = -EIO;
CALL(q,sync,q, buf); CALL(q,sync,q, buf);
buf->state = STATE_IDLE; buf->state = VIDEOBUF_IDLE;
break; break;
case STATE_DONE: case VIDEOBUF_DONE:
dprintk(1,"dqbuf: state is done\n"); dprintk(1,"dqbuf: state is done\n");
CALL(q,sync,q, buf); CALL(q,sync,q, buf);
buf->state = STATE_IDLE; buf->state = VIDEOBUF_IDLE;
break; break;
default: default:
dprintk(1,"dqbuf: state invalid\n"); dprintk(1,"dqbuf: state invalid\n");
@ -637,7 +637,7 @@ int videobuf_streamon(struct videobuf_queue *q)
if (q->irqlock) if (q->irqlock)
spin_lock_irqsave(q->irqlock,flags); spin_lock_irqsave(q->irqlock,flags);
list_for_each_entry(buf, &q->stream, stream) list_for_each_entry(buf, &q->stream, stream)
if (buf->state == STATE_PREPARED) if (buf->state == VIDEOBUF_PREPARED)
q->ops->buf_queue(q,buf); q->ops->buf_queue(q,buf);
if (q->irqlock) if (q->irqlock)
spin_unlock_irqrestore(q->irqlock,flags); spin_unlock_irqrestore(q->irqlock,flags);
@ -704,7 +704,7 @@ static ssize_t videobuf_read_zerocopy(struct videobuf_queue *q,
retval = videobuf_waiton(q->read_buf,0,0); retval = videobuf_waiton(q->read_buf,0,0);
if (0 == retval) { if (0 == retval) {
CALL(q,sync,q,q->read_buf); CALL(q,sync,q,q->read_buf);
if (STATE_ERROR == q->read_buf->state) if (VIDEOBUF_ERROR == q->read_buf->state)
retval = -EIO; retval = -EIO;
else else
retval = q->read_buf->size; retval = q->read_buf->size;
@ -778,7 +778,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
CALL(q,sync,q,q->read_buf); CALL(q,sync,q,q->read_buf);
if (STATE_ERROR == q->read_buf->state) { if (VIDEOBUF_ERROR == q->read_buf->state) {
/* catch I/O errors */ /* catch I/O errors */
q->ops->buf_release(q,q->read_buf); q->ops->buf_release(q,q->read_buf);
kfree(q->read_buf); kfree(q->read_buf);
@ -931,7 +931,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q,
break; break;
} }
if (q->read_buf->state == STATE_DONE) { if (q->read_buf->state == VIDEOBUF_DONE) {
rc = CALL (q,copy_stream, q, data + retval, count, rc = CALL (q,copy_stream, q, data + retval, count,
retval, vbihack, nonblocking); retval, vbihack, nonblocking);
if (rc < 0) { if (rc < 0) {
@ -999,8 +999,8 @@ unsigned int videobuf_poll_stream(struct file *file,
if (0 == rc) { if (0 == rc) {
poll_wait(file, &buf->done, wait); poll_wait(file, &buf->done, wait);
if (buf->state == STATE_DONE || if (buf->state == VIDEOBUF_DONE ||
buf->state == STATE_ERROR) buf->state == VIDEOBUF_ERROR)
rc = POLLIN|POLLRDNORM; rc = POLLIN|POLLRDNORM;
} }
mutex_unlock(&q->lock); mutex_unlock(&q->lock);

View File

@ -67,7 +67,7 @@ static int videobuf_dvb_thread(void *data)
/* feed buffer data to demux */ /* feed buffer data to demux */
dma=videobuf_to_dma(buf); dma=videobuf_to_dma(buf);
if (buf->state == STATE_DONE) if (buf->state == VIDEOBUF_DONE)
dvb_dmx_swfilter(&dvb->demux, dma->vmalloc, dvb_dmx_swfilter(&dvb->demux, dma->vmalloc,
buf->size); buf->size);

View File

@ -370,7 +370,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
(unsigned long)tmpbuf,pos); (unsigned long)tmpbuf,pos);
/* Advice that buffer was filled */ /* Advice that buffer was filled */
buf->vb.state = STATE_DONE; buf->vb.state = VIDEOBUF_DONE;
buf->vb.field_count++; buf->vb.field_count++;
do_gettimeofday(&ts); do_gettimeofday(&ts);
buf->vb.ts = ts; buf->vb.ts = ts;
@ -522,7 +522,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
/* cancel all outstanding capture / vbi requests */ /* cancel all outstanding capture / vbi requests */
list_for_each_entry_safe(buf, prev, &dma_q->active, vb.queue) { list_for_each_entry_safe(buf, prev, &dma_q->active, vb.queue) {
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
} }
mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
@ -543,7 +543,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
vivi_stop_thread(dma_q); vivi_stop_thread(dma_q);
vivi_start_thread(dma_q); vivi_start_thread(dma_q);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2,"[%p/%d] restart_queue - first active\n", dprintk(2,"[%p/%d] restart_queue - first active\n",
buf,buf->vb.i); buf,buf->vb.i);
@ -553,7 +553,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
list_add_tail(&buf->vb.queue,&dma_q->active); list_add_tail(&buf->vb.queue,&dma_q->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
dprintk(2,"[%p/%d] restart_queue - move to active\n", dprintk(2,"[%p/%d] restart_queue - move to active\n",
buf,buf->vb.i); buf,buf->vb.i);
} else { } else {
@ -572,7 +572,7 @@ static void vivi_vid_timeout(unsigned long data)
while (!list_empty(&vidq->active)) { while (!list_empty(&vidq->active)) {
buf = list_entry(vidq->active.next, struct vivi_buffer, vb.queue); buf = list_entry(vidq->active.next, struct vivi_buffer, vb.queue);
list_del(&buf->vb.queue); list_del(&buf->vb.queue);
buf->vb.state = STATE_ERROR; buf->vb.state = VIDEOBUF_ERROR;
wake_up(&buf->vb.done); wake_up(&buf->vb.done);
printk("vivi/0: [%p/%d] timeout\n", buf, buf->vb.i); printk("vivi/0: [%p/%d] timeout\n", buf, buf->vb.i);
} }
@ -610,7 +610,7 @@ static void free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf)
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_vmalloc_free(&buf->vb); videobuf_vmalloc_free(&buf->vb);
buf->vb.state = STATE_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
#define norm_maxw() 1024 #define norm_maxw() 1024
@ -644,12 +644,12 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
init_buffer = 1; init_buffer = 1;
} }
if (STATE_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
if (0 != (rc = videobuf_iolock(vq,&buf->vb,NULL))) if (0 != (rc = videobuf_iolock(vq,&buf->vb,NULL)))
goto fail; goto fail;
} }
buf->vb.state = STATE_PREPARED; buf->vb.state = VIDEOBUF_PREPARED;
return 0; return 0;
@ -670,13 +670,13 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
if (!list_empty(&vidq->queued)) { if (!list_empty(&vidq->queued)) {
dprintk(1,"adding vb queue=0x%08lx\n",(unsigned long)&buf->vb.queue); dprintk(1,"adding vb queue=0x%08lx\n",(unsigned long)&buf->vb.queue);
list_add_tail(&buf->vb.queue,&vidq->queued); list_add_tail(&buf->vb.queue,&vidq->queued);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2,"[%p/%d] buffer_queue - append to queued\n", dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
buf, buf->vb.i); buf, buf->vb.i);
} else if (list_empty(&vidq->active)) { } else if (list_empty(&vidq->active)) {
list_add_tail(&buf->vb.queue,&vidq->active); list_add_tail(&buf->vb.queue,&vidq->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
mod_timer(&vidq->timeout, jiffies+BUFFER_TIMEOUT); mod_timer(&vidq->timeout, jiffies+BUFFER_TIMEOUT);
dprintk(2,"[%p/%d] buffer_queue - first active\n", dprintk(2,"[%p/%d] buffer_queue - first active\n",
buf, buf->vb.i); buf, buf->vb.i);
@ -688,13 +688,13 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
prev->vb.height == buf->vb.height && prev->vb.height == buf->vb.height &&
prev->fmt == buf->fmt) { prev->fmt == buf->fmt) {
list_add_tail(&buf->vb.queue,&vidq->active); list_add_tail(&buf->vb.queue,&vidq->active);
buf->vb.state = STATE_ACTIVE; buf->vb.state = VIDEOBUF_ACTIVE;
dprintk(2,"[%p/%d] buffer_queue - append to active\n", dprintk(2,"[%p/%d] buffer_queue - append to active\n",
buf, buf->vb.i); buf, buf->vb.i);
} else { } else {
list_add_tail(&buf->vb.queue,&vidq->queued); list_add_tail(&buf->vb.queue,&vidq->queued);
buf->vb.state = STATE_QUEUED; buf->vb.state = VIDEOBUF_QUEUED;
dprintk(2,"[%p/%d] buffer_queue - first queued\n", dprintk(2,"[%p/%d] buffer_queue - first queued\n",
buf, buf->vb.i); buf, buf->vb.i);
} }

View File

@ -56,13 +56,13 @@ struct videobuf_mapping {
}; };
enum videobuf_state { enum videobuf_state {
STATE_NEEDS_INIT = 0, VIDEOBUF_NEEDS_INIT = 0,
STATE_PREPARED = 1, VIDEOBUF_PREPARED = 1,
STATE_QUEUED = 2, VIDEOBUF_QUEUED = 2,
STATE_ACTIVE = 3, VIDEOBUF_ACTIVE = 3,
STATE_DONE = 4, VIDEOBUF_DONE = 4,
STATE_ERROR = 5, VIDEOBUF_ERROR = 5,
STATE_IDLE = 6, VIDEOBUF_IDLE = 6,
}; };
struct videobuf_buffer { struct videobuf_buffer {