Gnome unusable with XR devices due to force repainting

To preface. The extension ( GitHub - wheaney/breezy-desktop: XR virtual workspace library for Linux ) is virtually mandatory for the devices it is supposed to be used with and since this bug always occurs with the extension enabled (Wayland, X11, no other extensions) it makes Gnome virtually unusable with the devices.

To continue from this (which sadly got no activity): Forcing an Actor to be repainted at a specific refresh rate

The behaviour of the extension to force repaints in these way causes very weird stutter behaviour while repainting without GPU/CPU usage reaching 50% it heavily stutters during the movement, but the stutter stops during the same movement but then starts again all in the same movement clearly indicating the extension is doing something bad because the API for it does not exist.

Contrary on gamescope it seems supported: gamescope/src/reshade_effect_manager.cpp at f873ec7868fe84d2850e91148bcbd6d6b19a7443 · ValveSoftware/gamescope · GitHub

As this is nowdays a genuine usecase I would really like if we got a discussion going on how this could be solved potentially either from the extension perspective or by Gnome providing an api for it.

Since that post, I’ve moved away from a timeout and am instead using a Timeline and the new-frame event, as seen here: breezy-desktop/gnome/src/xrEffect.js at 07bf23943346f2e4299ee54059a8dc66b14aaeb9 · wheaney/breezy-desktop · GitHub

So this may not actually be an issue with the repaint approach at all. It looks like GNOME can cause the GPU to quickly switch between idle and non-idle clock rates, or simply the fact that GNOME spends a lot of time near idle, so the 60-or-so times per second that I’m forcing a repaint catches the GPU off guard and it can’t respond quickly enough.

That’s just a theory, though, based on the fact that we’ve seen that the stuttering is fixed by forcing the GPU to an always-on, higher clock rate.

This leads me to wonder if GNOME has a way to put the GPU into a “higher performance” state. If my extension could trigger something like that, it would probably work better in general.