From ddd574ef4fa97b89b37aa0ebf3309ef7025715b3 Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Tue, 9 Jun 2026 15:28:59 +0300 Subject: [PATCH] redbear-compositor: keep DRM fd open across page flips (Gap 3.5) DrmOutput's _file field was stored but unused; flip() reopened /scheme/drm/card0 on every page flip. Rename to drm_file, un- underscore, and use &self.drm_file in flip() to avoid the per-flip open+close round trip. This is the implementation of v6.0 plan Phase 3.5 'Fix page flip to keep DRM fd open'. --- .../redbear-compositor/source/src/display_backend.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/local/recipes/wayland/redbear-compositor/source/src/display_backend.rs b/local/recipes/wayland/redbear-compositor/source/src/display_backend.rs index 257a8be56c..c39fa718f8 100644 --- a/local/recipes/wayland/redbear-compositor/source/src/display_backend.rs +++ b/local/recipes/wayland/redbear-compositor/source/src/display_backend.rs @@ -201,7 +201,7 @@ mod drm_backend { pub buffers: Vec<(usize, usize)>, fb_ids: Vec, pub current: AtomicUsize, - _file: File, + drm_file: File, } impl DrmOutput { @@ -420,7 +420,7 @@ mod drm_backend { buffers, fb_ids, current: AtomicUsize::new(0), - _file: file, + drm_file: file, }) } @@ -434,9 +434,7 @@ mod drm_backend { let mut buf = Vec::with_capacity(12); buf.extend_from_slice(&(DRM_IOCTL_MODE_PAGE_FLIP as u64).to_le_bytes()); buf.extend_from_slice(&fb_id.to_le_bytes()); - if let Ok(mut f) = File::open("/scheme/drm/card0") { - let _ = f.write_all(&buf); - } + let _ = (&self.drm_file).write_all(&buf); self.current.store(next, Ordering::Relaxed); }