Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: vpeirq() instead of fidbirq()
This vpeirq() works perfect under all tests!!
I have ported it to dvb-kernel (attached), and
run mplayer tests with two cards in parallel -
budget patched TT-1.3 and satelco. zero packet
loss (ZPL) and every thing runs excellent.
Then I tested network, cool ZPL as well.
This one can go to dvb-kernel
Best regards, Emard
> ? patch
> Index: av7110.c
> ===================================================================
> RCS file: /cvs/linuxtv/DVB/driver/av7110/av7110.c,v
> retrieving revision 1.17
> diff -p -u -r1.17 av7110.c
> --- av7110.c 21 Jan 2003 11:27:11 -0000 1.17
> +++ av7110.c 4 Feb 2003 08:44:34 -0000
> @@ -713,9 +713,8 @@ TTBStart(av7110_t *av7110)
>
> saa7146_write(saa->mem, PCI_BT_V1, 0x001c0000);
>
> - av7110->tsf=0xFF;
> av7110->ttbp=0;
> - saa7146_write(saa->mem, DD1_INIT, 0x020006c0);
> + saa7146_write(saa->mem, DD1_INIT, 0x02000600);
> saa7146_write(saa->mem, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
>
> saa7146_write(saa->mem, BRS_CTRL, 0x60000000);
> @@ -725,7 +724,7 @@ TTBStart(av7110_t *av7110)
> saa7146_write(saa->mem, BASE_ODD3, 0);
> saa7146_write(saa->mem, BASE_EVEN3, TS_BUFLEN/2);
> saa7146_write(saa->mem, PROT_ADDR3, TS_BUFLEN);
> - saa7146_write(saa->mem, BASE_PAGE3, virt_to_bus(saa->page_table[0])|ME1|0xb0);
> + saa7146_write(saa->mem, BASE_PAGE3, virt_to_bus(saa->page_table[0])|ME1|0x90);
> saa7146_write(saa->mem, PITCH3, TS_WIDTH);
>
> saa7146_write(saa->mem, NUM_LINE_BYTE3, ((TS_HEIGHT/2)<<16)|TS_WIDTH);
> @@ -885,34 +884,40 @@ u8 pshead[0x26] = {
>
> static void vpeirq (unsigned long data)
> {
> - //printk("vpeirq %08x\n", saa7146_read(av7110->saa_mem, PCI_VDP3));
> -}
> + struct av7110_s *av7110 = (struct av7110_s*) data;
> + u8 *mem=(u8 *)(av7110->saa->grabbing);
> + int num;
> + u32 dmapos;
>
> + dmapos=saa7146_read(av7110->saa_mem, PCI_VDP3);
> + dmapos-=(dmapos%188);
>
> -static
> -void fidbirq (unsigned long data)
> -{
> - struct av7110_s *av7110 = (struct av7110_s*) data;
> - u8 *mem=(u8 *)(av7110->saa->grabbing);
> - int num=512;
> - int field=0x80&saa7146_read(av7110->saa_mem, PSR);
> + if (dmapos >= TS_BUFLEN)
> + return;
>
> - if (field) {
> - if(field==av7110->tsf) {
> - num=1024;
> - } else {
> - mem+=TS_BUFLEN/2;
> - }
> +
> + if (dmapos > av7110->ttbp) {
> + mem+=av7110->ttbp;
> + num=(dmapos-av7110->ttbp)/188;
> } else {
> - if(field==av7110->tsf) {
> - if (av7110->feeding && mem[TS_BUFLEN/2]==0x47)
> - dvb_dmx_swfilter_packets(&av7110->demux,
> - mem+TS_BUFLEN/2, 512 );
> - }
> + if (av7110->feeding && mem[av7110->ttbp]==0x47)
> + dvb_dmx_swfilter_packets(&av7110->demux,
> + mem+av7110->ttbp, 1024-av7110->ttbp/188);
> +
> + num=dmapos/188;
> }
> - av7110->tsf=field;
> +
> + av7110->ttbp=dmapos;
> +
> if (av7110->feeding && mem[0]==0x47)
> dvb_dmx_swfilter_packets(&av7110->demux, mem, num);
> +
> +}
> +
> +
> +static
> +void fidbirq (unsigned long data)
> +{
> }
>
>
diff -pur orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget-core.c dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget-core.c
--- orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget-core.c Tue Feb 4 22:05:36 2003
+++ dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget-core.c Thu Feb 6 22:06:15 2003
@@ -58,7 +58,7 @@ TTBStop(struct budget_s *budget)
return budget->feeding;
saa7146_write(budget->dev, MC1, MASK_20); // DMA3 off
- IER_DISABLE(budget->dev, MASK_07);
+ IER_DISABLE(budget->dev, MASK_07|MASK_10);
return 0;
}
@@ -81,7 +81,7 @@ TTBStart(struct budget_s *budget)
budget->tsf=0xff;
budget->ttbp=0;
- saa7146_write(dev, DD1_INIT, 0x020006c0);
+ saa7146_write(dev, DD1_INIT, 0x02000600);
saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
saa7146_write(dev, BRS_CTRL, 0x60000000);
@@ -91,20 +91,48 @@ TTBStart(struct budget_s *budget)
saa7146_write(dev, BASE_ODD3, 0);
saa7146_write(dev, BASE_EVEN3, TS_WIDTH*TS_HEIGHT/2);
saa7146_write(dev, PROT_ADDR3, TS_WIDTH*TS_HEIGHT);
- saa7146_write(dev, BASE_PAGE3, budget->pt.dma |ME1|0xb0);
- saa7146_write(dev, PITCH3, TS_WIDTH);
+ saa7146_write(dev, BASE_PAGE3, budget->pt.dma |ME1|0x90);
+ saa7146_write(dev, PITCH3, TS_WIDTH);
saa7146_write(dev, NUM_LINE_BYTE3, ((TS_HEIGHT/2)<<16)|TS_WIDTH);
saa7146_write(dev, MC2, (MASK_04 | MASK_20));
-
saa7146_write(dev, MC1, (MASK_04 | MASK_20)); // DMA3 on
- // FIDB
- IER_ENABLE(budget->dev, MASK_07);
+ IER_ENABLE(budget->dev, MASK_07|MASK_10); // FIDB + VPE
return ++budget->feeding;
}
+static void vpeirq (unsigned long data)
+{
+ struct budget_s *budget = (struct budget_s*) data;
+ u8 *mem=(u8 *)(budget->grabbing);
+ int num;
+ u32 dmapos;
+
+ dmapos=saa7146_read(budget->dev, PCI_VDP3);
+ dmapos-=(dmapos%188);
+
+ if (dmapos >= TS_BUFLEN)
+ return;
+
+ if (dmapos > budget->ttbp) {
+ mem+=budget->ttbp;
+ num=(dmapos-budget->ttbp)/188;
+ } else {
+ if (budget->feeding && mem[budget->ttbp]==0x47)
+ dvb_dmx_swfilter_packets(&budget->demux,
+ mem+budget->ttbp, 1024-budget->ttbp/188);
+
+ num=dmapos/188;
+ }
+
+ budget->ttbp=dmapos;
+
+ if (budget->feeding && mem[0]==0x47)
+ dvb_dmx_swfilter_packets(&budget->demux, mem, num);
+}
+
/* TS_PACKETS is minumum number of accumulated 188-byte packets
** (TS_SIZE=188) that is considered 'complete' and can
** be delivered to the sw_demux in one 'quantum'.
@@ -123,7 +151,7 @@ void fidbirq (unsigned long data)
u16 newpkt = saa7146_read(budget->dev, PCI_VDP3)/TS_QUANTUM; /* PCI_VDP3 = 0..TS_BUFLEN-1 */
u8 *olddma = mem + oldpkt*TS_QUANTUM; /* rounded to first complete packet */
- DEB_EE(("budget: %p\n",budget));
+ DEB_EE(("budget: %p\n", budget));
/* Zero-Packet-Loss fidbirq by EMARD */
@@ -545,6 +573,7 @@ int budget_attach (struct saa7146_dev* d
saa7146_write(dev, GPIO_CTRL, 0x000000);
tasklet_init (&budget->fidb_tasklet, fidbirq, (unsigned long) budget);
+ tasklet_init (&budget->vpe_tasklet, vpeirq, (unsigned long) budget);
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI); /* frontend power on */
return 0;
@@ -590,6 +619,8 @@ void budget_irq(struct saa7146_dev* dev,
if (*isr & MASK_07)
tasklet_schedule (&budget->fidb_tasklet);
+ if (*isr & MASK_10)
+ tasklet_schedule (&budget->vpe_tasklet);
}
EXPORT_SYMBOL_GPL(budget_register);
diff -pur orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.c dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.c
--- orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.c Thu Jan 23 20:00:03 2003
+++ dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.c Thu Feb 6 22:05:15 2003
@@ -86,7 +86,7 @@ struct saa7146_extension budget_extensio
.attach = this_budget_attach,
.detach = budget_detach,
- .irq_mask = MASK_07,
+ .irq_mask = MASK_07|MASK_10,
.irq_func = budget_irq,
};
diff -pur orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.h dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.h
--- orig/dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.h Tue Feb 4 22:05:36 2003
+++ dvb-kernel/linux/drivers/media/dvb/ttpci-budget/budget.h Thu Feb 6 22:05:15 2003
@@ -35,6 +35,7 @@ struct budget_s {
struct saa7146_pgtable pt;
struct tasklet_struct fidb_tasklet;
+ struct tasklet_struct vpe_tasklet;
dmxdev_t dmxdev;
struct dvb_demux demux;
@@ -47,7 +48,7 @@ struct budget_s {
struct semaphore pid_mutex;
u8 tsf;
- u16 ttbp;
+ u32 ttbp;
int feeding;
int registered;
Home |
Main Index |
Thread Index