perf: pace buffer releases to the screen, read the requested refresh, drop sustained mode and ADPF

A replaced buffer went straight back to a game with no frame limit, so a
MAILBOX/IMMEDIATE swapchain drew frames that were never shown; it now
comes back once per refresh as in WinNative. gamescope's -r and the
compositor read the rate of the mode the activity asked for rather than
the one the panel was still in, and the zero-copy layer votes it.
Sustained performance mode, which caps clocks on most power HALs, and
the ADPF session, which reported frame intervals as work, are gone.
This commit is contained in:
maxjivi05 committed 2026-09-29 18:44:32 -04:00
1 parent 4914b2cc69
commit e217cbe66d
6 files changed
+30 -111

No files matched your search

@@ -41,6 +41,10 @@ object CompositorHost {
}
WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight)
WaylandCompositor.nativeSetOutputRefreshRate(refreshHz)
// The cadence the zero-copy layer votes for. Left at 0 the system infers it from the rate
// already being achieved, and on a phone whose vendor picks clocks from that a session
// that has been slowed reads as one that wants to be. (WinNative, WaylandSession.)
WaylandCompositor.nativeSetLayerFrameRate(refreshHz)
WaylandCompositor.nativeStartWithSurface(
surface, xdgRuntimeDir, driverPath, libraryName, nativeLibDir,
)
@@ -91,7 +91,6 @@ public final class WaylandCompositor {
long smoothed = frameIntervalNanos;
frameIntervalNanos = smoothed == 0 ? interval : (smoothed * 3 + interval) / 4;
}
com.droiddeck.launcher.session.PerfHints.onFrame();
GameListener l = gameListener;
if (l != null) l.onGameFrame();
}
@@ -218,7 +217,7 @@ public final class WaylandCompositor {
* once per tick, so games run unthrottled and the screen shows their latest frame. */
public static native void nativeVsync(long frameTimeNanos);
/** The compositor thread's Linux tid, or 0 before it has started (see PerfHints). */
/** The compositor thread's Linux tid, or 0 before it has started. */
public static native int nativeCompositorTid();
/** Shortcut launches: don't draw explorer's windows (desktop, taskbar, Start menu), matching the