Table of Contents

What?

Notes on 4k output on Linux. I use Fedora22. Output is

Notes

cvt 3840 2160 13.8  # I added this for testing
cvt 3840 2160 24
cvt 3840 2160 25
cvt 3840 2160 30
cvt 4096 2160 24

### example output:
$ cvt 3840 2160 25
# 3840x2160 24.97 Hz (CVT) hsync: 54.79 kHz; pclk: 278.75 MHz
Modeline "3840x2160_25.00"  278.75  3840 4064 4464 5088  2160 2163 2168 2194 -hsync +vsync
### lets get newest cvt12 which can remove blank lines:
$ wget https://raw.githubusercontent.com/kevinlekiller/cvt_modeline_calculator_12/master/cvt12.c 
$ gcc cvt12.c -O2 -lm -Wall -o cvt12
$ ./cvt12 3840 2160 25 -b
# 3840x2160 @ 25.000 Hz Reduced Blank (CVT) field rate 25.000 Hz; hsync: 54.850 kHz; pclk: 219.40 MHz
Modeline "3840x2160_25.00_rb"  219.40  3840 3888 3920 4000  2160 2183 2188 2194 +hsync -vsync

### now generate modelines for screenmodes which
### might work out for us
$ for i in 25 30 50 60; do \
    ./cvt12 3840 2160 $i -b >>modelines.txt; done
$ for i in 24 25 30; do \
    ./cvt12 4096 2160 $i -b >>modelines.txt; done

### Now we need to configure Xorg with the modelines.
### We can paste these xrandr-lines in a terminal.
$ grep Modeline modelines.txt | \
    sed -e 's,Modeline,xrandr --newmode,'
xrandr --newmode "3840x2160_25.00_rb" 219.40  3840 3888 3920 4000  2160 2183 2188 2194 +hsync -vsync
xrandr --newmode "3840x2160_30.00_rb" 263.28  3840 3888 3920 4000  2160 2183 2188 2194 +hsync -vsync
xrandr --newmode "3840x2160_50.00_rb" 442.20  3840 3888 3920 4000  2160 2183 2188 2211 +hsync -vsync
xrandr --newmode "3840x2160_60.00_rb" 533.28  3840 3888 3920 4000  2160 2183 2188 2222 +hsync -vsync
xrandr --newmode "4096x2160_24.00_rb" 224.61  4096 4144 4176 4256  2160 2183 2193 2199 +hsync -vsync
xrandr --newmode "4096x2160_25.00_rb" 233.97  4096 4144 4176 4256  2160 2183 2193 2199 +hsync -vsync
xrandr --newmode "4096x2160_30.00_rb" 280.77  4096 4144 4176 4256  2160 2183 2193 2199 +hsync -vsync

### Now we need to configure our HDMI1 output for the modes
$ cat modelines.txt |grep Modeline| \
    sed -e 's," .*,",' -e 's,.* ",xrandr --addmode HDMI1 ",'
xrandr --addmode HDMI1 "3840x2160_25.00_rb"
xrandr --addmode HDMI1 "3840x2160_30.00_rb"
xrandr --addmode HDMI1 "3840x2160_50.00_rb"
xrandr --addmode HDMI1 "3840x2160_60.00_rb"
xrandr --addmode HDMI1 "4096x2160_24.00_rb"
xrandr --addmode HDMI1 "4096x2160_25.00_rb"
xrandr --addmode HDMI1 "4096x2160_30.00_rb"


# now start watching the x.org log
tail -f /var/log/Xorg.0.log &

### and set the mode
$ xrandr --output HDMI1 --verbose --mode 3840x2160_13.80
crtc 1: 3840x2160_13.80  13.79 +0+768 "HDMI1"

xorg-log: (--) intel(0): HDMI max TMDS frequency 300000KHz
=> This is a mode the intel chip can output,
   but the TV can not display

### setting 4k 25Hz mode successfully:
$ xrandr --output HDMI1 --verbose --mode 3840x2160_25.00_rb
crtc 1: 3840x2160_25.00_rb  25.00 +0+768 "HDMI1"
xorg-log: (--) intel(0): HDMI max TMDS frequency 300000KHz
=> successfully switches the mode to 4k

### attempting to set 4k 30Hz, not successful:
$ xrandr --output HDMI1 --verbose --mode 3840x2160_30.00_rb
crtc 1: 3840x2160_30.00_rb  30.00 +0+768 "HDMI1"
xrandr: Configure crtc 1 failed
crtc 0: disable
crtc 1: disable
crtc 2: disable
crtc 3: disable
screen 0: revert
crtc 0: revert
crtc 1: revert
crtc 2: revert
crtc 3: revert
xorg-log: (EE) intel(0): failed to set mode: Invalid argument [22]

Modes

mode status
3840x2160_25.00_rbworks for me
3840x2160_30.00_rbnot working
3840x2160_50.00_rbnot working
3840x2160_60.00_rbnot working
4096x2160_24.00_rbworks for me
4096x2160_25.00_rbnot working
4096x2160_30.00_rbnot working

Final script

xrandr --newmode "3840x2160_25.00_rb" \
  219.40  3840 3888 3920 4000  2160 2183 2188 2194 +hsync -vsync
sleep .5
xrandr --addmode HDMI1 "3840x2160_25.00_rb"
sleep .5
xrandr --output HDMI1 --verbose --mode 3840x2160_25.00_rb \
  --below LVDS1