Bug 402175

Summary: Poor web video performance with compositing enabled
Product: [Plasma] kwin Reporter: gje968
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: minor    
Priority: NOR    
Version First Reported In: 5.12.7   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gje968 2018-12-15 23:00:20 UTC
SUMMARY
Running web videos consumes obscene quantities of GPU horsepower, proportional to the on-screen resolution of the video viewport. Smaller viewports, such as 640x360, run at a smooth 60FPS, but get progressively choppier as they are scaled, to the point where fullscreened content (3840x2160) displays at about 1 FPS. According to radeontop, scaling videos larger quickly pins the GPU usage to 100% (and I can hear the fans spin up).
The issue does not occur when playing video using mpv, or playing OpenGL video games at full resolution.
Disabling the compositor resolves the issue, and setting it to xrender instead of OGL actually improves performance slightly.

STEPS TO REPRODUCE
1. Open the Discord desktop client
2. Open a video in fullscreen
OR
1. Open Firefox
2. Open any web video (youtube, reddit, dailymotion, basically anything) in fullscreen
Note: this issue does not occur in Chromium, as it does not support hardware acceleration.

OBSERVED RESULT
Video performance tanks to ~1FPS, GPU pinned to 100% utilization

EXPECTED RESULT
Video remains at 60FPS, GPU utilization is under 25%

SOFTWARE/OS VERSIONS
Linux: Kubuntu 18.04, Linux 4.19.8-041908-generic
(available in About System)
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.47.0
Qt Version: 5.9.5

ADDITIONAL INFORMATION
I am using an RX480 with the amdgpu-pro-18.40-97810 drivers, 16GB of RAM, and an R5 2400G with the graphics disabled in the UEFI.
I have also tested on a laptop with an identical software configuration, an i7 6650U with 8GB of RAM, and a 2736x1824 display. The issue does not occur on this device.
Given that it does not occur on the other device, I can't be sure that it's not a driver issue, but given that OGL games work fine, I suspect it's the compositor.
Comment 1 Martin Flöser 2018-12-16 18:47:27 UTC
Please report to firefox. If rendering the same video with mpv doesn't result in problems it's obviously a bug in firefox and not in KWin.