Open Source Automation Development Lab
You are here: Home / OSADL / News / 
2014-04-17 - 12:12

Next OSADL Events:

Breaking News:

2014-04-09 12:00

First LCA certificate issued

Major automation provider passed OSADL License Compliance Audit


2014-01-20 12:00

Good news from OIN

The Linux Defense Department


2013-11-06 12:00

SIL2LinuxMP ...

why Open Source/Open Proof is the right way to go for safety



2012-03-31 12:00 Age: 2 Years

Kernel Mode Setting (KMS) is great, but may not work as expected

By: Carsten Emde

Here comes your EDID repair kit

Scrambled monitor screen

It sounds like a splendid idea: Define a protocol that contains the complete information a graphics adapter needs to correctly drive a monitor, standardize this protocol as Extended Display Identification Data (EDID), use the monitor cable to transmit this information to the graphics adapter and let every monitor work with every graphics adapter auto-magically.

Unfortunately, the wonders of modern computing do not always go that far, and the monitor still may not be recognized, because

  • the monitor
    • sends no data
    • sends invalid data
    • sends wrong data
  • a KVM switch or video converter
    • does not forward the monitor data
    • sends its own instead of the monitor's data
    • corrupts the monitor data
  • the graphics adapter
    • is unable to receive the data
    • is unable to correctly forward the data
  • any combination of the above applies.

Duh, is computer hardware and firmware really that broken? Yes, it is. And Open Source does not help to improve it, since the monitor uses a proprietary system that still is not free as in freedom.

In the good old days when the X server had its own configuration file and the Linux kernel used standard VGA commands to write to the console, lacking data could be supplied and wrong data repaired manually. With the advent of Kernel Mode Setting (KMS), the Linux kernel takes care of the initialization of the graphics adapter - in consequence, correct monitor data must be available to the kernel already while booting; the screen remains dark, otherwise. But since there is no configuration file, everything is based on the correct transmission of the EDID data set. The only solution was to completely disable KMS, but this disables accelerated graphics altogether.

Ignore bogus EDID data

The real solution is, thus, to optionally disable probing of the monitor and to directly feed appropriate monitor data into the kernel. For this purpose, the kernel configuration item CONFIG_DRM_LOAD_EDID_FIRMWARE was introduced. If enabled, the drm_kms_helper module will accept the parameter edid_firmware=, search for the given file in the /lib/firmware directory and use its data, if valid, to initialize the monitor timings of the graphics adapter as if it had been received from the monitor. Four standard timings are hard-coded in the driver and available immediately:

  Resolution  

  Name  

  1024x768/60 Hz 

  edid/1024x768.bin  

  1280x1024/60 Hz 

  edid/1280x1024.bin  

  1680x1050/60 Hz 

  edid/1680x1050.bin  

  1920x1080/60 Hz 

  edid/1920x1080.bin  

To force, for example, a screen resolution of 1280x1024/60 Hz, simply remove nomodeset from, add drm_kms_helper.edid_firmware=edid/1280x1024.bin to the kernel command, and enjoy a much faster screen and all the eye candy you missed so long.

Build your own EDID data

Some monitors, however, may require specific settings and do not work with the hard-coded standard data sets. Therefore, template source code and a make environment to build your own EDID data are available in the Documentation/EDID directory of the Linux kernel tree. There is also an instruction HOWTO.txt.

This feature is available in the vanilla kernel as of version 3.4, but the related patch can be applied - with some offsets - to kernel versions 3.2 and 3.3 as well.

How to force enabling or disabling a connector?

Two more nasty problems are related to the above EDID story: A connector may detect a monitor although there is none, or a connector fails to detect a monitor although there is one. Fortunately, there are less known additions to the video= kernel parameter exactly for this purpose. Remember that the video= parameter may - unlike other parameters - occur more than once. To disable a connector simply specify the name of the connector followed by ":d", to enable it use the suffix ":e". The kernel parameters video=LVDS-1:d video=VGA-1:e drm_kms_helper.edid_firmware=edid/1280x1024.bin, for example, will disable an erroneously recognized LVDS panel, force the initialization of the VGA port and use a 1280x1024/60 Hz mode line for it. Please note that the connectors are named differently in the kernel and X11. So it is a good idea to always refer to the kernel messages and not to the X server log files when searching for the name of a particular connector. The system that needs the above kernel parameters uses, for example, the following names:

  Kernel connector name 

  X11 connector name 

  LVDS-1 

  LVDS1 

  VGA-1 

  VGA1 

  HDMI-1 

  HDMI1 

  HDMI-2 

  HDMI2 

  DP-1 

  DP1 

  DP-2 

  DP2 

One can only hope that kernel and X11 developers will come together soon and agree on a common name scheme of connectors.