Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 695 → Rev 667

/shark/trunk/drivers/bttv/bttv-driver.c
77,7 → 77,6
static unsigned int sloppy = 0;
static unsigned int v4l2 = 1;
 
static volatile unsigned int grab_complete = 0;
 
/* insmod args */
MODULE_PARM(radio,"1-" __stringify(BTTV_MAX) "i");
2372,15 → 2371,34
}
case VIDIOCSYNC:
{
int *frame = arg;
struct bttv_buffer *buf;
 
/* S.Ha.R.K. Version: Active wait until complete */
if (*frame >= VIDEO_MAX_FRAME)
return -EINVAL;
 
grab_complete = 0;
 
while(grab_complete == 0);
 
return grab_complete;
 
//down(&fh->cap.lock);
retval = -EINVAL;
buf = (struct bttv_buffer *)fh->cap.bufs[*frame];
if (NULL == buf)
goto fh_unlock_and_return;
retval = videobuf_waiton(&buf->vb,0,1);
if (0 != retval)
goto fh_unlock_and_return;
switch (buf->vb.state) {
case STATE_ERROR:
retval = -EIO;
/* fall through */
case STATE_DONE:
//videobuf_dma_pci_sync(btv->dev,&buf->vb.dma);
bttv_dma_free(btv,buf);
break;
default:
retval = -EINVAL;
break;
}
//up(&fh->cap.lock);
return retval;
}
 
case VIDIOCGVBIFMT:
3197,7 → 3215,6
wakeup->vbi->vb.ts = ts;
wakeup->vbi->vb.field_count = btv->field_count;
wakeup->vbi->vb.state = state;
grab_complete = 1;
//wake_up(&wakeup->vbi->vb.done);
}
if (wakeup->top == wakeup->bottom) {
3207,7 → 3224,6
wakeup->top->vb.ts = ts;
wakeup->top->vb.field_count = btv->field_count;
wakeup->top->vb.state = state;
grab_complete = 1;
//wake_up(&wakeup->top->vb.done);
}
} else {
3217,7 → 3233,6
wakeup->top->vb.ts = ts;
wakeup->top->vb.field_count = btv->field_count;
wakeup->top->vb.state = state;
grab_complete = 1;
//wake_up(&wakeup->top->vb.done);
}
if (NULL != wakeup->bottom && curr->bottom != wakeup->bottom) {
3226,7 → 3241,6
wakeup->bottom->vb.ts = ts;
wakeup->bottom->vb.field_count = btv->field_count;
wakeup->bottom->vb.state = state;
grab_complete = 1;
//wake_up(&wakeup->bottom->vb.done);
}
}
3262,7 → 3276,6
item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue);
item->vb.state = STATE_ERROR;
grab_complete = 2;
//wake_up(&item->vb.done);
}
while (!list_empty(&btv->vcapture)) {
3269,7 → 3282,6
item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue);
item->vb.state = STATE_ERROR;
grab_complete = 2;
//wake_up(&item->vb.done);
}
3293,7 → 3305,6
//do_gettimeofday(&wakeup->vb.ts);
wakeup->vb.field_count = btv->field_count;
wakeup->vb.state = STATE_DONE;
grab_complete = 1;
//wake_up(&wakeup->vb.done);
spin_unlock(&btv->s_lock);
}