Mailing List archive

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

[linux-dvb] [patch] adjusting PCI burst mode by module parameter



Hi,

this patch was written to adjust the PCI burst value as a module
parameter. It is written for the dvb-kernel branch and just affects
budget-core.c

As described in "distortions on P4 systems (12V hungry?)" and other
previous threads, some chipsets have problems with budget cards. These
problems can be isolated to the the PCI burst value, it's default
(0x001c0000) is inappropriate for some systems. This patch can help
testing various combinations of the arbitration control register and set
them during module loading. I get a viewable TS without continuity errors
with my i845 chipset, when budget_burst is set to "0x03". If there is
demand, then I will write patches for the other branches, too.

bye,
Stefan
diff -Naur dvb-kernel.orig/linux/drivers/media/dvb/ttpci/budget-core.c dvb-kernel/linux/drivers/media/dvb/ttpci/budget-core.c
--- dvb-kernel.orig/linux/drivers/media/dvb/ttpci/budget-core.c
+++ dvb-kernel/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -4,6 +4,18 @@
 int budget_debug = 0;
 
 /****************************************************************************
+ * "budget_burst" is a module parameter used to set the arbitration control
+ * registers on the SAA7146 (see page 31 of the data sheet). Due to timing
+ * problems some users experience a lot of continuity errors in the TS 
+ * stream. By changing this parameter, the PCI burst mode for DMA 3 can be
+ * optimised. The 3 least significant bits of "budget_burst" equal bursts
+ * of 1,2,4,8,16,32,64 and 128 Dwords. The fourth and fifth bit are assigned
+ * to the FIFO threshold: 4,8,16 or 32 Dwords. The default is 0x1c: 16 DW
+ * burst and 32 DW FIFO. 
+ ****************************************************************************/
+int budget_burst = 0x1c;
+
+/****************************************************************************
  * TT budget / WinTV Nova
  ****************************************************************************/
 
@@ -33,7 +45,7 @@
 
         memset(budget->grabbing, 0x00, TS_HEIGHT*TS_WIDTH);
 
-        saa7146_write(dev, PCI_BT_V1, 0x001c0000 |
+        saa7146_write(dev, PCI_BT_V1, ((budget_burst<<16) & 0x001f0000) |
             (saa7146_read(dev, PCI_BT_V1) & ~0x001f0000));
 
         budget->tsf=0xff;
@@ -239,7 +251,7 @@
 		goto err;
 	}
 
-	saa7146_write(dev, PCI_BT_V1, 0x001c0000);
+	saa7146_write(dev, PCI_BT_V1, (budget_burst<<16) & 0x001f0000);
 	/* upload all */
         saa7146_write(dev, GPIO_CTRL, 0x000000);
 
@@ -304,4 +316,6 @@
 MODULE_PARM(budget_debug,"i");
 MODULE_LICENSE("GPL");
 
+MODULE_PARM(budget_burst,"i");
+MODULE_PARM_DESC(budget_burst,"burst length and burst threshold for DMA 3");
 

Home | Main Index | Thread Index