Bug 414339 - Some Kwin vsync settings produce severe screen flickering
Summary: Some Kwin vsync settings produce severe screen flickering
Status: RESOLVED MOVED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.14.5
Platform: Debian testing Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-20 18:57 UTC by Ike
Modified: 2022-03-04 07:40 UTC (History)
2 users (show)

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


Attachments
Kwin support information while vsync is set to "Full screen repaints" is enabled (5.57 KB, text/plain)
2019-11-20 18:57 UTC, Ike
Details
Kwin support information while "Enable compositor on startup" is disabled (5.57 KB, text/plain)
2019-11-20 18:59 UTC, Ike
Details
[corrected] Kwin support information while "Enable compositor on startup" is disabled (3.43 KB, text/plain)
2019-11-25 12:46 UTC, Ike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ike 2019-11-20 18:57:25 UTC
Created attachment 124032 [details]
Kwin support information while vsync is set to "Full screen repaints" is enabled

SUMMARY

After my system updated KWin to 4:5.14.5-1+b1 (debian bullseye) and rebooted, the screen heavily starts flickering as soon as kde is loading. After some testing, I could track down the issue to kwin and especially to the Tearing prevention ("vsync") setting. 
When "Enable compositor on startup" is deactivated and I logout and login again, everything is fine. In this case, I only noticed some flickering when typing in the password on the lock screen and sometimes in  kde panels.


STEPS TO REPRODUCE
1. Go to settings, Display and Monitor, Compositor
2. Set "Enable compositor on startup"
3. Set "Tearing prevention ("vsync")" to anything else than "Never"
4. Apply and restart kwin

OBSERVED RESULT
Here are some more details of the behaviour with different kwin settings:

When using OpenGL2.0 and 3.1:

Flickering occurs with both versions, I didn't recognize any difference.

    Behaviour under different vsync options:
    - Never: Pretty stable, only the kde panel is still buggy. When hovering over the panel, it flickers and soon after freezes partly. Widgets on it don't update their appearence (e.g. clock stops) but still work when clicking on them.
    - Automatic / Only when cheap: Flickers horribly. Seems that windows are z-fighting. When moving windows, they are still displayed on the same position while their actual position is moved correctly. System is totally unusable. 
    - Full screen repaints / Re-use screen contents: Flickers over the whole screen when moving something (mouse included) but the display is still updated correctly. One can still interact with the system although it is cumbersome.

Using XRender:

There is only flickering on KDE startup, afterwards it behaves normal with all vsync options.
One exception is hovering over an kde panel. In that case, the panel flickers while all other elements remain stable.

There are a lot of related bugs, e.g. this one: https://bugs.kde.org/show_bug.cgi?id=383179

If you need anything else, please tell me. 


EXPECTED RESULT
No flickering.

SOFTWARE/OS VERSIONS
Linux: Debian testing (Bullseye), kernel 5.2.0-3-amd64
(available in About System)
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.5
Comment 1 Ike 2019-11-20 18:59:02 UTC
Created attachment 124033 [details]
Kwin support information while "Enable compositor on startup" is disabled

Added output of qdbus org.kde.KWin /KWin supportInformation while it is flickering and one while its fine.
Comment 2 Vlad Zahorodnii 2019-11-21 12:57:58 UTC
> In this case, I only noticed some flickering when typing in the password
> on the lock screen and sometimes in  kde panels.
If that's the case, then it's either an issue lower in software stack(e.g. driver) or faulty hardware.

> After my system updated KWin to 4:5.14.5-1+b1 (debian bullseye) and rebooted
Have you tried downgrading kwin package?

(In reply to Ike from comment #1)
> Created attachment 124033 [details]
> Kwin support information while "Enable compositor on startup" is disabled
> 
> Added output of qdbus org.kde.KWin /KWin supportInformation while it is
> flickering and one while its fine.
Hmm, according to this, the compositor is enabled.
Comment 3 Ike 2019-11-25 12:46:15 UTC
Created attachment 124111 [details]
[corrected] Kwin support information while "Enable compositor on startup" is disabled

I did something wrong while creating the first attachment where compositing is disabled. I replaced it with a correct one.
Comment 4 Ike 2019-11-25 12:50:28 UTC
(In reply to Vlad Zahorodnii from comment #2)

Thanks for the quick reply!

> > In this case, I only noticed some flickering when typing in the password
> > on the lock screen and sometimes in  kde panels.
> If that's the case, then it's either an issue lower in software stack(e.g.
> driver) or faulty hardware.

To be precise, it's not happening on the login manager before kde is started but when kde is locked, e.g. when waking up from sleep. 

> > After my system updated KWin to 4:5.14.5-1+b1 (debian bullseye) and rebooted
> Have you tried downgrading kwin package?

Not yet, I'll try this out until the end of the week.

> (In reply to Ike from comment #1)
> > Created attachment 124033 [details]
> > Kwin support information while "Enable compositor on startup" is disabled
> > 
> > Added output of qdbus org.kde.KWin /KWin supportInformation while it is
> > flickering and one while its fine.
> Hmm, according to this, the compositor is enabled.

Oops, that was my fault, I didn't restart kde properly. I uploaded a corrected file.
Comment 5 galder 2022-01-26 19:39:49 UTC
changing this old ticket to needs more info.

    Bugs placed into NEEDSINFO status will receive a reminder if the ticket:
        Is at least 15 days old
        Has not received any comment within 15 days
    If a bug remains in NEEDSINFO for another 15 days with no comment, it will be closed as RESOLVED > WORKSFORME.
    If a bug remains in NEEDSINFO with a comment provided within less than 15 days, no action will be taken (as it does not meet the above criteria).
Comment 6 Bug Janitor Service 2022-02-10 04:37:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Ike 2022-02-22 19:19:21 UTC
Wow, sorry guys for ignoring this for such a long time, shame on me... 
I was actually using my system without the compositor since this issue. I've just retested everything. The situation has changed for good but there are still some problems:

- When using OpenGL 2.0 or 3.1 and setting vsync to "Re-use screen content" there is no flickering, but most windows don't refresh anymore at all. The system is totally unusable in this setting.
- In all other settings, i.e. other vsync options unter OpenGL and all vsync options under XRender (incl. Re-use screen content) everythings fine, only observed flickering in the taskbar when hovering over it (as described in my original post)

How should we proceed with this? I can still try to downgrade to the kwin version before my initial post if you tell me how I can do this without breaking my system 😅

Current SOFTWARE/OS VERSIONS
kwin-x11 - 4:5.20.5-1
Linux: Debian testing (Bullseye), kernel 5.10.0-11-amd64
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 8 galder 2022-02-24 08:27:58 UTC
Hello,
thanks for your reply. I'm not sure how you could downgrade the version in a safe way. I'm  just a volunteer triaging tickets :)

Because this is an old ticket and now you are getting different problems, what I would recommend is to start over. 
Maybe try latest plasma version 5.24.2 and if you still have any issue report it in a new ticket.

what do you think?
Comment 9 Ike 2022-03-03 20:48:33 UTC
Yes, sounds good
Comment 10 galder 2022-03-04 07:40:06 UTC
great thanks