Hi Alan, hi others,
  source of problems with matroxfb on G450 was revealed: BIOS forgets
to initialize ZORG (0x1C0C) register, and although matroxfb does not use
it, it must contain reasonable value, as it was proved that otherwise it
does not work...
  Patch contains:
1) matroxfb_DAC1064.c: changed copyright header of file to point you
   to matroxfb_base.c for complete listing, plus increased version number
2) matroxfb_DAC1064.c: initialize ZORG on G450
3) matroxfb_base.c: increase version number
4) matroxfb_base.c, matroxfb_base.h: move global_disp to matroxfb_base.c,
   otherwise matroxfb does not compile with -fno-common without multihead
5) matroxfb_base.h: simplify (remove) source code. GCC is clueful enough
   to found that it should check %al instead of %eax & 0xFF, and on some
   little endian architectures (alpha) inl is much better than inb... Also
   matrox recommends always using 32bit accesses, so...
  Patch is for 2.4.0-ac1, but important part (second hunk of DAC1064.c)
should apply to any kernel which has G450 support.
  Alan, I'm sending it to you and not to Linus, as ac1 contains newer
matroxfb than Linus tree and doing otherwise would make your work harder
without any reason. But please make sure that Linus's 2.4.2 will contain
this fix.
                                            Thanks,
                                                Petr Vandrovec
                                                [EMAIL PROTECTED]


diff -urdN linux/drivers/video/matrox/matroxfb_DAC1064.c 
linux/drivers/video/matrox/matroxfb_DAC1064.c
--- linux/drivers/video/matrox/matroxfb_DAC1064.c       Fri Dec 29 22:07:23 2000
+++ linux/drivers/video/matrox/matroxfb_DAC1064.c       Fri Feb  2 17:30:42 2001
@@ -1,81 +1,12 @@
 /*
  *
- * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400
- *
- * (c) 1998,1999,2000 Petr Vandrovec <[EMAIL PROTECTED]>
- *
- * Version: 1.50 2000/08/10
- *
- * MTRR stuff: 1998 Tom Rini <[EMAIL PROTECTED]>
- *
- * Contributors: "menion?" <[EMAIL PROTECTED]>
- *                     Betatesting, fixes, ideas
- *
- *               "Kurt Garloff" <[EMAIL PROTECTED]>
- *                     Betatesting, fixes, ideas, videomodes, videomodes timmings
- *
- *               "Tom Rini" <[EMAIL PROTECTED]>
- *                     MTRR stuff, PPC cleanups, betatesting, fixes, ideas
- *
- *               "Bibek Sahu" <[EMAIL PROTECTED]>
- *                     Access device through readb|w|l and write b|w|l
- *                     Extensive debugging stuff
- *
- *               "Daniel Haun" <[EMAIL PROTECTED]>
- *                     Testing, hardware cursor fixes
- *
- *               "Scott Wood" <[EMAIL PROTECTED]>
- *                     Fixes
- *
- *               "Gerd Knorr" <[EMAIL PROTECTED]>
- *                     Betatesting
- *
- *               "Kelly French" <[EMAIL PROTECTED]>
- *               "Fernando Herrera" <[EMAIL PROTECTED]>
- *                     Betatesting, bug reporting
- *
- *               "Pablo Bianucci" <[EMAIL PROTECTED]>
- *                     Fixes, ideas, betatesting
- *
- *               "Inaky Perez Gonzalez" <[EMAIL PROTECTED]>
- *                     Fixes, enhandcements, ideas, betatesting
- *
- *               "Ryuichi Oikawa" <[EMAIL PROTECTED]>
- *                     PPC betatesting, PPC support, backward compatibility
- *
- *               "Paul Womar" <[EMAIL PROTECTED]>
- *               "Owen Waller" <[EMAIL PROTECTED]>
- *                     PPC betatesting
- *
- *               "Thomas Pornin" <[EMAIL PROTECTED]>
- *                     Alpha betatesting
- *
- *               "Pieter van Leuven" <[EMAIL PROTECTED]>
- *               "Ulf Jaenicke-Roessler" <[EMAIL PROTECTED]>
- *                     G100 testing
- *
- *               "H. Peter Arvin" <[EMAIL PROTECTED]>
- *                     Ideas
- *
- *               "Cort Dougan" <[EMAIL PROTECTED]>
- *                     CHRP fixes and PReP cleanup
- *
- *               "Mark Vojkovich" <[EMAIL PROTECTED]>
- *                     G400 support
- *
- *               "Ken Aaker" <[EMAIL PROTECTED]>
- *                     memtype extension (needed for GXT130P RS/6000 adapter)
- *
- * (following author is not in any relation with this code, but his code
- *  is included in this driver)
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
  *
- * Based on framebuffer driver for VBE 2.0 compliant graphic boards
- *     (c) 1998 Gerd Knorr <[EMAIL PROTECTED]>
+ * (c) 1998-2001 Petr Vandrovec <[EMAIL PROTECTED]>
  *
- * (following author is not in any relation with this code, but his ideas
- *  were used when writting this driver)
+ * Version: 1.52 2001/02/02
  *
- *              FreeVBE/AF (Matrox), "Shawn Hargreaves" <[EMAIL PROTECTED]>
+ * See matroxfb_base.c for contributors.
  *
  */
 
