atagen

monolith

public
Star0
Watch0

Commit e130d59bf2c7

tarball

atagen <boss@atagen.co>2026-10-19 07:51 UTC

1 file changed+9-0
drm: stop scheduling while the session is paused

`render_surface` returns before clearing `redraw` on an inactive session, so every dispatch re-armed the deadline timer at refresh rate for as long as the user sat on another VT. After resume the stale `last_vblank_ns` and `target_ns` also produced a bogus missed-vblank and 30 s of extra slack in `Budget`.
Modified file: crates/monolith/src/drm.rs+9 additions
@@ -204,7 +204,13 @@ pub fn init(
204204 tracing::warn!("could not reactivate the GPU: {e}");
205205 }
206206 for s in drm.surfaces.values_mut() {
207+ if let Some(token) = s.scheduled.take() {
208+ drm.handle.remove(token);
209+ }
207210 s.queued = false;
211+ s.last_vblank_ns = None;
212+ s.target_ns = None;
213+ s.failures = 0;
208214 s.redraw = true;
209215 }
210216 }
@@ -621,6 +627,9 @@ fn schedule(state: &mut State, crtc: crtc::Handle) {
621627 let Some(drm) = state.backend.drm_mut() else {
622628 return;
623629 };
630+ if !drm.session.is_active() {
631+ return;
632+ }
624633 let Some(surface) = drm.surfaces.get_mut(&crtc) else {
625634 return;
626635 };