presentation-time client hints
The presentation-time protocol allows compositors to provide feedback to clients, but doesn't allow clients to send timing hints to the compositor.
In general, the compositor doesn't have a lot of control over presentation timings. By "in general", I mean KMS + fixed refresh rate. In this case, that essentially means any client hint would get ignored. However:
- A compositor could choose to change the fixed refresh rate depending on the focused/fullscreen surface. Note, with today's hardware that usually means performing a modeset, ie. visual glitch (e.g. black screen during a few seconds).
- A compositor might have variable refresh rate enabled, in which case the refresh rate can dynamically be decreased down to a limit.
I'll focus on two use-cases where presentation timings are important: games and video players. Let's identify issues for these use-cases.
Fixed framerate content
A video player is fullscreen. It displays a video which has a fixed 25Hz framerate. In addition to this, either:
- The output has a 25Hz mode available, and the compositor is willing to perform a modeset.
- The output supports VRR, e.g. with a 35Hz-60Hz range. The compositor is willing to page-flip at 50Hz (double the video framerate).
Without knowing the video framerate, the compositor can't do any of this. This results in frames being displayed at the wrong time, or this forces the video player to unnecessarily perform frame interpolation.
VRR + cursor
A game or a video player is fullscreen and sets a cursor surface. The client submits new buffers too late to hit the output's max refresh rate (e.g. because the game is slow to render or because the video framerate is less than the display's max refresh rate).
When the user doesn't move the cursor, VRR is used. When the user moves the cursor, the compositor uses the display's max refresh rate and the content updates are delayed till the next vblank.
Potential solutions:
- Add a way for clients to specify a target timestamp for their surface commits?
- Add a way for clients to specify a fixed refresh rate hint for a given surface?
- Add a way to synchronize the cursor with a surface?