Bug 401797 - KWin/Wayland capping framerate to 60 fps in XWayland in borderless fullscreen (Wine)
Summary: KWin/Wayland capping framerate to 60 fps in XWayland in borderless fullscreen...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.14.3
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-05 20:09 UTC by Shmerl
Modified: 2020-10-08 14:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shmerl 2018-12-05 20:09:35 UTC
When using KWin/Xorg, I get unlimited framerate in Wine, even though my monitor has 60 Hz refresh rate.

However KWin/Wayland is capping framerate to 60 fps in XWayland (Wine relies on X still). I noticed it with games run in fullscreen borderless mode (not true fulscreen).

According to this XWayland bug report:
https://bugs.freedesktop.org/show_bug.cgi?id=103282
only true fullscreen would work with XWayland without capping by default, and in other cases compositors need to support it.

Is there some way to make KWin/Wayland run Wine in XWayland with unlimited framerate when using borderless fullscreen? Vsync (in game settings) was disabled in my tests.

Configuration:

* OS: Debian testing with kernel 4.19.5
* XWayland: 1.20.3
* Plasma / KWin: 5.14.3
* GPU: Sapphire Pulse Radeon Vega 56
* Graphics: OpenGL/Vulkan: Mesa master (for Wine and games), Mesa 18.3.0-rc5 (for the desktop).
Comment 1 David Edmundson 2018-12-05 20:30:18 UTC
What's the purpose of having a refresh rate higher than your monitor?
Comment 2 Shmerl 2018-12-05 20:32:02 UTC
(In reply to David Edmundson from comment #1)
> What's the purpose of having a refresh rate higher than your monitor?

Testing performance of graphics drivers for instance.
Comment 3 Martin Flöser 2018-12-06 05:21:20 UTC
KWin is synced to the frame rate of the screen. On the other hand KWin does not limit the frame rate of windows. They can render as many frames as they want. Just KWin won't render them.
Comment 4 Shmerl 2018-12-06 05:24:52 UTC
(In reply to Martin Flöser from comment #3)
> KWin is synced to the frame rate of the screen. On the other hand KWin does
> not limit the frame rate of windows. They can render as many frames as they
> want. Just KWin won't render them.

So if it doesn't limit it, why is framerate reported as unlimited in KWin/X (i.e. it can fluctuate and go above 60 fps), and capped at 60 fps in KWin/XWayland? I used dxvk internal HUD to display it and it shows the difference.
Comment 5 Shmerl 2018-12-06 05:30:49 UTC
May be then calculation of the (potential) framerate should be done differently somehow? I.e. physical framerate is always capped by the monitor refrerh rate either way. When various HUDs report framerate in X it's the potential one. But somehow this calculation produces different results now in X and XWayland with KWin.
Comment 6 Martin Flöser 2018-12-06 15:34:34 UTC
You have to ask the XWayland developrs why they cap the frame rate. As I wrote KWin does not limit applications, they can render at whatever frame rate they want. We honestly don't care at all.
Comment 7 Shmerl 2018-12-06 15:49:21 UTC
OK, I'll follow up with XWayland developers.
Comment 8 Shmerl 2018-12-06 22:17:03 UTC
Opened new XWayland bug: https://gitlab.freedesktop.org/wayland/wayland/issues/67
Comment 9 Shmerl 2018-12-06 22:28:09 UTC
XWayland developers also suggest for the compositors to:

> Basically, the compositor must not reparent a "borderless fullscreen" X11 window to a larger X11 window (e.g. for drop shadows).
Comment 10 Shmerl 2018-12-07 01:41:09 UTC
Sorry for confusion, I opened it for the wrong project (Wayland). It should have been for Xorg, so here is the correct one:

https://gitlab.freedesktop.org/xorg/xserver/issues/20
Comment 11 Martin Flöser 2018-12-07 05:57:35 UTC
We reparent all x windows and we won't change that.
Comment 12 Shmerl 2018-12-09 06:01:49 UTC
To give an update. This actually looks specific to Wine+dxvk (Vulkan) case and it doens't happen in Wine+wined3d (OpenGL).
Comment 13 Yannick 2020-10-08 14:12:23 UTC
On Archlinux with Kwin 5.19.5, I also notice a difference between OpenGL (native games or wine + wineD3D) and Vulkan games (wine + dxvk in that case).
I have a 144hz display.

OpenGL games on Plasma-wayland are smooth, while Vulkan games are stuttering.

However, when I start a Proton game with the "DXVK_HUD=fps" parameter, the FPS counter can go beyond 144 fps (it depends how well my GPU performs I guess), it doesn't seem to be capped to 144 fps even though the game is visibly stuttering.

I'm not sure if my observations are related to this bug report or if I should open a new one.