Avoid a kernel driver / X server crash situation.

Change the order of our calls to xrandr to mask a situation that can cause
the GPU to hang, i915 driver to give up, and the X server to crash.  This
crash is not recoverable and requires a reboot.

BUG=chromium-os:6701
TEST=manual: [Un]Plug VGA, then hit Ctrl-F4.  Repeat...

This workaround changes the order of xrandr calls from:

xrandr --output LVDS1 --mode 1280x800
xrandr --output VGA1 --off
xrandr --fb 1280x800

to:

xrandr --output VGA1 --off
xrandr --fb 1280x800
xrandr --output LVDS1 --mode 1280x800

In my experimentation, turning on LVDS later makes a big difference.

But it is not perfect.  I have still seen the failure, but it is much
harder to reproduce.

Change-Id: I300887ef2c65173bafeccd8afdf657f91f71c736

Review URL: http://codereview.chromium.org/5024002
1 file changed