Repository navigation
Conversation
On displays whose built-in panel exposes lower refresh rates (>= 24 Hz) at the active resolution (such as ProMotion iPads with 120/60/48/30/24 Hz modes), add a Wayland IdleMonitor in the idle service that steps down to the lowest safe refresh rate after 5 s of inactivity (configurable via idle.refreshRate, 0 to disable) and restores the previous mode on the first input or when the shell exits. - Scan all enabled internal outputs so a single-mode internal connector does not hide a multi-rate panel, and retry transient startup probe failures cleanly. - Gate on both idleEnabled (Stay Awake) and respectInhibitors (video playback, games), and apply the same IdleMonitor retiming rearm workaround used by idleMonitor. - Reconcile desired state after every probe/apply exit so idle events during restore are never dropped, retain saved mode with bounded retry on transient restore failures, verify the output still holds our idle mode before restoring (so manual mode changes are preserved), and run a checked teardown restore covering in-flight lowers. Assisted-by: LLM
|
Marking as draft while we fix a ~19 ms black-frame flash on same-resolution refresh-rate modesets in |
|
Keeping this PR in draft until OrchardLinux/packages#40 ( Without that |
Summary
On tablets and laptops whose built-in display exposes lower refresh rates (
>= 24 Hz) at the active resolution (such as ProMotion iPads with 120/60/48/30/24 Hz modes), step down to the lowest safe refresh rate after 5 s of inactivity and restore the previous active mode on the first input or when the shell exits.Single-mode panels stay completely unaffected (
supported: false, noIdleMonitorenabled, zero idle overhead).Changes
desktop/shell/shell/plugins/services/idle/IdleModel.js:selectIdleRefreshPlan(): scans all enabled internal outputs (^(eDP|LVDS|DSI|Unknown)-), finds the first multi-rate panel exposing modes>= 24 Hzat the current resolution, and returnsvalid,hasEnabledInternal,supported,output,activeMode, andidleMode.shouldRestoreIdleRefresh(): verifies the output is still present, enabled, and holding the exact idle mode applied by this service before restoring, preserving any manual mode or resolution change.desktop/shell/shell/plugins/services/idle/Service.qml:refreshIdleMonitor(IdleMonitor, default 5 s viaidle.refreshRate,0disables), gated on bothidleEnabled(Stay Awake) andrespectInhibitors: true(video playback, games), using the same retiming rearm workaround asidleMonitor.reconcileRefreshRate()after every probe/apply exit (with synchronizedonStreamFinished+onExited), avoids tight-looping on rejected lowers (refreshLowerFailedThisIdle), retries transient startup/restore failures within a bound, re-probes onQuickshell.onScreensChanged, and runs a verified detached restore onComponent.onDestruction(covering in-flight lowers while preserving manual mode changes).refreshRatestate inomarchy-shell idle status.docs/power-and-lock.md: documentsidle.refreshRatein the timing table.tests/test_idle_refresh.py: unit tests for mode selection, multi-connector scanning, restore verification, and end-to-end teardown script behavior (normal restore, manual override preservation, in-flight lower settle, and retry on transient failure).Live verification (J207 / iPad Pro 10.5-inch, 500 mA USB SDP, 53% backlight)
60 Hz → 24 Hzafter 5 s, restores60 Hzon input (Scale: 2.0,Transformpreserved).120 Hz → 24 Hzafter 5 s, restores120 Hzon input.120 Hz: -195 mA (discharging)60 Hz: -47 mA (discharging)24 Hzidle (withidle-wakeups): +80 mA (net charging, saving ~127 mA / ~480 mW vs 60 Hz and ~275 mA / ~1.04 W vs 120 Hz).