Bug 363079 - artifacts, mostly seen with firefox and eclipse
Summary: artifacts, mostly seen with firefox and eclipse
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 5.6.3
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-14 19:10 UTC by je.joakim
Modified: 2016-05-29 13:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kwin support (4.70 KB, text/plain)
2016-05-21 20:25 UTC, je.joakim
Details
xorg (29.13 KB, text/plain)
2016-05-21 20:25 UTC, je.joakim
Details
glxinfo (24.52 KB, text/plain)
2016-05-21 21:17 UTC, je.joakim
Details
video_clip (3.53 MB, video/mp4)
2016-05-22 13:12 UTC, je.joakim
Details
xorg.0.log 20-intel.conf uxa (26.24 KB, text/plain)
2016-05-22 16:21 UTC, je.joakim
Details
When firefox is minimized, earlier frame from animation is still visible (3.47 MB, image/jpeg)
2016-05-22 16:46 UTC, je.joakim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description je.joakim 2016-05-14 19:10:53 UTC
Lots of window tearing in firefox, eclipse. Not seen when only displaying the desktop. Smooth scrolling set to off seem to reduce the amount of flickering, but does not fix the problem entirely. Tried XRender, openGl 3.1, 2.0 with all vsync settings and tearing is always present, but sometimes there are bursts of very intense tearing and during this time the computer is unusable. Restarting seem to temporarily fix it, then it gradually starts over again.

There are no visible error prints or messages.

HW: intel HD graphics, i5-6200U, FHD.
KDE plasma: 5.6.3
KDE frameworks: 5.21.0
Qt: 5.5.1
kernel:4.5.3-1


Reproducible: Always

Steps to Reproduce:
1. startup a intel core-i5 6200U with intel HD graphics laptop
2. launch firefox and/or eclipse
3. normal usage

Actual Results:  
tearing occurs every now and then and sometimes in crescendoes. 


Lots of web posts describes similar symptoms, some with suggested solutions that doesn't seem to have any effect in this case. During the bursts it is not possible to use the computer.

Hope this helps
Thanks,
Regards
Comment 1 Thomas Lübking 2016-05-16 11:59:17 UTC
> During the bursts it is not possible to use the computer.
Are you sure we're actually talking about "tearing"? (What would be "ugly" but rather not a blocker)
Can you record a video of the phenomenon?

Does it also happen with suspended compositor? (SHIFT+Alt+F12)
Comment 2 je.joakim 2016-05-21 19:59:00 UTC
Hi,

Sorry for late response. Best text example I can think of is: CRT monitor or TV with an in-cable that got a slight intermittent loose connection. Then if the cable is moved just a little it causes distortions in the image. Did run the same laptop with win10 and didn't see the it.

It is not periodic, but it looks like it gets a little worse over time. It can be seen when applications like firefox, eclipse and even "configure desktop window" is open. Not seen when it is only the desktop background showing or terminal. Once when new plasma/kernel packets were installed, something seem to be reset and for a while it looked to be fixed, then gradually it started again.

It should probably not be a blocker, please change to a suitable priority. It is a bit troublesome but it doesn't block usage that much.

shit+alt+f12 closes all windows, graphics and, screen goes black with an underscore in the upper left corner and computer becomes unresponsive. Reboot is needed.

Regards
Comment 3 Thomas Lübking 2016-05-21 20:17:09 UTC
> shift+alt+f12 closes all windows
No, that sounds more like you pressed CTRL+Alt+F12, CTRL+Alt+F<x> jump to the kernels virtual terminal x - X11 nowadays usually runs on VT1, so CTRL+Alt+F1 would bring you back.

The problem you describe is by no means "tearing", please run
   qdbus org.kde.KWin /KWin supportInformation > ~/kwin.support
and attach the resulting kwin.support file as well as /var/log/Xorg.0.log
Comment 4 je.joakim 2016-05-21 20:25:15 UTC
Created attachment 99123 [details]
kwin support
Comment 5 je.joakim 2016-05-21 20:25:43 UTC
Created attachment 99124 [details]
xorg
Comment 6 je.joakim 2016-05-21 20:41:11 UTC
If tearing is a specific type of error, then this is more general, like quick flickering distortions. Please update this as well if needed.

User activity in for example Firefox, like hitting ctrl+o, then cancel and switching between tabs, surfing in on news sites increases the distortions and it goes a bit crazy for a while. It calms down after ~10 +/- 5secs seconds into the usual sporadic distortions which there can be minutes between.

