Reset drm device into text mode on tty switch

This commit is contained in:
Drakulix 2018-02-20 17:37:44 +01:00
parent 5725d1bb34
commit 2294e79814
1 changed files with 15 additions and 0 deletions

View File

@ -615,6 +615,21 @@ impl<A: ControlDevice + 'static> SessionObserver for StateToken<DrmDevice<A>> {
return; return;
} }
} }
for (handle, &(ref info, ref connectors)) in device.old_state.iter() {
if let Err(err) = crtc::set(
&*device.context,
*handle,
info.fb(),
connectors,
info.position(),
info.mode(),
) {
error!(
device.logger,
"Failed to reset crtc ({:?}). Error: {}", handle, err
);
}
}
device.active = false; device.active = false;
if device.priviledged { if device.priviledged {
if let Err(err) = device.drop_master() { if let Err(err) = device.drop_master() {