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:
parent
4eaaa3f046
commit
607e92d2d5
1 changed files with 12 additions and 1 deletions
|
|
@ -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));
|
return Err(MetalError::Modeset(e));
|
||||||
}
|
}
|
||||||
for connector in dev.connectors.lock().values() {
|
for connector in dev.connectors.lock().values() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue