mirror of
https://github.com/hyprwm/aquamarine.git
synced 2026-05-07 21:58:03 +02:00
Read-only mirror of https://github.com/hyprwm/aquamarine
* drm: handle CRTC starvation recovery when outputs are disabled When more displays are connected than CRTCs available, connectors that arrive after all CRTCs are claimed become starved. The compositor can free a CRTC by disabling an output, but nothing reclaimed that CRTC for the starved connector. Restructure recheckCRTCs() into two passes: first, disabled outputs release their CRTCs and enabled connectors get priority assignment; second, any remaining free CRTCs are given to disabled connectors as backup slots for quick re-enable. When applyCommit() detects an enabledState transition, schedule recheckOutputs() via addIdleEvent so starved connectors pick up the freed CRTC on the next event loop iteration, without reentrancy or blocking the event loop. * drm: clear stale page-flip state after suspend/resume My laptop (i915, 3 external monitors) would go permanently black after S3 or suspend-then-hibernate. The only recovery was a hard restart. The root cause: when display hardware powers off during suspend, any in-flight page-flip completion event is lost. handlePF() never fires, so isPageFlipPending stays true from the last frame before suspend. On resume, scheduleFrame() sees the stale flag and bails, commitState() rejects every frame with "Cannot commit when a page-flip is awaiting", and nothing ever clears it. Screens stay dark forever. VT switch doesn't hit this because the kernel preserves DRM state and queues pending events in the fd buffer. Suspend kills the hardware, so there's nothing to deliver. Fix in two places: 1. restoreAfterVT(): clear isPageFlipPending, isFrameRunning, and frameEventScheduled for all connectors before recheckOutputs(). For VT switch this is harmless (the events arrive anyway and handlePF would set them false). For suspend it unblocks frame scheduling. 2. commitState(): record a CLOCK_BOOTTIME timestamp when isPageFlipPending is set. If a modeset finds a flip pending for >500ms (well past any vblank), treat it as stale and clear the flags. CLOCK_BOOTTIME instead of CLOCK_MONOTONIC because MONOTONIC freezes during suspend on Linux, making elapsed time look like zero after resume. Timestamp recorded in both atomic and legacy commit paths. Relates to Hyprland#8312, Hyprland#6289. --------- Co-authored-by: j4kuuu <j4kuuu> |
||
|---|---|---|
| .github/workflows | ||
| data | ||
| docs | ||
| include/aquamarine | ||
| nix | ||
| protocols | ||
| src | ||
| tests | ||
| .clang-format | ||
| .clang-tidy | ||
| .gitignore | ||
| aquamarine.pc.in | ||
| CMakeLists.txt | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| VERSION | ||
Aquamarine
Aquamarine is a very light linux rendering backend library. It provides basic abstractions for an application to render on a Wayland session (in a window) or a native DRM session.
It is agnostic of the rendering API (Vulkan/OpenGL) and designed to be lightweight, performant, and minimal.
Aquamarine provides no bindings for other languages. It is C++-only.
Stability
Aquamarine depends on the ABI stability of the stdlib implementation of your compiler. Sover bumps will be done only for aquamarine ABI breaks, not stdlib.
Building
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`