Bug 11339 - mga 550 locks up when displaying 320x240 mode, frequency too low
Summary: mga 550 locks up when displaying 320x240 mode, frequency too low
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/mga (show other bugs)
Version: 7.2 (2007.02)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-22 13:51 UTC by Brice Goglin
Modified: 2007-07-27 09:20 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Brice Goglin 2007-06-22 13:51:08 UTC
Bug reported today by Benjamin Wong on the Debian BTS, appears with the MGA driver 1.4.6.1 and Xserver 1.3. See the Debian bug for the complete config and log.




The minimum pixel clock is hardcoded to 12MHz in the source code. However, my Matrox G550 locks up when given a mode with a pixel clock less than 16MHz. This is a serious problem because it can happen easily and requires a reboot to fix. (Killing the Xserver and starting a new one from a serial console does not unwedge the video card.)

To reproduce this bug, simply start up X and then use 'xrandr' to change to a mode which has a pixel clock less than 16MHz. For example: 
  xrandr -s 320x240

The modes for which this happen for me are "320x175" (15.75MHz), "320x200" (15.75MHz), and "320x240" (12.60MHz), as shown in these modelines:

(**) MGA(0):  Default mode "320x240": 15.8 MHz, 37.5 kHz, 75.0 Hz (D)
(II) MGA(0): Modeline "320x240"   15.75  320 328 360 420  240 240 242 250 doublescan -hsync -vsync
(**) MGA(0):  Default mode "320x240": 15.8 MHz, 37.9 kHz, 72.8 Hz (D)
(II) MGA(0): Modeline "320x240"   15.75  320 332 352 416  240 244 245 260 doublescan -hsync -vsync
(**) MGA(0):  Default mode "320x240": 12.6 MHz, 31.5 kHz, 60.1 Hz (D)
(II) MGA(0): Modeline "320x240"   12.60  320 328 376 400  240 245 246 262 doublescan -hsync -vsync

Fortunately, it appears that the fix is simple. The line in the
mga_driver.c source code which sets the minimum pixel clock to 12MHz
has a comment next to it saying "XXX Guess, need to check this". 

Here is a patch which I believe will fix the MGA driver. As you can
see, all I did was change the literal from 12MHz to 16MHz.

----8<---- CUT HERE ----8<---- CUT HERE ----8<---- CUT HERE ----

--- src/mga_driver.c.orig	2007-01-08 15:45:22.000000000 -0800
+++ src/mga_driver.c	2007-06-21 07:46:15.000000000 -0700
@@ -1978,7 +1978,7 @@
     /* XXX Set HW cursor use */
 
     /* Set the min pixel clock */
-    pMga->MinClock = 12000;	/* XXX Guess, need to check this */
+    pMga->MinClock = 16000;
     xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Min pixel clock is %d MHz\n",
 	       pMga->MinClock / 1000);
     /*

----8<---- CUT HERE ----8<---- CUT HERE ----8<---- CUT HERE ----

I apologize in advance for not testing this patch out on my own
machine, but I do not have all the dependencies required to recompile
an X driver.
Comment 1 hackerb9 2007-06-23 05:51:18 UTC
Update: Patch has now been tested and works as expected.
Comment 2 Brice Goglin 2007-07-27 09:20:52 UTC
Fixed in 1a1fe837bc114b5f741e87f14bef74803e299c8d


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.