Debian “Jessie” – Fixing monitor resolution

TL;DR: Use a custom EDID to force your monitors to the correct resolution.

  • Download EDID for your monitor from the Internet and/or use a utility to extract it from a working system (eg, Windows)
  • Add configuration lines for your monitor(s) to your xorg.conf

So I got a shiny new NVidia GTX 960 graphics card. Got it up and running under Windows 7 with my twin (at the time; now triple) iiyama AU5131DT monitors. No worries; apart from the fact that Windows / games are stupid when it comes to multiple monitors. But that’s another story.

I eventually managed to boot into Debian again (I _HATE_ systemd. Seriously, the people responsible need .. anyway), updated the nvidia driver and kernel (from jessie-backports), rebooted, and got into KDE.  Except.. the monitors were all running at 1024×768. Their native resolution is 1600×1200, and they were working perfectly happily under Windows.

Long story short, turns out that for some reason the current drivers (352.79-1~bpo8+1) + kernel (4.3+70~bpo8+1) can’t read the EDID data from the monitors.

Following various guides and HOWTOs, I played around with xrandr, cvt, and gtf  utilities for a while, but kept getting the same error:
BadMatch

micha@urutu:~$ cvt 1600 1200 60
# 1600x1200 59.87 Hz (CVT 1.92M3) hsync: 74.54 kHz; pclk: 161.00 MHz
Modeline "1600x1200_60.00"  161.00  1600 1712 1880 2160  1200 1203 1207 1245 -hsync +vsync
micha@urutu:~$ xrandr --newmode "1600x1200_60.00" 161.00 1600 1712 1880 2160 1200 1203 1207 1245 -hsync +vsync
micha@urutu:~$ xrandr --addmode eDP1 1600x1200_60.00
  X Error of failed request: BadMatch (invalid parameter attributes)
  Major opcode of failed request: 140 (RANDR)
  Minor opcode of failed request: 18 (RRAddOutputMode)
  Serial number of failed request: 33
  Current serial number in output stream: 34
I tried adding Modelines into xorg.conf, also to no avail.

Finally I decided to make a custom EDID by booting back into Windows and using the Phoenix EDID Designer (download here). Converted the output file to binary format, added the relevant lines into xorg.conf, restarted X, and bingo, shiny 1600×1200 resolution!

/etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
        Identifier "GeForce GTX 960"
        Driver "nvidia"

        # MKW 2016.03.05 - add custom edid since current drivers don't pick it up
        Option  "CustomEDID" "HDMI-0:/etc/X11/au5131dt_edid.bin; DVI-I-1:/etc/X11/au5131dt_edid.bin; DVI-D-0:/etc/X11/au5131dt_edid.bin"
        Option  "IgnoreEDID"    "false"
        Option  "UseEDID"       "true"
EndSection

Sometimes I really dislike Linux. Today was one of those times.