https://bugs.kde.org/show_bug.cgi?id=397850

            Bug ID: 397850
           Summary: kwin_x11 - triple buffer detection of compositing
                    apparently broken with every driver; causing
                    stuttering, lag or tearing
           Product: kwin
           Version: 5.13.4
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: compositing
          Assignee: kwin-bugs-n...@kde.org
          Reporter: tempel.jul...@gmail.com
  Target Milestone: ---

The problem in a nutshell:
free drivers (both AMD and Intel): stutter when moving windows and in
applications
Proprietary Nvidia driver: tearing

-> So the situation with any graphics driver is quite ugly.
I tested this with several GPUs, distributions and driver versions: The
described problem is shared among all of them, and exists probably since the
beginning of KWin 5.

I'm having a strong suspicion that the source of this evil lays in KWin's
triple buffer detection.
What makes me think so? I tried several situations with the KWIN_TRIPLE_BUFFER
environment variable and the results are very interesting.

First observation:
When KWIN_TRIPLE_BUFFER is set (both 1 and 0), the nasty initial "calibration
stuttering" when compositing turns on disappears.
This easily noticeable when moving windows right after enabling compositing.
KWin is the only compositor I know which shows such a weird behavior. It's
especially nasty when you turned compositing off for a fullscreen application
like a game, and when closing it and returning to desktop, everything is
stuttery for some time.

Observation regarding Nvidia driver:
By default, there is tearing after the initial "calibration stuttering".
However, with workarounds, perfect KWin compositing is possible with Nvidia. To
do so, set both
KWIN_TRIPLE_BUFFER=0
and in Nvidia xorg config, also
Option "TripleBuffer" "0"
The latter option makes triple buffering unavailable for any application and
for some reason, it's required to make KWin compositing on Nvidia work
correctly. It's completely free of stutter and shows low input latency at the
same time.

Observation regarding free drivers (applies to both Intel and AMD to the same
extent):
KWIN_TRIPLE_BUFFER=0 reduces stutter, but doesn't fully eliminate it in
applications like Firefox. Weirdly, it also shows a much higher input latency
than TB autodetect (environment variable unset) or than setting
KWIN_TRIPLE_BUFFER=1.
However, KWIN_TRIPLE_BUFFER=1 shows stuttering when moving any window, e.g.
Dolphin, and strong stuttering when e.g. scrolling in Firefox.
Unfortunately, there is no such an option in Mesa like Option "TripleBuffer",
which is available in the Nvidia driver.
Instead, there is vblank_mode=x. But no value of it helps to reduce the
stuttering or input latency of KWin. It's always stuttery and laggy.

I think it's very unsatisfying that kwin_x11 compositing does only work
correctly on Nvidia with some workarounds and with free drivers not at all.
Shouldn't it be possible to bisect the issue due to the open nature of Mesa?
It's quite the irony that, unlike any other compositor, KWin actually seems to
hate free drivers more than the closed one of Nvidia.

The GUI options offered by KWin KCM in Plasma system settings don't have an
effect on any of the points I described above.

It's still the same bug as 383023, but that original bugreport was too focused
on Intel graphics. So I'm going to close it and I'm hoping for some response
here.

I'm aware that kwin_x11 is left in "maintenance bugfix only" state, but the
described problems can obviously considered as bugs and it would be a shame if
kwin_x11 was left in that state.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to