On Fri, Oct 28, 2005 at 02:07:40PM +0200, Attilio Fiandrotti wrote:
> (!) matrox device: 01 02 00 102b 051a fdfec000 fe000000
> (!) myst220: fdfec000 fe000000 fe000000

Ok it's actually a normal mystique but the code thought it to be a 220. 
Patch attached.

That probably isn't enough to make it work though. It's missing byte 
swapping on register access. So I've attached another patch which should 
fix that bit.

-- 
Ville Syrjälä
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
Index: matrox.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox.c,v
retrieving revision 1.87
diff -u -r1.87 matrox.c
--- matrox.c    26 Oct 2005 07:33:08 -0000      1.87
+++ matrox.c    28 Oct 2005 12:23:08 -0000
@@ -1767,7 +1767,7 @@
 
           case PCI_DEVICE_ID_MATROX_1064SG_PCI:
           case PCI_DEVICE_ID_MATROX_1064SG_AGP:
-               if ((pci_config_in32( *bus, *slot, *func, 0x08 ) & 0xFF) >= 
0x02) {
+               if ((pci_config_in32( *bus, *slot, *func, 0x08 ) & 0xFF) > 
0x02) {
                     /* Mystique 220 (1164SG) */
                     if (addr0 == mdev->fb.physical) {
                          fclose( file );
Index: gfxdrivers/matrox/mmio.h
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/mmio.h,v
retrieving revision 1.15
diff -u -r1.15 mmio.h
--- gfxdrivers/matrox/mmio.h    19 Mar 2004 10:46:17 -0000      1.15
+++ gfxdrivers/matrox/mmio.h    25 Oct 2005 02:39:17 -0000
@@ -41,7 +41,11 @@
 static inline void
 mga_out32(volatile __u8 *mmioaddr, __u32 value, __u32 reg)
 {
+#ifdef __powerpc__
+     asm volatile("stwbrx %0,%1,%2;eieio" : : "r"(value), "b"(reg), 
"r"(mmioaddr) : "memory");
+#else
      *((volatile __u32*)(mmioaddr+reg)) = value;
+#endif
 }
 
 static inline __u8
@@ -53,7 +57,15 @@
 static inline __u32
 mga_in32(volatile __u8 *mmioaddr, __u32 reg)
 {
+#ifdef __powerpc__
+     __u32 value;
+
+     asm volatile("lwbrx %0,%1,%2;eieio" : "=r"(value) : "b"(reg), 
"r"(mmioaddr));
+
+     return value;
+#else
      return *((volatile __u32*)(mmioaddr+reg));
+#endif
 }
 
 /* Wait for idle accelerator and DMA */
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to