diff options
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-core.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 0c338a944..eaee42b9d 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -121,6 +121,7 @@ void cx88_print_ioctl(char *name, unsigned int cmd) } /* ------------------------------------------------------------------ */ +#define NO_SYNC_LINE (-1U) static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist, unsigned int offset, u32 sync_line, @@ -131,7 +132,8 @@ static u32* cx88_risc_field(u32 *rp, struct scatterlist *sglist, unsigned int line,todo; /* sync instruction */ - *(rp++) = cpu_to_le32(RISC_RESYNC | sync_line); + if (sync_line != NO_SYNC_LINE) + *(rp++) = cpu_to_le32(RISC_RESYNC | sync_line); /* scan lines */ sg = sglist; @@ -207,6 +209,30 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, return 0; } +int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, + struct scatterlist *sglist, unsigned int bpl, + unsigned int lines) +{ + u32 instructions; + u32 *rp; + int rc; + + /* estimate risc mem: worst case is one write per page border + + one write per scan line + syncs + jump (all 2 dwords) */ + instructions = (bpl * lines) / PAGE_SIZE + lines; + instructions += 3 + 4; + if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) + return rc; + + /* write risc instructions */ + rp = risc->cpu; + rp = cx88_risc_field(rp, sglist, 0, NO_SYNC_LINE, bpl, 0, lines); + + /* save pointer to jmp instruction address */ + risc->jmp = rp; + return 0; +} + int cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, u32 reg, u32 mask, u32 value) { @@ -536,7 +562,10 @@ void cx88_print_irqbits(char *name, char *tag, char **strings, for (i = 0; i < 32; i++) { if (!(bits & (1 << i))) continue; - printk(" %s",strings[i]); + if (strings[i]) + printk(" %s", strings[i]); + else + printk(" %d", i); if (!(mask & (1 << i))) continue; printk("*"); @@ -556,8 +585,9 @@ void cx88_wakeup(struct cx88_core *core, struct cx88_dmaqueue *q, u32 count) { struct cx88_buffer *buf; + int bc; - for (;;) { + for (bc = 0;; bc++) { if (list_empty(&q->active)) break; buf = list_entry(q->active.next, @@ -576,6 +606,8 @@ void cx88_wakeup(struct cx88_core *core, } else { mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); } + if (bc != 1) + printk("%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc); } void cx88_shutdown(struct cx88_core *core) @@ -590,7 +622,7 @@ void cx88_shutdown(struct cx88_core *core) cx_write(MO_VIP_DMACNTRL, 0x0); cx_write(MO_GPHST_DMACNTRL, 0x0); - /* stop interupts */ + /* stop interrupts */ cx_write(MO_PCI_INTMSK, 0x0); cx_write(MO_VID_INTMSK, 0x0); cx_write(MO_AUD_INTMSK, 0x0); @@ -622,7 +654,7 @@ int cx88_reset(struct cx88_core *core) cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH24], 128, 0); cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0); cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0); - cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 512, 0); + cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH28], 188*4, 0); /* misc init ... */ cx_write(MO_INPUT_FORMAT, ((1 << 13) | // agc enable @@ -1142,6 +1174,7 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) EXPORT_SYMBOL(cx88_print_ioctl); EXPORT_SYMBOL(cx88_pci_irqs); EXPORT_SYMBOL(cx88_vid_irqs); +EXPORT_SYMBOL(cx88_mpeg_irqs); EXPORT_SYMBOL(cx88_print_irqbits); EXPORT_SYMBOL(cx88_irq); @@ -1150,6 +1183,7 @@ EXPORT_SYMBOL(cx88_reset); EXPORT_SYMBOL(cx88_shutdown); EXPORT_SYMBOL(cx88_risc_buffer); +EXPORT_SYMBOL(cx88_risc_databuffer); EXPORT_SYMBOL(cx88_risc_stopper); EXPORT_SYMBOL(cx88_free_buffer); |