Thanks for looking into this,
Regards
Comment 7 Thomas Lübking 2016-05-21 21:08:23 UTC
The intel driver is unloaded (you're on the modesetting driver alongside glamor) and you're on xrender compositing. (But I do not understand why, your IGP seems supported by the intel driver version and it should™ take precedence on autoconfiguration if available)

Can you please also attach the output of
   glxinfo > ~/glx.info

I assume you'll encounter the same problems with suspended compositor (so not a kwin issue at all) and suspect a driver bug, triggered by firefox et al. (they still operate on OpenGL) directly.

I's propose to try to enforce intel and disable glamor for a beginning.

add a file /etc/X11/xorg.conf.d/20-intel.conf (requires root permissions) with the content:

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "sna"
EndSection

respecitvely alter any present file itr.

If this doesn't help, try to even fallback to

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "uxa"
EndSection

Then restart X11 (logging out and back in should be sufficient, in doubt reboot ;-)

Ensure that the intel driver doesn't get unloaded in /var/log/Xorg.0.log after those changes.
Comment 8 Thomas Lübking 2016-05-21 21:09:10 UTC
PS: if things fail badly afterwards and you're presented with a textshell, just remove /etc/X11/xorg.conf.d/20-intel.conf again
Comment 9 je.joakim 2016-05-21 21:17:35 UTC
Created attachment 99125 [details]
glxinfo
Comment 10 je.joakim 2016-05-21 21:21:22 UTC
XRender in compositor is because I must have left it in that setting while trying different combinations. The default was set to OpenGL 3.1, EGL and Automatic vsync. Have not found a combination that for sure do any visible difference to the artifacts. Have set it back to OpenGL 3.1 now.
Comment 11 Thomas Lübking 2016-05-21 21:32:43 UTC
There're several reports about GLX clients not painting correctly when using EGL compositing, I'd suggest to switch to GLX (and somehow doubt EGL would have been the default? Distro deviation?)

Please check the behavior w/ the compositor suspended (SHIFT+Alt+F12, *SHIFT* - the thing to type upcase chars ;-) to rule in or out the compositor.

According to the glxinfo, the GL installation is ok, but you explained the xrender setting anyway.
Comment 12 je.joakim 2016-05-21 21:56:16 UTC
It could have been GLX as default in the beginning and I just remember it wrong. :) 
It is OpenSuse Tumbleweed.

Think there is less artifacts yet using "uxa". But the touchpad is very unsensitive instead, and scrolling in webpages is not so smooth as previously and fans are spinning more often.

Maybe it is related to drivers?
Comment 13 je.joakim 2016-05-21 22:11:37 UTC
I don't see a visible difference when using SHIFT + ALT + F12, what should I look for?
Comment 14 Thomas Lübking 2016-05-21 22:18:47 UTC
Windows loose shadows and transparency (won't fade in), effects like "present windows" or "desktop grid" don't work w/o compositing; such things.

UXA is the least efficient driver, SNA is much better. So you're still seeing artifacts despite SNA and UXA (and ensured the intel driver isn't unloaded)?

Do you think you can make a screenshot or video of the issue?
Comment 15 je.joakim 2016-05-22 09:37:27 UTC
Hi,

Not sure how to record it, there seem to be a lot less artifacts with UXA, but for some reason the touchpad became very unresponsive, its settings are grey-marked and cant be changed.
Removing/readding/changing the 20-intel.conf file does not have any effect on this.
:)
Should it work to just remove the 20-intel.conf file to revert back to the previous driver?
Comment 16 je.joakim 2016-05-22 13:12:55 UTC
Created attachment 99131 [details]
video_clip

video may be upside down, directors fault :)
Comment 17 Thomas Lübking 2016-05-22 13:43:35 UTC
Thanks, that may contain "tearing" not sure, could be the recording, but the key problem is that briefly a black frame appears.
Since this also happens w/ xrender compositing, it's not the buffer_age usage of kwin - is the problem constrained to the (firefox) window or does it cover the entire screen as soon as (firefox) is up?

Reg. uxa ./. your touchpad: there should be no direct relation whatsoever, but uxa may cause more CPU load, making the system less responsive in general.
Removing the file should restore the status quo ante, but you need to restart X11 in addition, of course ;-)

Can you please attach Xorg.0.log from a session where the intel conf snippet was still present? (to verify the impact)
Comment 18 je.joakim 2016-05-22 16:21:55 UTC
Created attachment 99133 [details]
xorg.0.log 20-intel.conf uxa
Comment 19 je.joakim 2016-05-22 16:46:16 UTC
Created attachment 99134 [details]
When firefox is minimized, earlier frame from animation is still visible
Comment 20 je.joakim 2016-05-22 17:07:45 UTC
Have only seen the artifact when firefox and/or eclipse and/or "configure desktop" windows are started. It is likely visible with more applications as well, but these are for sure. Not 100% sure but think it has also occurred when the KWallet popup was displayed directly after starting up.

In the video clip, the entire image is blurry for a short time because of the camera focusing. But the other artifacts are as they appear on the display.

Have not yet seen the artifact when only the desktop is displayed and I can't see it when firefox and eclipse are started but the windows are minimized. Minimizing all the windows during an ongoing distortion seem to stop it.

Noticed also, that when minimizing there is sometimes some sort of ghosting effect that is visible until that area of the display is repainted again. For instance, moving mouse pointer or another window over it removes it. Added a photo of this as well.

Yes touchpad is probably another issue.

Regards,
Comment 21 je.joakim 2016-05-22 17:14:15 UTC
The effect seem to be mostly visible in the Windows, but sometimes the toolbar, system watch and tray is also affected by it as well.

Regards,
Comment 22 Thomas Lübking 2016-05-25 20:39:09 UTC
Ie. it's the clients GL contexts (toolbar and every plasmoid are GL contexts via QtQuick)
Maybe the GL context of kwin is affected as well (but it would affect the entire screen then, crossing several windows, also such not using OpenGL, eg. xterm), but even then it's a bug in the driver (since all GL clients seem affected)

You can disable hardware acceleration for firefox in "about:config". If KWin becomes too annoying, resort to XRender compositing.

Marking upstream since though client bugs would be invalid, it's pretty save to assume that KWin's GL contexts are to be affected as well.

Workaround suggestions (wild shots):

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "sna"
   Option      "TearFree"    "true"
EndSection

==== or ====

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "sna"
   Option      "DRI" "3"
EndSection
Comment 23 je.joakim 2016-05-29 13:01:29 UTC
Hi,

Yes hopefully it is something like the drivers, so once those becomes better the effects disappears as well. Thanks for looking into it.

Regards