Bug 411235

Summary: Nvidia context lost restoration broken for basic render loop
Product: [Plasma] plasmashell Reporter: Stephan Brunner <s.brunner>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED UPSTREAM    
Severity: minor CC: nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.16.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: KDE log
Xorg-Log
Screenshot
KDE ReplaceLog

Description Stephan Brunner 2019-08-24 08:02:45 UTC
SUMMARY
After doing a VTYSwitch away from Plasma, and then another VTYSwitch back, Plasma shell does not render correctly anymore.
The start menu and notifications are now transparent.
Note that the VTYSwitches cause a modeswitch from 4k to whatever the nvidia-driver uses as default.

I am using the latest nvidia-dkms drivers from the arch repos.
When using nouveau, no modeswitch happens, and plasma renders correctly after a modeswitch

The plasma log is kind of spammy for the same issue.

STEPS TO REPRODUCE
0. Use nvidia proprietary drivers
1. VTYSwitch to VTY2
2. VTYSwitch to Plasma
3. Click on start menu, it is now transparent
4. Any notification is also transparent

OBSERVED RESULT
Rendering of plasma is buggy after vtyswitch with modeswitch


EXPECTED RESULT
Plasma should render correctly


SOFTWARE/OS VERSIONS
Linux: 
  - `uname -a`: Linux XXXXX 5.2.9-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 16 11:29:43 UTC 2019 x86_64 GNU/Linux
KDE Plasma Version: 
  - `plasmashell --version`: plasmashell 5.16.4
KDE Frameworks Version: 6.51.0
Qt Version: 5.13.0

ADDITIONAL INFORMATION
nvidia-dkms 430.40-5 (ArchLinux)
Attached is the Xorg Log and Plasma Log.
Comment 1 Stephan Brunner 2019-08-24 08:03:09 UTC
Created attachment 122314 [details]
KDE log
Comment 2 Stephan Brunner 2019-08-24 08:03:22 UTC
Created attachment 122315 [details]
Xorg-Log
Comment 3 David Edmundson 2019-08-24 09:57:49 UTC
Can I see a screenshot?
Comment 4 Stephan Brunner 2019-08-24 10:06:39 UTC
Created attachment 122321 [details]
Screenshot

A notification popped up after the switch back. However, i was not fast enough to get it.
Sometimes the whole bar on top and the complete task bar is also transparent.
Comment 5 David Edmundson 2019-08-26 09:01:40 UTC
Can I see output of 

QSG_INFO=1 plasmashell --replace
Comment 6 Stephan Brunner 2019-08-27 15:46:02 UTC
Created attachment 122386 [details]
KDE ReplaceLog

Using `QSG_INFO=1 plasmashell --replace 2>&1 | ts '[%H:%M:%S]' | tee replacelog.log`:
I issued CTRL+ALT+F2 at approx. 17:44:14 and CTRL+ALT+F1 at approx. 17:44:16
Comment 7 David Edmundson 2019-08-27 16:14:37 UTC
[17:44:05] qt.scenegraph.general: QSG: basic render loop

Aha, I hoped it would be this. I can see the bug there.

No idea how you have an nvidia card and the non threaded render loop. Do you remember explicitly changing it?

If you open "kcmshell5 qtquicksettings" and select the threaded render loop things should work again.
Comment 8 Stephan Brunner 2019-08-27 16:20:55 UTC
>If you open "kcmshell5 qtquicksettings" and select the threaded render loop things should work again.
You're a genius! That was it! Thank you!


> No idea how you have an nvidia card and the non threaded render loop. Do you remember explicitly changing it?
TBH, no. But I have done the following things:
- Start plasma without the proprietary driver => using nouveau
- Manually play around with the display scale to force my 4k monitor to 100%
- Move around a second display when it is attached.

But otherwise, I honestly can't remember.
Comment 9 David Edmundson 2019-08-27 16:59:13 UTC
Made a Qt patch https://codereview.qt-project.org/c/qt/qtdeclarative/+/271912

Though I might still add a heuristic in KQuickAddons to not enable SurfaceResets on the non-threaded render loop