Closed ppascher closed 2 years ago
Yeah. I have some code in progress that helps on that front. Need to figure out how to detect we're VRR-capable in both nested and embedded to enable the logic where 'vblanks' would be driven by the need to repaint.
Looking forward to this. For the record (until this is fixed), if you have a game that is internally capped below the monitor's refresh rate, you'll also need to cap with gamescope, as the monitor will still try and run the max refresh rate when run with gamescope.
Also looking forward for this feature.
Yeah this is basically the last major feature I need in GS before I start using it. Hope it can happen soon!
Not sure if the steam deck can take advantage of VRR or not, but it helps smooth framerates out in many games. It's also not ALWAYS beneficial to have enabled but normally helps.
Let's get this working!
I don't really know whats required to make it so at this point. I thought gamescope already runs in true fullscreen mode with the -F flag but maybe its fake, or the game inside is being forced into borderless within gs....
I just noticed while checking for status on #163 that VRR appears to be working through gamescope playing Cyberpunk 2077. Can someone confirm? This was using sway/wlroots with enabled VRR on amdgpu.
VRR will 'work', but we won't present at the right time for it to have the desired effect, at the moment. It should be really easy to plumb an unconditional VRR option with how the current thing is laid out, and we can plumb it to dynamically detecting if VRR is currently on for our window or not later.
It be nice if it worked for xorg since I'm holding off using wayland until it has display gamma controls and maybe HDR happening.
Theoretical question, if Gamescope supported VRR and if a Wayland compositor like Mutter doesn't support VRR, could we use Gamescope to have VRR support in the micro-compositor (not the UI, but for anything that is running inside Gamescope)?
Theoretical question, if Gamescope supported VRR and if a Wayland compositor like Mutter doesn't support VRR, could we use Gamescope to have the VRR support?
VRR would probably won't work in nested mode (running Gamescope nested inside another compositor or X11)
You could maybe replace mutter with Gamescope, but that sounds very impractical.
Edit: Looks like wlroots only contains code for the DRM backend and for some reason also for the X11 backend
Doesn't Mutter do fullscreen unredirect anyway which should allow VRR to work?
We want to do DRM leasing for stuff like this when nested
Doesn't Mutter do fullscreen unredirect anyway which should allow VRR to work?
Don't think itd play nicely, but we can always find out...
Mutter supports neither VRR nor DRM leasing. Don't think anybody's working on DRM lease support, either: https://gitlab.gnome.org/GNOME/mutter/-/issues/1743
mutter supports VRR in https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154 which should hopefully be merged soon
I think the best option for adding VRR support to gamescope would be enabling it as a launch option, same with most (all?) other features it has. If someone launches it with the option when their desktop doesn't support it and it breaks something, there's not much that could be done if implemented that way. I'm not very knowledgeable on how stuff would be implemented, and these are just my thoughts, so take em with an abnormally large grain of salt lol
VRR seems to be finally working in embedded (drm) mode.
Verified by running gamescope in VT after applying the following hacky patch on latest master (could not find a way to enable it via an environment variable or flag). Monitor OSD now displays game FPS.
diff --git a/src/drm.cpp b/src/drm.cpp
index 1e9b96a..8ceb950 100644
--- a/src/drm.cpp
+++ b/src/drm.cpp
@@ -2002,7 +2002,7 @@ bool drm_set_color_mtx(struct drm_t *drm, float *mtx, enum drm_screen_type scree
void drm_set_vrr_enabled(struct drm_t *drm, bool enabled)
{
- drm->wants_vrr_enabled = enabled;
+ drm->wants_vrr_enabled = true;
}
bool drm_get_vrr_in_use(struct drm_t *drm)
I'll add a startup flag for this.
Variable Refresh Rate / Adaptive Sync / Freesync is currently not supported in gamescope. It is supported in wlroots though (1). As most modern GPUs and Monitors support VRR it would be nice to eventually have VRR support in gamescope as well.
(1) https://github.com/swaywm/wlroots/pull/1987