Bug 243991

Summary: Check for FBO causes problems with NVIDIA legacy drivers and freezes on config changes
Product: [Plasma] kwin Reporter: Maciej Mrozowski <reavertm>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cobus.carstens, codenamed004, ryampolsky, tioduke
Priority: HI    
Version: git master   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.5.1
Sentry Crash Report:
Attachments: screen just after switching to activate desktop effects (opengl compositing)

Description Maciej Mrozowski 2010-07-09 03:24:30 UTC
Created attachment 48704 [details]
screen just after switching to activate desktop effects (opengl compositing)

Version:           SVN (using Devel) 
OS:                Linux

This is KDE SC 4.5 svn branch, Qt-4.6.3, nvidia-drivers 173.14.25, xorg-server-1.7.6, GeForce FX 5200, TwinView

OpenGL compositing no longer works with multiscreen setup (Nvidia TwinView). This is since 4.5. Worked well as expected in 4.4 branch.

Reproducible: Always

Steps to Reproduce:
1. Enable TwinView
2. Start KDE workspace with opengl compositing and desktop effects enabled or activate it later

Actual Results:  
kwin falls back to XRender. Garbage is rendered (screenshot).
When forcing LIBGL_ALWAYS_INDIRECT=1 kwin --replace, OpenGL compositing is activated but numerous glitches appear (similar to screenshot), and nothing really feels to work. It's like kwin didn't receive information about appearing windows as they are not updated nor refreshed while some desktop effecs (like flip switch) seem to work a bit.

When desktop effects are disabled (or compositing suspended) it seems to work fine.
Of course there are occasionall glitches that were present before (like wrong areas occasioanlly being visually repainted for no reason (nothing changed there) or some window areas being 'removed' and painting desktop instead - usually related to painting tooltips on various plasma elements like system tray and task manager toolitps). But as those issue were already there - it's not regression - lack of TwinView compositing is the one though.


xsession-errors:

kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL vendor is "NVIDIA Corporation"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL renderer is "GeForce FX 5200/AGP/SSE2"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL version is "2.1.2 NVIDIA 173.14.25"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: Detected driver "nvidia" , version "173.14.25"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL vendor is "NVIDIA Corporation"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL renderer is "GeForce FX 5200/AGP/SSE2"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: GL version is "2.1.2 NVIDIA 173.14.25"
kwin(2619) KWin::CompositingPrefs::detectDriverAndVersion: Detected driver "nvidia" , version "173.14.25"
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
kwin(2619): OpenGL compositing self-check failed, falling back to XRender.
Comment 1 Thomas Lübking 2010-07-09 03:50:16 UTC
far guess: disable the blur plugin...
Comment 2 Maciej Mrozowski 2010-07-09 04:38:25 UTC
Nope, blur plugin is not even activated as apparently my gfx card doesn't meet hardware requirements.
If I wasn't clear - disabling TwinView makes compositing work.
Comment 3 Thomas Lübking 2010-07-09 12:15:46 UTC
was clear. i assume you're exceeding some buffer limit by the second screen - required by _a_ plugin (blur being the best candidate ;-)

disable all effect plugins and check whether compositing on TwinView works again.
If yes, re-enable them and see which breaks it.
Comment 4 Maciej Mrozowski 2010-07-09 15:15:54 UTC
I've bisected kwin (hard way...), and this regression is introduced with this specific commit:

http://websvn.kde.org/?view=revision&revision=1137490

Removing checks introduced in 1137490 fixes the problem.
Comment 5 Maciej Mrozowski 2010-08-06 19:59:29 UTC
Just for the record - related reviewboard entry is http://reviewboard.kde.org/r/4871/
Comment 6 Cobus Carstens 2010-08-12 11:37:35 UTC
Hi

I experience the same problem on Ubuntu Lucid Lynx with the KDE SC 4.5 release.
The 4.4 release worked fine.

Hardware: GeForce FX 5200, TwinView
Software:
    Package: libqtcore4
    Version: 4:4.7.0~beta2-0ubuntu3~lucid1~ppa4

    Package: nvidia-173
    Version: 173.14.22-0ubuntu11

    Package: xorg
    Version: 1:7.5+5ubuntu1

    Package: kde-window-manager
    Version: 4:4.5.0b-0ubuntu1~lucid1~ppa2
