High refresh rate Xorg

Written by on Read time: 3 min

ML generated picture of monitors

Most tutorials I could find for getting high refresh rate to work on Xorg boiled down to “just run xrandr on login”. I though, enjoy using actual configuration files instead of watching my screen blink in and out as I start i3.

And it was surprisingly hard to figure out how to achieve it! The theory was simple though:

Just plomp down a file with the right contents to /etc/X11/xorg.conf.d/. In theory I should’ve just been able to get the right modeline with the cvt 2560 1440 144, but mysteriously it didn’t work. I even tried with the actual refresh rate of 143.91, but the modeline it generated was just wrong.

What actually ended up working, was that instead of using cvt, was to run xrandr --verbose just once to figure out the correct modeline.

An example snippet from it’s output:

1
2
3
2560x1440 (0x5b) 592.000MHz +HSync -VSync
    h: width  2560 start 2568 end 2600 total 2666 skew    0 clock 222.06KHz
    v: height 1440 start 1465 end 1473 total 1543           clock 143.91Hz

Which could then be translated into the actual Xorg config file, which I saved at /etc/X11/xorg.conf.d/50-monitors.conf:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Section "Monitor"
    Identifier     "DisplayPort-0"
    VendorName     "Unknown"
    ModelName      "AOC Q32G1WG4"
    # Find with xrandr --verbose
    Modeline "2560x1440_143.91"  592.00  2560 2568 2600 2666  1440 1465 1473 1543 +hsync -vsync
    Option         "DPMS"          "1"
    Option         "Primary"       "1"
    Option         "Enable"        "1"
    Option         "PreferredMode" "2560x1440_143.91"
    Option         "Position" "0 0"
EndSection

Section "Monitor"
    Identifier     "DisplayPort-1"
    Option         "DPMS"          "1"
    Option         "LeftOf" "DisplayPort-0"
EndSection

Section "Monitor"
    Identifier     "HDMI-A-0"
    Option         "DPMS"          "1"
    #Option         "RightOf" "DisplayPort-0"
    Option         "Position" "2560 220"
EndSection

Section "Monitor"
    Identifier     "HDMI-A-1"
    Option         "DPMS"          "1"
    #Option         "RightOf" "HDMI-A-0"
    Option         "Position" "4480 700"
EndSection

Note that without defining the other monitors, they didn’t seem to show up for some reason. Additionally you’ll probably want to tweak the identifiers to the same ones that xrandr gives you if you’re copy-pasting the config. Additionally you might want to use arandr to arrange the screens so that the edges line up, and take the position values from that.

I also have the following at /etc/X11/xorg.conf.d/20-amdgpu.conf for a beter experience;

1
2
3
4
5
6
7
Section "Device"
    Identifier "AMD"
    Driver "amdgpu"
    Option "DRI" "3"
    Option "TearFree" "true"
    Option "VariableRefresh" "true"
EndSection

And configurations for turning off the monitors on idle at /etc/X11/xorg.conf.d/80-serverflags.conf

1
2
3
4
5
Section "ServerFlags"
    Option "StandbyTime" "10"
    Option "SuspendTime" "15"
    Option "OffTime" "20"
EndSection