atomic: do not set current state if commit fails
This commit is contained in:
parent
f3dabe2cea
commit
b4cbecd369
|
@ -528,7 +528,6 @@ impl<A: AsRawFd + 'static> RawSurface for AtomicDrmSurfaceInternal<A> {
|
||||||
warn!(self.logger, "Failed to destory old mode property blob: {}", err);
|
warn!(self.logger, "Failed to destory old mode property blob: {}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*current = pending.clone();
|
|
||||||
|
|
||||||
// new config
|
// new config
|
||||||
req
|
req
|
||||||
|
@ -536,7 +535,7 @@ impl<A: AsRawFd + 'static> RawSurface for AtomicDrmSurfaceInternal<A> {
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!(self.logger, "Setting screen: {:?}", req);
|
debug!(self.logger, "Setting screen: {:?}", req);
|
||||||
self.atomic_commit(
|
let result = self.atomic_commit(
|
||||||
&[
|
&[
|
||||||
AtomicCommitFlags::PageFlipEvent,
|
AtomicCommitFlags::PageFlipEvent,
|
||||||
AtomicCommitFlags::AllowModeset,
|
AtomicCommitFlags::AllowModeset,
|
||||||
|
@ -549,9 +548,13 @@ impl<A: AsRawFd + 'static> RawSurface for AtomicDrmSurfaceInternal<A> {
|
||||||
errmsg: "Error setting crtc",
|
errmsg: "Error setting crtc",
|
||||||
dev: self.dev_path(),
|
dev: self.dev_path(),
|
||||||
source,
|
source,
|
||||||
})?;
|
});
|
||||||
|
|
||||||
Ok(())
|
if result.is_ok() {
|
||||||
|
*current = pending.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn page_flip(&self, framebuffer: framebuffer::Handle) -> Result<(), Error> {
|
fn page_flip(&self, framebuffer: framebuffer::Handle) -> Result<(), Error> {
|
||||||
|
|
Loading…
Reference in New Issue