Bug 151306

Summary: [Matrox/MGA] Graphics corruption on Matrox Mystique (mga1064sg)
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Whay-Wang Teo <wwteo>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P2 - High CC: eich
Version: Stable GCC Snapshot1   
Target Milestone: ---   
Hardware: x86-64   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: The Xorg0.log file
Driver for testing (i386)
Driver for testing (x86_64)

Description Whay-Wang Teo 2006-02-15 21:08:39 UTC
Hi,

I have the same bug that is the same as on https://bugs.freedesktop.org/show_bug.cgi?id=2168

I'm not sure if I'm using the same version of X11 but I am basically running the MGA driver with the option NoAccel to avoid screen corruption.

Section "Device"
  BoardName    "MGA 1064SG"
  BusID        "2:5:0"
  Driver       "mga"
  Identifier   "Device[0]"
  Option       "NoAccel"
  Option       "NoHal"
  VendorName   "Matrox"
EndSection

hwinfo --gfx

27: PCI 205.0: 0300 VGA compatible controller (VGA)
  [Created at pci.277]
  UDI: /org/freedesktop/Hal/devices/pci_102b_51a
  Unique ID: ZcKW.NpvNdcatjy1
  Parent ID: _Znp.Xi7km9jxxp1
  SysFS ID: /devices/pci0000:00/0000:00:02.0/0000:02:05.0
  SysFS BusID: 0000:02:05.0
  Hardware Class: graphics card
  Model: "Illegal Vendor ID MGA 1064SG [Mystique]"
  Vendor: pci 0x102b "Matrox Graphics, Inc."
  Device: pci 0x051a "MGA 1064SG [Mystique]"
  SubVendor: pci 0xffff "Illegal Vendor ID"
  SubDevice: pci 0xffff
  Revision: 0x02
  Memory Range: 0xfeafc000-0xfeafffff (rw,non-prefetchable)
  Memory Range: 0xf5000000-0xf57fffff (rw,prefetchable)
  Memory Range: 0xfe000000-0xfe7fffff (rw,non-prefetchable)
  Memory Range: 0xf4800000-0xf480ffff (ro,prefetchable,disabled)
  IRQ: 10 (no events)
  I/O Ports: 0x3c0-0x3df (rw)
  Module Alias: "pci:v0000102Bd0000051Asv0000FFFFsd0000FFFFbc03sc00i00"
  Driver Info #0:
    XFree86 v4 Server Module: mga
    Color Depths: 8, 16, 24
    Extensions:
    Options: NoHal
  Config Status: cfg=yes, avail=yes, need=yes, active=unknown
  Attached to: #12 (PCI bridge)

Primary display adapter: #27
Comment 1 Stefan Dirsch 2006-02-15 22:00:27 UTC
Hmm. I'll try to reproduce this. BTW

revision 1.6
date: 2004-08-13 20:24:08 +0200;  author: sandmann;  state: Exp;  lines: +2 -2;
Fri Aug 13 19:53:10 2004  Soeren Sandmann  <sandmann@redhat.com>

        * programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c
        (MGAStormSync): Fix for lockups on some versions of Matrox
        Mystique. #687, Patch from Mike Harris.

cvs diff -u -r1.5 -r1.6 mga_storm.c 
Index: mga_storm.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mga_storm.c 3 Aug 2004 08:52:16 -0000       1.5
+++ mga_storm.c 13 Aug 2004 18:24:08 -0000      1.6
@@ -1076,8 +1076,8 @@
 
     CHECK_DMA_QUIESCENT(pMga, pScrn);
 
-    /* This reportedly causes a freeze for the Mystique. */
-    if (pMga->Chipset != PCI_CHIP_MGA1064)
+    /* MGAISBUSY() reportedly causes a freeze for Mystique revision 2 and older */
+    if (!(pMga->Chipset == PCI_CHIP_MGA1064 && (pMga->ChipRev >= 0 && pMga->ChipRev <= 2)))
        while(MGAISBUSY());
     /* flush cache before a read (mga-1064g 5.1.6) */
     OUTREG8(MGAREG_CRTC_INDEX, 0);
Comment 2 Stefan Dirsch 2006-02-15 22:07:14 UTC
Could you add /var/log/Xorg.0.log? Thanks.
Comment 4 Whay-Wang Teo 2006-02-17 07:31:13 UTC
Created attachment 68963 [details]
The Xorg0.log file

Thanks for looking through the bug
Comment 5 Stefan Dirsch 2006-02-17 07:37:47 UTC
> (--) PCI:*(2:5:0) Matrox Graphics, Inc. MGA 1064SG [Mystique] rev 2, ...

So changing it to "... pMga->ChipRev < 2)" might indeed help. I'll attach you a driver for testing later.

Comment 6 Stefan Dirsch 2006-02-17 11:24:13 UTC
Created attachment 69015 [details]
Driver for testing (i386)

Please give it a try (copy it to 
/usr/X11R6/lib/modules/drivers/).
Comment 7 Stefan Dirsch 2006-02-17 11:43:20 UTC
Created attachment 69023 [details]
Driver for testing (x86_64)
Comment 8 Stefan Dirsch 2006-02-17 11:43:59 UTC
Could you please test?
Comment 9 Whay-Wang Teo 2006-02-17 17:42:00 UTC
tested with the sax2 program. the problem is fixed. now i don't need a new graphics card. :-) thanks for the help.
Comment 10 Stefan Dirsch 2006-02-17 17:50:58 UTC
Still needs to be fixed for 10.1.
Comment 11 Whay-Wang Teo 2006-02-17 18:16:26 UTC
hi i forgot to mention that this is in /usr/X11R6/lib64/modules/drivers/ for 64 bit systems

but i guess thats common knowledge. guess this bug fix would be in the future suse X server packages
Comment 12 Stefan Dirsch 2006-02-17 18:24:16 UTC
Yes, of course this is now fixed for all supported architectures since SUSE 10.1.