Matrox G200eW 1920x1200 resolution on Ubuntu 16.04

Recipe for Matrox G200eW 1920x1200 resolution on Ubuntu 16.04. (Note: Needs patch for Xorg, not easy for beginners)

I am using X9SCM-F with built-in VGA controller and IPMI. Only x8 PCIe slots on this motherboard. My path is laid out below, I did not retry all of this once got it working. The resolution is most likely restricted for KVM to work. I am not interested on monitor redirection on this system, I use this system as workstation.

I use 16bpp bit depth on Xserver and seems to work.

The patch workings are courtesy of Samir Ibradzic. Credits to other authors whose writings helped me figure this out.
https://lists.x.org/archives/xorg-devel/2012-January/028523.html

The patch is for this specific PCI identifier controller in driver source,
pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI);{ PCI_CHIP_MGAG200_WINBOND_PCI,     "mgag200 eW Nuvoton" },

 $ lspci -s 03:03.0
03:03.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a)

This MB has 16320kByte Video RAM.
[  1755.547] (==) MGA(0): Using SW cursor
[  1755.547] (--) MGA(0): Linear framebuffer at 0xFA000000
[  1755.547] (--) MGA(0): MMIO registers at 0xFB800000
[  1755.547] (--) MGA(0): Pseudo-DMA transfer window at 0xFB000000
[  1755.547] (II) MGA(0): MAPPED Framebuffer FA000000 800000 to 7F3306722000.
[  1755.547] (II) MGA(0): UNMAPPING framebuffer 0x7F3306722000, 0x800000.
[  1755.548] (II) MGA(0): MAPPED Framebuffer FA000000 1000000 to 7F3305F22000.
[  1755.619] (II) MGA(0): UNMAPPING framebuffer 0x7F3305F22000, 0x1000000.
[  1755.619] (**) MGA(0): Depth 16, (--) framebuffer bpp 16
[  1755.619] (==) MGA(0): RGB weight 565
[  1755.619] (**) MGA(0): Enabling KVM
[  1755.619] (==) MGA(0): Using AGP 1x mode
[  1755.619] (==) MGA(0): Using XAA acceleration
[  1755.620] (--) MGA(0): Video BIOS info block at offset 0x07D60
[  1755.620] (==) MGA(0): VideoRAM: 16320 kByte


My environment
$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:    xenial 

Purge HWE and install xserver-xorg and mga driver:
apt-get install --purge xserver-xorg-hwe-16.04- xserver-xorg xserver-xorg-video-mga
apt-get install xserver-xorg-video-all

Install matrox driver sources:
mkdir xserver
cd xserver
apt-get source xserver-xorg-video-mga
apt-get install dh-autoreconf xserver-xorg-dev x11proto-video-dev x11proto-fonts-dev x11proto-xf86dri-dev quilt xutils-dev

