Cursor effects, buffer cross-fades and inline video each ran on their
own Lisp timer, and each timer presented on its own. With everything
active that stacked presents well above the refresh rate, which is
exactly the pressure under which radeonsi was caught presenting stale
swapchain buffers, and the blocking swaps starved the other timers
(inline video dropped from 30fps to ~20fps with its tick slipping to
49ms).
Replace the three timers with a single pump. gpu.el now runs one
repeating timer that calls the new gpu-pump-tick primitive: the driver
advances the cursor physics, the fade clock and the video upload
together and presents AT MOST ONCE per tick, under the same 12ms
last-swap throttle as before. The pump paces itself: 60Hz while a
fade runs, 30Hz otherwise, gone when nothing needs it. A skipped
subsystem loses nothing -- the fade and the video are composited by
every present, whoever issues it.
The old per-subsystem entry points (gpu-anim-tick, gpu-transition-tick,
gpu-video-tick) remain for compatibility; gpu-video-tick now presents
only when a fresh frame arrived or the rect moved, under the same
throttle, instead of unconditionally.
On Metal the pump consolidates the same two timers; the animator
already coalesces presents, so the change there is one deterministic
tick (video frame pull, then animator step) with a real elapsed dt.
Measured on the AMD iGPU test box (1920x1080, Cinnamon): video tick
median 33.0ms / p90 33.3ms (was 49ms), a 30fps file plays at 29.5fps,
and worst-case contention (video + cursor effects + 12 cross-fades)
peaks at 8 presents per 100ms window with a 16.1ms median gap.
GL_LOG_PRESENT now also traces the pump decisions and the per-tick
video upload state.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
See the end of the file for license conditions.
This directory contains the source files for the C component of GNU Emacs.
Nothing in this directory is needed for using Emacs once it is built
and installed, if the dumped Emacs is copied elsewhere.
See the files ../README and then ../INSTALL for installation instructions.
The file 'Makefile.in' is used as a template by the script
'../configure' to produce 'Makefile'. This is the file which actually
controls the compilation of Emacs C source files. All of this should
work transparently; you should only need to change to the parent
directory, run './configure', and then run 'make'.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.