metal: preserve front buffer if atomic commit fails
This commit is contained in:
parent
3cf1b227b6
commit
fadec919e1
3 changed files with 6 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -521,7 +521,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "jay-compositor"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "jay-compositor"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
edition = "2021"
|
||||
build = "build/build.rs"
|
||||
license = "GPL-3.0-only"
|
||||
|
|
|
|||
|
|
@ -634,7 +634,6 @@ impl MetalConnector {
|
|||
.perform_render_pass(pass)
|
||||
.map_err(MetalError::RenderFrame)?;
|
||||
sync_file = buffer.copy_to_dev(sf)?;
|
||||
self.next_buffer.fetch_add(1);
|
||||
output.perform_screencopies(&buffer.render_tex, !render_hw_cursor, 0, 0, None);
|
||||
fb = buffer.drm.clone();
|
||||
}
|
||||
|
|
@ -787,6 +786,9 @@ impl MetalConnector {
|
|||
Err(MetalError::Commit(e))
|
||||
} else {
|
||||
if let Some(fb) = new_fb {
|
||||
if fb.direct_scanout_data.is_none() {
|
||||
self.next_buffer.fetch_add(1);
|
||||
}
|
||||
self.next_framebuffer.set(Some(fb));
|
||||
}
|
||||
if cursor_swap_buffer {
|
||||
|
|
@ -2407,6 +2409,7 @@ impl MetalBackend {
|
|||
if let Some(old) = connector.buffers.set(Some(buffers)) {
|
||||
old_buffers.push(old);
|
||||
}
|
||||
connector.next_buffer.set(1);
|
||||
connector.primary_plane.set(Some(primary_plane.clone()));
|
||||
if let Some(cp) = &cursor_plane {
|
||||
cp.assigned.set(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue