PDA

View Full Version : bad display resolution: invalid EDID, alternative fix



xtree
8th December 2013, 04:34 PM
I have an old Viewsonic monitor (VX1940w circa '08) and it does not properly pass EDID information to Linux (in this case F19). I saw previous write-ups outlining how to create a new Xorg.conf file. I was more interested in how the new Linux display infrastructure worked (KSM Kernel Mode Setting), and if you could use this.

After a bit of searching I found a couple of guides and pieced them together to come up with this for F19. I'm sure it would work in other releases.

Here are the simple steps to use a pre-built edid.. I su'd to root for this process..

install kernel-doc package: yum install kernel-doc -y
cd to /usr/share/doc/kernel-doc-<version>/Documentation/EDID
do a ls to make sure there is a mode you are looking for. In my case there was, 1680x1050.c
if one doesn't exist look at the HOWTO.txt file on creating a custom mode file
once you have a good mode file simple type make in the while in the EDID directory
copy the proper .bin file to /lib/firmware/edid (you might have to make the directory)
edit /etc/default/grub and add drm_kms_helper.edid_firmware=<your connection>:edid/<your_mode>.bin
mine looks like this: drm_kms_helper.edid_firmware=VGA-1:edid/1680x1050.bin
the full line in grub: GRUB_CMDLINE_LINUX="rd.lvm.lv=rwvg/usr rd.dm=0 rd.lvm.lv=rootvg/root vconsole.keymap=us $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || (colon0x58 close-elipse0x41) rd.md=0 rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet drm_kms_helper.edid_firmware=VGA-1:edid/1680x1050.bin"
make a new grub.cfg file: grub2-mkconfig -o /boot/grub2/grub.cfg
if you are using an EFI system run: grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
reboot and enjoy your new screen resolution

Some tools to help:

xrandr - run this while X is running to see what connection you are using. Example

xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
VGA1 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.0*
800x600 60.3 56.2
848x480 60.0
640x480 59.9
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

you can see I'm using VGA1. To get the kernel name run: ls -l /sys/class/drm
output:
ls -l /sys/class/drm
total 0
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-DP-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-DP-2 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-2
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-DP-3 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-3
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-HDMI-A-2 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-HDMI-A-3 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-3
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 card0-VGA-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-VGA-1
lrwxrwxrwx. 1 root root 0 Dec 8 08:45 controlD64 -> ../../devices/pci0000:00/0000:00:02.0/drm/controlD64
-r--r--r--. 1 root root 4096 Dec 8 08:45 version


Before you test you can try new mode lines:

First you need to create a modeline using cvt in my case 1680x1050 60Hz.

cvt 1680 1050 60

output:
cvt 1680 1050 60
# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

create a new xrandr modeline:

xrandr --newmode 1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

add modeline to xrandr:

xrandr --addmode VGA1 1680x1050

activate the modeline:

xrandr --output VGA1 --mode 1680x1050

To check edid:

monitor-parse-edid /sys/class/drm/card0-VGA-1/edid

output in my case before the fix:

sys/class/drm/card0-VGA-1/edid: bad edid

output after fix:

Name: Linux WSXGA
EDID version: 1.3
EDID extension blocks: 0
Screen size: 43.0 cm x 27.0 cm (19.99 inches, aspect ratio 16/10 = 1.60)
Gamma: 2.2
Analog signal
Max video bandwidth: 150 MHz

HorizSync 64-66
VertRefresh 59-61

# Monitor preferred modeline (60.0 Hz vsync, 65.3 kHz hsync, ratio 16/10, 99 dpi)
ModeLine "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 +hsync +vsync

Check boot to make sure the grub changes took:

dmesg | grep Kernel

output:

[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.11.10-200.fc19.x86_64 root=/dev/mapper/rootvg-root ro rd.lvm.lv=rwvg/usr rd.dm=0 rd.lvm.lv=rootvg/root vconsole.keymap=us rd.md=0 rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet drm_kms_helper.edid_firmware=VGA-1:edid/1680x1050.bin

Hope this helps someone else..