2013-09-30

LCD display optimized video mode: CVT-R & Linux

Many modern LCD displays (ones with 60 Hz vertical refresh frequency) should support an improved video mode with reduced blanking intervals (CVT-R), which can save some signal bandwidth and reduce the cost of the cabling (sometimes you can use a single-link DVI / HDMI cable instead of a dual-link one to support some of the high-definition resolutions; due to reduced signal bandwidth, a longer, cheaper cable with a non-perfect shielding can be used with reduced risk of electromagnetic interference).
Unfortunately, the best mode sometimes can be missing from the display's EDID ("extended display identification data" accessed by computer through DDC), so your computer won't be able set the best mode automatically, and you'll need to do some manual configuration.
(The sample commands are for Debian GNU/Linux 7.0 "Wheezy", but should work for many other systems).
  1. First of all, find out the native resolution (e. g., 1920 x 1080) and refresh rate (should be a multiple of 60 Hz: 60 Hz, 120 Hz etc.) for your display.
  2. Try to calculate a suitable video mode string using cvt utility (from the xserver-xorg-core Debian package); 60 Hz is the default refresh rate, so it can be omitted:
    $ cvt -r 1920 1080
    # 1920x1080 59.93 Hz (CVT 2.07M9-R) hsync: 66.59 kHz; pclk: 138.50 MHz
    Modeline "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
    $ cvt -r 1920 1080 120
    # 1920x1080 119.88 Hz (CVT) hsync: 137.14 kHz; pclk: 285.25 MHz
    Modeline "1920x1080R"  285.25  1920 1968 2000 2080  1080 1083 1088 1144 +hsync -vsync
  3. Check the current video mode of your display through the display's menu (and write down those values somewhere for reference). If the actual clock values are higher than calculated by cvt, then it's reasonable to test the freshly calculated video mode.
  4. For quick video mode changes, you can use xrandr utility (from the x11-xserver-utils Debian package):
    $ xrandr
    Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
    DVI1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 456mm x 123mm
       1920x1080      60.0*+ 
       1024x768       60.0  
       800x600        60.3     56.2  
       640x480        59.9  
    VGA1 disconnected (normal left inverted right x axis y axis)
    HDMI1 disconnected (normal left inverted right x axis y axis)
    $ xrandr --output DVI1 --mode 800x600
    $ xrandr --newmode "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
    $ xrandr --addmode DVI1 1920x1080R
    $ xrandr --output DVI1 --mode 1920x1080R
    
  5. For permanent effect, you'll need to change X11 settings by putting the generated modeline into the proper section of the /etc/X11/xorg.conf config file:
    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Vendor1"
        ModelName      "Model2"
        HorizSync       30.0 - 150.0
        VertRefresh     50.0 - 160.0
        Option         "DPMS" "true"
        Modeline       "1920x1080R"  138.50  1920 1968 2000 2080  1080 1083 1088 1111 +hsync -vsync
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Monitor        "Monitor0"
        DefaultDepth    24
        SubSection     "Display"
            Depth       24
            Modes      "1920x1080R"
        EndSubSection
    EndSection
    Don't forget to restart the X server for updated configuration to take effect.
  6. The video mode for Linux console probably can be changed using KMS (kernel mode setting); there's some good info about KMS settings on nouveau Wiki.

See also: