Ubuntu 14.04 suddenly doesn't recognize external monitor resolution
I use a secondary monitor for my notebook since quite a while. Usually I have to open the system settings window to trigger the automatic resolution setting, but today nothing worked. Restarting, (un-)plugging the power, and changing to another monitor didn't help. I knew that my monitor accepts 1920x1080 pixels. With gtf, one can get some default settings:
$ gtf 1920 1080 60
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
xrandr shows the existing monitors and modes:
$ xrandr
Screen 0: minimum 320 x 200, current 2390 x 768, maximum 32767 x 32767
eDP1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
1366x768 60.0*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP2 connected 1024x768+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.0*
800x600 60.3 56.2
848x480 60.0
640x480 59.9
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
So the corresponding monitor is on DP2. I added the "new" mode by copy-pasting the output from gtf above and activated it for DP2:
$xrandr --newmode "1920x1080_60" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
$xrandr --addmode DP2 1920x1080_60
$xrandr --output DP2 --mode 1920x1080_60
Voilà, it works.