55,6 → 55,7 |
|
int bttv_num; /* number of Bt848s in use */ |
int in_irq = 0; |
DWORD oldpci_command; |
struct bttv *btvirq; |
struct bttv bttvs[BTTV_MAX]; |
|
143,28 → 144,7 |
free(ptr-4-*(unsigned long *)(ptr-4)); |
|
} |
/* |
* Create the giant waste of buffer space we need for now |
* until we get DMA to user space sorted out (probably 2.3.x) |
* |
* We only create this as and when someone uses mmap |
*/ |
|
static int fbuffer_alloc(struct bttv *btv) |
{ |
if(!btv->fbuffer) { |
btv->fbuffer=(unsigned char *) vmalloc_32(gbuffers*gbufsize); |
memset(btv->fbuffer, 0, gbuffers*gbufsize); |
} else |
printk(KERN_ERR "bttv%d: Double alloc of fbuffer!\n", |
btv->nr); |
if(!btv->fbuffer) |
return -ENOBUFS; |
return 0; |
} |
|
/* ----------------------------------------------------------------------- */ |
|
void bttv_gpio_tracking(struct bttv *btv, char *comment) |
{ |
unsigned int outbits, data; |
998,10 → 978,7 |
unsigned int *vbuf; |
|
if(btv->fbuffer==NULL) |
{ |
if(fbuffer_alloc(btv)) |
return -ENOBUFS; |
} |
|
if(mp->frame >= gbuffers || mp->frame < 0) |
return -EINVAL; |
1144,7 → 1121,8 |
unsigned long tmp; |
int need_wait; |
|
//bt848_dma(btv,0); |
vfree_32(btv->fbuffer); |
btv->fbuffer = NULL; |
|
btv->user--; |
need_wait = (-1 != btv->gq_grab); |
1168,12 → 1146,10 |
|
tmp = btread(BT848_I2C); /* This fixes the PCI posting delay */ |
|
if(btv->fbuffer) |
vfree_32((void *) btv->fbuffer); |
btv->fbuffer=0; |
pci_write_config_dword(btv->dev,PCI_COMMAND,oldpci_command); |
|
} |
|
|
/***********************************/ |
/* ioctls and supporting functions */ |
/***********************************/ |
2143,6 → 2119,7 |
pcibios_read_config_byte(bus, dv, PCI_INTERRUPT_LINE, (BYTE *)&(btv->dev->irq)); |
|
pcibios_read_config_dword(bus,dv,PCI_COMMAND,&dw); |
oldpci_command = dw; |
dw |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); |
pcibios_write_config_dword(bus,dv,PCI_COMMAND,dw); |
|