@@ -787,6 +718,11 @@
 
        ACCESS_FBINFO(primout) = &m1064;
 
+       if (ACCESS_FBINFO(devflags.g450dac)) {
+               /* we must do this always, BIOS does not do it for us
+                  and accelerator dies without it */
+               mga_outl(0x1C0C, 0);
+       }
        if (ACCESS_FBINFO(devflags.noinit))
                return 0;
        hw->MXoptionReg &= 0xC0000100;
diff -urdN linux/drivers/video/matrox/matroxfb_base.c 
linux/drivers/video/matrox/matroxfb_base.c
--- linux/drivers/video/matrox/matroxfb_base.c  Thu Feb  1 21:27:20 2001
+++ linux/drivers/video/matrox/matroxfb_base.c  Fri Feb  2 17:39:25 2001
@@ -4,7 +4,7 @@
  *
  * (c) 1998-2001 Petr Vandrovec <[EMAIL PROTECTED]>
  *
- * Version: 1.51 2001/01/25
+ * Version: 1.52 2001/02/02
  *
  * MTRR stuff: 1998 Tom Rini <[EMAIL PROTECTED]>
  *
@@ -2005,6 +2005,7 @@
        u_int32_t cmd;
 #ifndef CONFIG_FB_MATROX_MULTIHEAD
        static int registered = 0;
+       static struct display global_disp;
 #endif
        DBG("matroxfb_probe")
 
diff -urdN linux/drivers/video/matrox/matroxfb_base.h 
linux/drivers/video/matrox/matroxfb_base.h
--- linux/drivers/video/matrox/matroxfb_base.h  Fri Dec 29 22:07:23 2000
+++ linux/drivers/video/matrox/matroxfb_base.h  Fri Feb  2 17:43:02 2001
@@ -589,7 +589,6 @@
 #else
 
 extern struct matrox_fb_info matroxfb_global_mxinfo;
-struct display global_disp;
 
 #define ACCESS_FBINFO(x) (matroxfb_global_mxinfo.x)
 #define ACCESS_FBINFO2(info, x) (matroxfb_global_mxinfo.x)
@@ -787,11 +786,7 @@
 #define mga_setr(addr,port,val) do { mga_outb(addr, port); mga_outb((addr)+1, val); } 
while (0)
 #endif
 
-#ifdef __LITTLE_ENDIAN
-#define mga_fifo(n)    do {} while (mga_inb(M_FIFOSTATUS) < (n))
-#else
 #define mga_fifo(n)    do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n))
-#endif
 
 #define WaitTillIdle() do {} while (mga_inl(M_STATUS) & 0x10000)
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to