Matrox TV-out kernel patches

From LQWiki
Jump to navigation Jump to search

Patches are for kernel 2.6.9. (The same approach tested on 2.4.25 also)
Tested with Matrox G550 card.


Patch # 1. PAL correct set up. For VIDIX tv out. Without it frames move up the screen.

--- matroxfb_g450.c.orig        2004-10-25 21:13:15.000000000 +0400
+++ matroxfb_g450.c     2004-11-14 23:03:32.431170200 +0300
@@ -237,7 +237,8 @@
       int mnp;
       int over;

-       r->regs[0x80] = 0x03;   /* | 0x40 for SCART */
+       r->regs[0x80] = 0x01;   /* for PAL mode;  | 0x40 for SCART */

       hvis = ((mt->HDisplay << 1) + 3) & ~3;


Patch # 2. SCART-RGB TV out.

--- matroxfb_g450.c.orig        2004-10-25 21:13:15.000000000 +0400
+++ matroxfb_g450.c     2004-11-14 23:03:32.431170200 +0300
@@ -237,7 +237,8 @@
       int mnp;
       int over;

-       r->regs[0x80] = 0x03;   /* | 0x40 for SCART */
+       r->regs[0x80] = 0x01 | 0x40;    /* for PAL mode;  | 0x40 for SCART */

       hvis = ((mt->HDisplay << 1) + 3) & ~3;


--- matroxfb_DAC1064.c.orig     2004-10-25 21:13:33.000000000 +0400
+++ matroxfb_DAC1064.c  2004-10-25 21:19:34.000000000 +0400
@@ -329,7 +329,7 @@
               outDAC1064(PMINFO 0x20, 0x04);
               outDAC1064(PMINFO 0x1F, ACCESS_FBINFO(devflags.dfp_type));
               if (ACCESS_FBINFO(devflags.g450dac)) {
-                       outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC);
+                       outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC & 0x0F);       /* & 0x0F for SCART */
                       outDAC1064(PMINFO M1064_XPWRCTRL, hw->DACreg[POS1064_XPWRCTRL]);
                       outDAC1064(PMINFO M1064_XPANMODE, hw->DACreg[POS1064_XPANMODE]);
                       outDAC1064(PMINFO M1064_XOUTPUTCONN, hw->DACreg[POS1064_XOUTPUTCONN]);


Patch # 3. BRIGHT picture on TV. I could not get normal brightness before.

--- linux-2.6.9-orig/drivers/video/matrox/matroxfb_DAC1064.c	2004-10-19 01:54:07.000000000 +0400
+++ linux-2.6.9/drivers/video/matrox/matroxfb_DAC1064.c	2005-01-01 19:49:30.036054216 +0300
@@ -321,6 +321,7 @@
 }
 
 void DAC1064_global_restore(WPMINFO2) {
+          u_int8_t b;
 	struct matrox_hw_state* hw = &ACCESS_FBINFO(hw);
 
 	outDAC1064(PMINFO M1064_XPIXCLKCTRL, hw->DACreg[POS1064_XPIXCLKCTRL]);
@@ -329,6 +330,12 @@
 		outDAC1064(PMINFO 0x20, 0x04);
 		outDAC1064(PMINFO 0x1F, ACCESS_FBINFO(devflags.dfp_type));
 		if (ACCESS_FBINFO(devflags.g450dac)) {
+			//gives way brighter TV-out picture
+			b = inDAC1064(PMINFO M1064_XGENIODATA) & ~0x40;
+			outDAC1064(PMINFO M1064_XGENIODATA, b);
+			b = inDAC1064(PMINFO M1064_XGENIOCTRL) | 0x40;
+			outDAC1064(PMINFO M1064_XGENIOCTRL, b);
+
 			outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC);
 			outDAC1064(PMINFO M1064_XPWRCTRL, hw->DACreg[POS1064_XPWRCTRL]);
 			outDAC1064(PMINFO M1064_XPANMODE, hw->DACreg[POS1064_XPANMODE]);



See also