====== Add display modelines ======
If a resolution isn't available in X while the monitor should support it, the modeline can be added manually.
First get the port names of the connected monitors:
xrandr
Screen 0: minimum 320 x 200, current 4080 x 1956, maximum 16384 x 16384
DP-1 connected primary 1920x1200+1080+432 (normal left inverted right x axis y axis) 518mm x 324mm
1920x1200 59.95*+
1920x1080 60.00
1600x1200 60.00
1680x1050 59.88
1280x1024 60.02
1280x960 60.00
1024x768 60.00
800x600 60.32
640x480 59.94
720x400 70.08
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2-8 connected 1080x1920+3000+36 left (normal left inverted right x axis y axis) 160mm x 90mm
1920x1080 60.00*+ 50.00 59.94
1600x1200 60.00
1680x1050 59.88
1280x1024 60.02
1280x960 60.00
1280x720 60.00 50.00 59.94
1024x768 60.00
800x600 60.32
720x480 60.00 59.94
640x480 60.00 59.94
720x400 70.08
DP-2-9 connected 1080x1920+0+0 left (normal left inverted right x axis y axis) 160mm x 90mm
1920x1080 60.00*+ 50.00 59.94
1280x720 60.00 50.00 59.94
720x480 60.00 59.94
640x480 60.00 59.94
Here, monitors are connected on DP-1, DP-2-8 and DP-2-9.
Calculate modeline for the resolution required:
cvt 1920 1200
# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz
Modeline "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
It probably creates a 60Hz modeline, if other refresh rates are required, add the refresh rate:
cvt 1920 1200 50
# 1920x1200 49.93 Hz (CVT 2.30MA) hsync: 61.82 kHz; pclk: 158.25 MHz
Modeline "1920x1200_50.00" 158.25 1920 2040 2240 2560 1200 1203 1209 1238 -hsync +vsync
Now add the relevant modes to xrandr:
xrandr --newmode "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
xrandr --newmode "1920x1200_50.00" 158.25 1920 2040 2240 2560 1200 1203 1209 1238 -hsync +vsync
Lastly, add the mode to the relevant monitor:
xrandr --addmode DP-2-9 1920x1200_60.00
xrandr --addmode DP-2-8 1920x1200_60.00
xrandr --addmode DP-2-9 1920x1200_50.00
xrandr --addmode DP-2-8 1920x1200_50.00
Switch to the modes and test.
Note that this is not permanent and after a reboot, the modelines do not exist any longer.
Add to rc.local / .profile or whatever best applies to your system.
This can be applied in lightdm:
[SeatDefaults]
user-session=cinnamon
[Seat:*]
display-setup-script=xrandr --newmode "1920x1200_50.00" 158.25 1920 2040 2240 2560 1200 1203 1209 1238 -hsync +vsync ;\
xrandr --addmode DP-2-9 1920x1200_50.00 ;\
xrandr --addmode DP-2-8 1920x1200_50.00 ;\
xrandr --output DP-1 --primary --mode 1920x1200 --pos 1200x432 --rotate normal --output DP-2 --off --output HDMI-1 --off --output DP-2-8 --mode 1920x1200_50.00 --pos 3120x0 --rotate left --output DP-2-9 --mode 1920x1200_50.00 --pos 0x0 --rotate left