Comment 7 Martin Flöser 2010-08-22 09:18:13 UTC
*** Bug 248321 has been marked as a duplicate of this bug. ***
Comment 8 Martin Flöser 2010-08-22 19:24:10 UTC
*** Bug 248711 has been marked as a duplicate of this bug. ***
Comment 9 Martin Flöser 2010-08-22 19:27:11 UTC
I think I'm going to revert the offending commit - it's causing too much trouble and we fixed the most serious problems for free drivers by enabling direct rendering for them.
Comment 10 rob 2010-08-22 22:16:46 UTC
My bug (248711) was marked a dup of this one.

I saw this report before submitting mine, but didn't think it was a duplicate.  So I just want to make sure that it's really the same thing.  I don't know what 'TwinView' is (dual monitor support?), so I don't think I have it enabled.  Or if I do, how do I detect that and turn it off?

Thanks,
Rob
Comment 11 rob 2010-08-22 22:21:02 UTC
More from bug 248711.  Ran the nvidia utility, and under X Server Display Configuration, it displays the following (which explicitly states that TwinView is disabled).  Are you sure my bug is a duplicate?

Unable to load X Server Display Configuration page:

Dynamic TwinView is disabled on screen 0.
To enable it, enable the option "Enable duplicate display
on the second display" in DrakX11 (Mandriva Control Center =>
Hardware => Set up the graphical server => Options).
Comment 12 Thomas Lübking 2010-08-22 22:41:00 UTC
very likely. there's a massive amount of "similar" problem reports (freezes - press shift+alt+f12 - or fragmented screes depending on the resolution, latter one just like this on your particular GPU, see the other two dupes and bug #241402, while it's not clear that latter one is really related)

This apparently defers from a protection check, that seemed necessary because some GPUs/drivers propagate functions they do not actually (sanely) implement.
No it looks like touching the "broken" function does not only hint teh functions inavailability but also leaves the GPU in some "diminished" defined state :-(

If it's this one can probably expect distros to ship "interim fixes" (well, hopefully)
Comment 13 Martin Flöser 2010-08-22 22:43:24 UTC
Adjusted the title - it was too specific to one problem caused by the bug.
Comment 14 rob 2010-08-22 23:06:59 UTC
Makes sense.  Thanks for the clarification.
Comment 15 Martin Flöser 2010-08-25 18:51:02 UTC
SVN commit 1167908 by graesslin:

Revert rev 1137490: it caused compositing not working with legacy NVIDIA drivers and might be responsible for freezes when changing config.
BUG: 243991
CCBUG: 241402
FIXED-IN: 4.5.1



 M  +0 -20     kwinglutils.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1167908
Comment 16 Martin Flöser 2010-08-25 18:53:51 UTC
SVN commit 1167909 by graesslin:

Forward port rev 1167908
Revert rev 1137490: it caused compositing not working with legacy NVIDIA drivers and might be responsible for freezes when changing config.
It can be reverted as there is already a better fix for buggy drivers present in 4.5.1.
Did I mention that I love drivers?
CCBUG: 243991
CCBUG: 241402

 M  +0 -20     kwinglutils.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1167909
Comment 17 rob 2010-08-27 17:13:37 UTC
Just got a KDE (and nvidia) update last night from PCLinuxOS.  Looks like something was done about this.  Effects work somewhat better on my machine, though I still have the same problems (screen not painting changes) - just less frequently.  Compiz still works.

Oddly, it looks like my nvidia settings have reverted to a lower color depth (not sure how to verify that).  I still have the default color depth set to 24-bit in xorg.conf, but the colors seem washed out now, and gradients seem less '3D'.  Don't know if KDE is doing this or if it has something to do with the nvidia update.

For what it's worth, I tried lowering the resolution from 1920x1080 to 1280x1024, which used to work with no problems.  The colors still look washed out.
Comment 18 Martin Flöser 2010-08-28 15:50:36 UTC
*** Bug 244041 has been marked as a duplicate of this bug. ***