diff options
author | Holger Waechtler <devnull@localhost> | 2003-01-23 15:46:06 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2003-01-23 15:46:06 +0000 |
commit | 86afdf2daa0548e1888201a870348acff86583cb (patch) | |
tree | ffc5d62bc362d7c0e04bdf6e79473752582ab10d /linux | |
parent | a9c05e7c4a319a540f78774493a9c19fc0791c79 (diff) | |
download | mediapointer-dvb-s2-86afdf2daa0548e1888201a870348acff86583cb.tar.gz mediapointer-dvb-s2-86afdf2daa0548e1888201a870348acff86583cb.tar.bz2 |
apply fidbirq improvements ported to dvb-kernel by <emard@softhome.net>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/ttpci-budget/budget-core.c | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/linux/drivers/media/dvb/ttpci-budget/budget-core.c b/linux/drivers/media/dvb/ttpci-budget/budget-core.c index 14ddd5db2..d580488d2 100644 --- a/linux/drivers/media/dvb/ttpci-budget/budget-core.c +++ b/linux/drivers/media/dvb/ttpci-budget/budget-core.c @@ -75,11 +75,12 @@ TTBStart(struct budget_s *budget) memset(budget->grabbing, 0x00, TS_HEIGHT*TS_WIDTH); - saa7146_write(dev, PCI_BT_V1, 0x001c0000); + saa7146_write(dev, PCI_BT_V1, 0x001c0000 | + (saa7146_read(dev, PCI_BT_V1) & ~0x001f0000)); - budget->tsf=0; + budget->tsf=0xff; budget->ttbp=0; - saa7146_write(dev, DD1_INIT, 0x02000680); + saa7146_write(dev, DD1_INIT, 0x020006c0); saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26)); saa7146_write(dev, BRS_CTRL, 0x60000000); @@ -107,48 +108,28 @@ static void fidbirq (unsigned long data) { struct budget_s *budget = (struct budget_s*) data; - u8 *mem=(u8 *)(budget->grabbing); - int num; - u32 dmapos; + u8 *mem=(u8 *)(budget->grabbing); + int num=512; + int field=0x80 & saa7146_read(budget->dev, PSR); DEB_EE(("budget: %p\n",budget)); - dmapos=saa7146_read(budget->dev, PCI_VDP3); - dmapos-=(dmapos%188); - - if (dmapos>=TS_BUFLEN) { - DEB_S(("bogus dmapos value ignored, budget: %p\n",budget)); - return; + if (field) { + if (field==budget->tsf) + num=1024; + else + mem+=TS_BUFLEN/2; + } else { + if (field==budget->tsf) { + if (budget->feeding && mem[TS_BUFLEN/2]==0x47) + dvb_dmx_swfilter_packets(&budget->demux, + mem+TS_BUFLEN/2, 512 ); + } } - if (budget->tsf) { - mem+=budget->ttbp; - if (dmapos<0x20000) { - num=1024-budget->ttbp/188; - budget->ttbp=0; - } else { - num=(dmapos - budget->ttbp)/188; - budget->ttbp=dmapos; - } - } else { - if (budget->ttbp>1000*188 && budget->ttbp<1024*188) { - if (budget->feeding) - dvb_dmx_swfilter_packets(&budget->demux, - mem+budget->ttbp, - 1024- budget->ttbp / 188); - } - num=dmapos/188; - budget->ttbp=dmapos; - } - - budget->tsf^=1; - saa7146_write(budget->dev, DD1_INIT, 0x02000600|(budget->tsf ? 0x40:0x80)); - saa7146_write(budget->dev, MC2, - (MASK_09 | MASK_25 | MASK_10 | MASK_26)); - - // FIXME: use bottom half or tasklet - if (budget->feeding && mem[0]==0x47) - dvb_dmx_swfilter_packets(&budget->demux, mem, num); + budget->tsf=field; + if (budget->feeding && mem[0]==0x47) + dvb_dmx_swfilter_packets(&budget->demux, mem, num); } inline static void |