don't schedule swaps on CRTCs with all outputs disconnected

When a display connector is disconnected, kernel finds out about it
immediately, but it takes a while for event to be processed in user
space and modes set and X update crtc->enabled flag. In meantime,
if someone tries to schedule swap, it will be sent to kernel, fail
with EBUSY and propagate back to Chrome causing havoc and error messages
along the way. Instead, we can detect that CRTC has all outputs disconnected
and skip the swaps on it as if it is disabled.

BUG=chromium:353598
TEST=suspend Daisy with external monitor attached and mirror mode on. \
disconnect monitor, resume, see no messages about swap failing in \
chrome log and Xorg log.

Change-Id: Icd70ef420cb174f380d620e36fa04cb425049c17
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195692
Reviewed-by: David Sodman <dsodman@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
1 file changed