Apply fix:
diff -ur xserver-xorg-video-mga_orig/src/mga_driver.c xserver-xorg-video-mga-1.6.4/src/mga_driver.c
--- xserver-xorg-video-mga_orig/src/mga_driver.c    2015-02-19 21:51:35.000000000 +0200
+++ xserver-xorg-video-mga-1.6.4/src/mga_driver.c    2018-04-16 14:42:47.036398716 +0300
@@ -3837,12 +3837,16 @@
     } else if (pMga->is_G200WB){
         if (mode->Flags & V_DBLSCAN)
             return MODE_NO_DBLESCAN;
-    if (pMga->KVM && mode->HDisplay > 1280)
-        return MODE_VIRTUAL_X;
-    if (pMga->KVM && mode->VDisplay > 1024)
-        return MODE_VIRTUAL_Y;
-    if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77)
-        return MODE_BANDWIDTH;
+    /*
+      if (pMga->KVM && mode->HDisplay > 1280)
+      return MODE_VIRTUAL_X;
+      if (pMga->KVM && mode->VDisplay > 1024)
+      return MODE_VIRTUAL_Y;
+      if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 318.77)
+      return MODE_BANDWIDTH;
+    */
+    if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 550)
+      return MODE_BANDWIDTH;
     } else if (pMga->is_G200EV
            && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) {
     return MODE_BANDWIDTH;

Build:
dpkg-buildpackage -uc -us

Remove previous package and install new:
cd ..

dpkg --purge xserver-xorg-video-mga
dpkg -i xserver-xorg-video-mga_1.6.4-1build2_amd64.deb

Configure X:
X -configure
cp xorg.conf.new /usr/share/X11/xorg.conf.d/10-video.conf
 
Blacklist framebuffers vesa and mgag200:

 $ cat /etc/modprobe.d/blacklist-framebuffer.conf
# Framebuffer drivers are generally buggy and poorly-supported, and cause
# suspend failures, kernel panics and general mayhem.  For this reason we
# never load them automatically.
blacklist aty128fb
blacklist atyfb
blacklist bochs-drm
blacklist radeonfb
blacklist cirrusfb
blacklist cyber2000fb
blacklist cyblafb
blacklist gx1fb
blacklist hgafb
blacklist i810fb
blacklist intelfb
blacklist kyrofb
blacklist lxfb
blacklist matroxfb_base
blacklist neofb
blacklist nvidiafb
blacklist pm2fb
blacklist rivafb
blacklist s1d13xxxfb
blacklist savagefb
blacklist sisfb
blacklist sstfb
blacklist tdfxfb
blacklist tridentfb
blacklist vesafb
blacklist vfb
blacklist viafb
blacklist vt8623fb
blacklist udlfb
blacklist mgag200

Update initrd (modules loade at bootup stage) and grub2 (bootloader),
update-initramfs -u
update-grub2

Reboot.

lsmod should not show mgag200.

Configure X:

Not sure if this is needed, or was the X server rebuild the root cause.

X -configure
cp xorg.conf.new /usr/share/X11/xorg.conf.d/10-video.conf
 
Apply modifications for 1920x1200 to Xorg configuration:

Not sure if this is needed, or was the X server rebuild the root cause.

This modeline is from my Xorg log file, from my monitor EDID data.

[  1755.678] (II) MGA(0): Monitor name: DELL U2410
..
[  1756.008] (II) MGA(0): EDID vendor "DEL", prod id 61460
[  1756.008] (II) MGA(0): Using hsync ranges from config file
[  1756.008] (II) MGA(0): Using vrefresh ranges from config file
[  1756.008] (II) MGA(0): Printing DDC gathered Modelines:
[  1756.008] (II) MGA(0): Modeline "1920x1200"x0.0  154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync (74.0 kHz eP)
 $ diff xorg.conf.new /usr/share/X11/xorg.conf.d/10-video.conf
44a45,46
>     Option        "PreferredMode" "1920x1200"
>     Modeline "1920x1200_2" 154.00  1920 1968 2000 2080  1200 1203 1209 1235 +hsync -vsync
111a114,115
> #        Modes "1920x1200"
> #        Virtual 1920 1200
115a120,121
>         Modes "1920x1200_2"
>         Virtual 1920 1200
119a126,127
>         Modes "1920x1200_2"
>         Virtual 1920 1200
122a131
>     DefaultDepth 16

Apply monitor resolution 1920x1200 for ligthdm:

Not sure if this is needed, or was the X server rebuild the root cause.

# cat /var/lib/lightdm/.config/monitors.xml
<monitors version="1">
  <configuration>
      <clone>no</clone>
      <output name="default">
          <vendor>???</vendor>
          <product>0x0000</product>
          <serial>0x00000000</serial>
          <width>1920</width>
          <height>1200</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
  </configuration>
</monitors>

Note: need to restart lightdm
service lightdm restart

Result:
Working 1920x1200.

$ xrandr
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 400, current 1920 x 1200, maximum 1920 x 1200
default connected primary 1920x1200+0+0 0mm x 0mm
   1920x1200     60.00*
   1600x1200     60.00 
   1680x1050     70.00    60.00 
   1400x1050     75.00    70.00    60.00 
   1280x1024     75.00    60.00 
   1440x900      60.00 
   1280x960      60.00 
   1360x768      60.00 
   1152x864      75.00    70.00    60.00 
   1024x768      75.00    60.00    70.00 
   832x624       75.00 
   800x600       75.00    60.00    72.00    56.00 
   640x480       75.00    60.00    73.00 
   720x400       70.00

 $ xdpyinfo |less
...
 screen #0:
  dimensions:    1920x1200 pixels (524x321 millimeters)
  resolution:    93x95 dots per inch
  depths (7):    16, 1, 4, 8, 15, 24, 32
  root window id:    0x1aa
  depth of root window:    16 planes






For additional debugging:
# cat /var/log/Xorg.0.log

Kommentit

Tämän blogin suosituimmat tekstit

Docker CUDA Runtime

Ubiquity Robotics ROS image