Bug 354753 - AMDGPU driver: rendering artifacts
Summary: AMDGPU driver: rendering artifacts
Status: VERIFIED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 5.4.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-02 22:01 UTC by Maximilian Böhm
Modified: 2016-02-10 17:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KWinsupportInformation.txt (7.08 KB, text/plain)
2015-11-02 22:23 UTC, Maximilian Böhm
Details
Is this Tearing? (231.39 KB, image/jpeg)
2015-11-03 12:07 UTC, Maximilian Böhm
Details
glxinfo (97.48 KB, text/plain)
2015-11-03 19:31 UTC, Maximilian Böhm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maximilian Böhm 2015-11-02 22:01:53 UTC
I have a new Radeon R9 380 and I'm using the new AMDGPU kernel driver on Manjaro Linux with Linux 4.3 RC7.
Moving windows and content around my screen causes tearing, so I want to set VSync to "complete repaint" ("Vollständiges Neuzeichnen" in German), this worked with my former Radeon HD 7770.
But: Tearing remains, I can try all the VSync options in the Kwin/Compositing settings in Systemcontrol and different OpenGL versions and EGL/GLX.
I guess there is some kind of whitelist for compatible drivers. Would be very interested in help!
Comment 1 Thomas Lübking 2015-11-02 22:07:32 UTC
please attach the output of "qdbus org.kde.KWin /KWin supportInformation"
Comment 2 Maximilian Böhm 2015-11-02 22:23:40 UTC
Created attachment 95277 [details]
KWinsupportInformation.txt
Comment 3 Maximilian Böhm 2015-11-02 22:24:36 UTC
Here you go.
Only 23.9761 Hz on the DP display is interesting too, should make 60 Hz but this is another problem with Kscreen.
Comment 4 Thomas Lübking 2015-11-02 22:33:06 UTC
I actually suspect that to be the issue.

The GPU can only sync to one screen - the other screen will (more or less visibly) tear.
The screen is usually the primary one (unless you export __GL_SYNC_DISPLAY_DEVICE to override that, but I don't know whether the gallium driver supports the variable - KWin will, so if the driver doesn't you won't sync anywhere) so things *should* be synced on the DP screen and (horribly, bc. of the low framerate) tear on the HDMI screen.

=> inspect the DP capabilities with "xrandr -q" (avoid kscreen for the moment) and try to set it to another frequency (60Hz) and see what happens (in very doubt, restart "kwin_x11 --replace &" after adjusting the refreshrate, but it should be catched anyway)
Comment 5 Maximilian Böhm 2015-11-03 12:07:45 UTC
Created attachment 95292 [details]
Is this Tearing?
Comment 6 Maximilian Böhm 2015-11-03 12:18:35 UTC
Thank you! I tried to set xrandr parameters but nothing helped. After switching off the HDMI screen, a couple restarts and relogins I got 59.9966 Hz on each of them. But the tearing remains. And is still visible even only with the DP screen plugged in.
Another peculiarity: Setting Kwin to "Vollständiges Neuzeichnen"/"complete repaint" reduces the render framerate to 30 fps.  As well as "Bildschirm-Inhalt wiederverwenden". The other options give 60 fps (measured with the not-a-benchmark effect in Kwin).
Above I have uploaded an example of my screen tearing, it's just in the upper right corner (UHD 4K DP Monitor).
Comment 7 Thomas Lübking 2015-11-03 15:52:11 UTC
(In reply to Maximilian Böhm from comment #5)
> Created attachment 95292 [details]
> Is this Tearing?

Looks more like a monitor to me :-P

Ok, seriously - is that artifact (in the center of the picturem, I take) "static"?

"Tearing" describes the effect that the screen shows two different frames (typically n on top and n-1 on bottom) - the artifact that can be seen on the photo looks more like a broken vertex to me.

For the beginning try to run
  KWIN_USE_BUFFER_AGE=0 KWIN_EXPLICIT_SYNC=0 kwin_x11 --replace &

also please attach the output of glxinfo.

(In reply to Maximilian Böhm from comment #6)
> Another peculiarity: Setting Kwin to "Vollständiges Neuzeichnen"/"complete
> repaint" reduces the render framerate to 30 fps.

This implies quite some overhead, but it sounds more like a double sync, likely because the driver is configured with "Option "EXAVSync" "yes"" or provides some other internal sync meathod.

>  As well as "Bildschirm-Inhalt wiederverwenden".
Do. Not. Use. That. Setting. Ever! (There's an explicit warning)
Restart KWin afterwards by all means. Mesa switches to some ultra-slow path when trying to read from the frontbuffer.  The value is only good for nvidia and maybe fglrx (and since we now have increasing buffer age support, we might just as well remove it entirely at some point)
Comment 8 Maximilian Böhm 2015-11-03 19:31:30 UTC
Created attachment 95295 [details]
glxinfo
Comment 9 Maximilian Böhm 2015-11-03 19:43:07 UTC
I think you are right, so this is no typical tearing. I wasn't sure if you can call it that. But I actually know this behavior from my old Radeon HD 7770 + radeonsi driver  with *this* monitor setup and setting Kwin to "Vollständiges Neuzeichnen" was the solution for me. Just tried through the other available options in the menu.
Your command induced real and heavy tearing on the whole screen.
My 'vertex' is only on the right (or say: last third of screen) and only on fast effects. But I notice little 'real' screen tearing through the midst too. It is visible in movies too, even with compositing turned off.
Maybe it's just a side effect of the driver's so far missing reclocking? Doesn't seem like a cable problem, no artefacts under Windows 8.1.

Output of glxgears after your Kwin start command is in the attachment.
So far, "Automatisch" seems to be the most tearing-limiting option for me but it's far from tearing-free.
Comment 10 Maximilian Böhm 2015-11-03 19:50:05 UTC
(Sorry, glxinfo, not glxgears, of course! Boot without unplugged HDMI monitor.)
Comment 11 Thomas Lübking 2015-11-03 21:37:18 UTC
try
KWIN_PERSISTENT_VBO=0 kwin_x11 --replace &

On a random guess, try to
a) deactivate the blur and contrast effects
b) set the scaling method to smooth (not accurate)
c) deactivate the showfps effect

Also let's please stick with common naming schemes and not use "tearing" for somthing that looks like a scattered screen ;-)
The tearing prevention strategies can have no direct impact on the latter (so trying on them doesn't help, resp. only as far as the buffers aren't swapped very often in the "automatic" setting) - they will not resolve the problem ever.
Comment 12 Maximilian Böhm 2015-11-06 21:05:32 UTC
Your ideas couldn't help. But now, I'm actually thinking it's more the fault of the immature driver. I got classical screen tearing in videos and the repeatedly spin-up of the fans at all ten seconds got on my nerves, in addition 5.1 audio via HDMI was dysfunctional. Just switched back to my Radeon HD 7770 – never I bother me with Catalyst horror again. I will try this card and amdgpu driver again in some weeks or with Linux 4.4, thank you for your help.
Comment 13 Thomas Lübking 2015-11-06 22:50:57 UTC
Ok, let's see how the situation evolves.
Comment 14 Maximilian Böhm 2016-02-10 17:32:32 UTC
The rendering artefacts in Kwin are gone with Linux 4.5 RC3 AMDGPU + enabled AMDGPU Powerplay. Consider this fixed.