Bug 431954 - KWin OpenGL acceleration causes flickering and stale content
Summary: KWin OpenGL acceleration causes flickering and stale content
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.20.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-22 19:49 UTC by CarlosE
Modified: 2021-03-20 00:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CarlosE 2021-01-22 19:49:30 UTC
SUMMARY
Using OpenGL hardware accelaration with vsync on KWin causes programs to flicker and render stale content.

STEPS TO REPRODUCE
1. Choose OpenGL as render infrastructure
2. Set Tearing Prevention to something other than none.
3. Enable compositing.
3. Open programs that have large sections that need constant repainting (such as fast scrolling (sideways and vertically) in Okular, tabbing in a terminal, or blinking carets.

OBSERVED RESULT
KWin will render stale content (flicker between the current frame and a stale frame from a few miliseconds prior) and cause vertical screen tearing. This is especially noticeable in Okular (when scrolling fast), LibreOffice and Konsole (when the caret blinks).

It is absent when compositing is disabled, in screen recordings via Xcomposite, and when vsync is forced via _GL_SYNC_TO_VBLANK (when Tearing Prevention is set to Never).

EXPECTED RESULT
KWin should the current window content without the need to disable compositing or using Mesa environment variables.

SOFTWARE/OS VERSIONS 
Operating System: Arch Linux
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.7-111-tkg-pds
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-8565U CPU @ 1.80GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 1 CarlosE 2021-01-27 22:39:51 UTC
After more testing, the bug seems to be absent after when using xf86-video-intel.

In fact, there is now tearing in the Xorg modesetting driver (when compositing is disabled) that didn't use to be there. I don't know how to debug this issue, but I'm starting to suspect the modesetting driver, rather than KWin, is the culprit.
Comment 2 CarlosE 2021-03-20 00:01:54 UTC
Seems to be fixed in Plasma 5.21.