1
0
Fork 0
forked from wry/wry

metal: retry DRM device reset with modeset if non-modeset fails

Unfortunately AMD gets a bit modeset happy when we set this flag even in
situations where otherwise no modeset would be required. So we cannot
set it unconditionally.
This commit is contained in:
Julian Orth 2025-02-03 10:12:48 +01:00
parent 4eaaa3f046
commit 607e92d2d5

View file

@ -2328,7 +2328,18 @@ impl MetalBackend {
}
}
}
if let Err(e) = changes.commit(flags, 0) {
let res = loop {
let res = changes.commit(flags, 0);
if let Err(e) = &res {
if flags.not_contains(DRM_MODE_ATOMIC_ALLOW_MODESET) {
log::warn!("Fast commit failed, retrying with modeset: {}", ErrorFmt(e));
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
continue;
}
}
break res;
};
if let Err(e) = res {
return Err(MetalError::Modeset(e));
}
for connector in dev.connectors.lock().values() {