Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Patch: fidbirq() with recovery after lost intr



Hi all,

   looking deeper into IRQ handler for NOVA cards I've realized that it's
unnecessary complicated and lacks the functionality to recover after lost
interrupt athough it's supported by hardware. 

   The card always provides access to two most recent half-buffers, which 
means that if we miss one interrupt, we can always recover by outputting 
the missing half-buffer in the next interrupt.

   Thus I've rewritten the fidbirq() function from scratch - please find the
patch below.


	With kind regards,


		M.

--------------------------------------------------------------------------
----                                                                  ----
----   Marian Durkovic                       network  manager         ----
----                                                                  ----
----   Slovak Technical University           Tel: +421 2 524 51 301   ----
----   Computer Centre, Nam. Slobody 17      Fax: +421 2 524 94 351   ----
----   812 43 Bratislava, Slovak Republic    E-mail: md@bts.sk        ----
----                                                                  ----
--------------------------------------------------------------------------


--- av7110.c.orig	Mon Jan 20 16:10:38 2003
+++ av7110.new.c	Tue Jan 21 10:51:53 2003
@@ -713,7 +713,7 @@
 
         saa7146_write(saa->mem, PCI_BT_V1, 0x001c0000);
 
-        av7110->tsf=0;
+        av7110->tsf=0xFF;
         av7110->ttbp=0;
         saa7146_write(saa->mem, DD1_INIT, 0x020006c0);
         saa7146_write(saa->mem, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));
@@ -894,36 +894,23 @@
 {
 	struct av7110_s *av7110 = (struct av7110_s*) data;
         u8 *mem=(u8 *)(av7110->saa->grabbing);
-        int num;
-        u32 dmapos;
+        int num=512;
         int field=0x80&saa7146_read(av7110->saa_mem, PSR);
 
-        dmapos=saa7146_read(av7110->saa_mem, PCI_VDP3);
-        dmapos-=(dmapos%188);
-
-	if (dmapos >= TS_BUFLEN)
-		return;
-
         if (field) {
-                mem+=av7110->ttbp;
-                if (dmapos<0x20000) {
-                        num=1024-av7110->ttbp/188;
-                        av7110->ttbp=0;
-                } else {
-                        num=(dmapos - av7110->ttbp)/188;
-                        av7110->ttbp=dmapos;
-                }
+             if(field==av7110->tsf) {
+                   num=1024;
+             } else {
+                   mem+=TS_BUFLEN/2;
+             }
         } else {
-                if (av7110->ttbp) {
-                        if (av7110->feeding)
-                                dvb_dmx_swfilter_packets(&av7110->demux, 
-                                                      mem+av7110->ttbp,
-                                                      1024- av7110->ttbp / 188);
-                }
-                num=dmapos/188;
-                av7110->ttbp=dmapos;
+             if(field==av7110->tsf) {
+                   if (av7110->feeding && mem[TS_BUFLEN/2]==0x47)
+                        dvb_dmx_swfilter_packets(&av7110->demux, 
+                                                 mem+TS_BUFLEN/2, 512 );
+              } 
         }
-
+        av7110->tsf=field;
         if (av7110->feeding && mem[0]==0x47)
                 dvb_dmx_swfilter_packets(&av7110->demux, mem, num);
 }


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index