Bug 274607

Summary: No decorations when activating desktop effects with r300g and kde 4.6.80
Product: [Plasma] kwin Reporter: Stefano <stavallo>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 4.7.0
Attachments: screen snapshot
New try

Description Stefano 2011-05-31 14:49:15 UTC
Version:           unspecified (using Devel) 
OS:                Linux

I have a Radeon X300 card and I am using the gallium r300g driver. With kde 4.6, I was able to use desktop effects. After upgrading to kde 4.6.80 (archlinux x86_64 binaries), when I activate the desktop effects the window decorations disappears. This happens with the option "Use OpenGL 2 shaders" disabled (if it is enabled, I get a full black screen). The kdebase-workspace package has been built with KWIN_BUILD_WITH_OPENGLES=OFF. However, I also built the package with KWIN_BUILD_WITH_OPENGLES=ON and the behavior is the same.

I read that disabling "Use OpenGL 2 shaders" we should get the old code and hence I would expect desktop effects to work. Am I missing something?

kwin --replace outputs:

OpenGL vendor string:                   X.Org R300 Project
OpenGL renderer string:                 Gallium 0.4 on ATI RV370
OpenGL version string:                  2.1 Mesa 7.11-devel
OpenGL shading language version string: 1.20
Driver:                                 R300G
GPU class:                              R300
OpenGL version:                         2.1
GLSL version:                           1.20
Mesa version:                           7.11
X server version:                       1.10.2
Linux kernel version:                   2.6.39
Direct rendering:                       yes
Requires strict binding:                yes
GLSL shaders:                           limited
Texture NPOT support:                   limited

If I have to provide more info, please ask.

Reproducible: Always

Steps to Reproduce:
Activate desktop effects

Actual Results:  
Window decorations disappear
Comment 1 Stefano 2011-05-31 14:55:11 UTC
Created attachment 60510 [details]
screen snapshot
Comment 2 Martin Flöser 2011-05-31 17:29:20 UTC
please try the patch attached to bug #269576. As I understand you are able to recompile and test on R300G, so I might add another patch to address the black screen issue.
Comment 3 Stefano 2011-05-31 19:30:07 UTC
I recompiled with the one-line patch attached to bug #269576, but both the problem mentioned in that bug report and the problem of no window decorations are still there. I recompiled kdebase-workspace with the following options (used by the Arch packager):

        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_SKIP_RPATH=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DWITH_Xmms=OFF \
        -DWITH_Googlegadgets=OFF \
        -DWITH_libgps=OFF \
        -DWITH_Prison=OFF \
        -DWITH_NetworkManager=OFF \
        -DKWIN_MOBILE_EFFECTS=OFF \
        -DWITH_OpenGLES=OFF \
        -DKWIN_BUILD_WITH_OPENGLES=OFF

I can make other tests, if you need, thanks.
Comment 4 Martin Flöser 2011-05-31 20:07:08 UTC
Created attachment 60525 [details]
New try

Thanks for testing the first version. This patch improves the last one (one more check) and adds a check against the black screen issue.

It is highly appreciated that you can test the patches. Not having the hardware in combination with drivers announcing support for features it does not support, makes it non-trivial to write better checks.
Comment 5 Stefano 2011-06-01 10:08:51 UTC
Both bugs are still there. Additionally, now I get the message:

kwin(2360) KWin::EffectsHandlerImpl::loadEffect: EffectsHandler::loadEffect : Effect  "kwin4_effect_blur"  is not supported 

when blur is enabled. The blur effect worked with kde 4.6.

BTW I am happy to offer my small contribution by testing patches...
Comment 6 Stefano 2011-06-01 10:17:42 UTC
Forgot to say that I was testing with the option "Use OpenGL 2 Shaders" disabled. In that case, bug #269576 is still there and windows have no decorations when enabling desktop effects.

Then I enabled the option "Use OpenGL 2 Shaders" and the above two issues are still there. However, contrarily to what I had before applying your patch, when I enable desktop effects I no longer get a black screen. Also, kwin --replace outputs:

kwin(2360): Shaders are not supported

(in addition to the message saying that blur is not supported)
Comment 7 Martin Flöser 2011-06-01 17:50:13 UTC
Do I understand correctly that with the patch you don't get the black screen any more, no matter how the options are?
Comment 8 Stefano 2011-06-01 18:07:56 UTC
Correct. With the patch the behavior is the same, independently of whether the option "Use OpenGL 2 Shaders" is enabled or disabled. The behavior is:

- bug #269576 is present
- windows have no decorations when enabling desktop effects (as shown in the attached snapshot)
- NO black screen

Without the patch, I only got the black screen when the option "Use OpenGL 2 Shaders" was enabled.

I am building the package with KWIN_BUILD_WITH_OPENGLES=OFF
Comment 9 Martin Flöser 2011-06-01 18:25:54 UTC
Git commit b646e7eb9a67971d7abb8056c06016de920419f7 by Martin Gräßlin.
Committed on 01/06/2011 at 18:21.
Pushed by graesslin into branch 'master'.

Disable Shader Scene for LimitedGLSL GPUs

This was causing problems with R300G. The GPU supports only limited
GLSL and seems not to be up to rendering the scene appropriate. So
let's better disable the OpenGL 2 branch for such GPUs. If the user
really wants to use it, there is the GLES backend which does not
check for limited GLSL.
BUG: 274457
CCBUG: 274607
FIXED-IN: 4.7.0

M  +1    -1    kwin/libkwineffects/kwinglutils.cpp     

http://commits.kde.org/kde-workspace/b646e7eb9a67971d7abb8056c06016de920419f7
Comment 10 Martin Flöser 2011-06-01 18:27:31 UTC
thanks for the feedback, no concerning the decorations: can you please try:

* kwin --graphicssystem raster --replace

* kwin --graphicssystem native --replace



I must admit I'm a little bit lost that the NPOT change does not improve the situation.
Comment 11 Stefano 2011-06-01 18:52:52 UTC
(In reply to comment #10)
> * kwin --graphicssystem raster --replace

this solves both bug #269576 and the no decorations problem. Great!
 
> * kwin --graphicssystem native --replace

with this, both problems are present (I think this is what I  was using by default).

Do you want me to try the raster system without your patch?

Thanks for your help
Comment 12 Martin Flöser 2011-06-01 19:03:00 UTC
> Do you want me to try the raster system without your patch?
yes please, but now I am even more confused than before. I would have expected that it works 
with native but not with raster...
Comment 13 Stefano 2011-06-01 19:25:37 UTC
Ok, reverted to the original arch package, which of course does not include your patch. Two differences:

- with the option "Use OpenGL 2 Shaders" *enabled*, I get a black screen even with raster  (this problem is solved with your patch)

- the blur effect works with raster. With your patch and raster, the blur effect did not work

I can only guess the big headache all these combinations may cause to you...
Comment 14 Stefano 2011-06-01 20:27:37 UTC
Just to tell you that I am leaving and I will not be able to make other tests until Monday. Thanks
Comment 15 Martin Flöser 2011-07-01 16:08:01 UTC
Git commit f09e3a98d7def528b0d13d02824ec1b5843a7d11 by Martin Gräßlin.
Committed on 01/07/2011 at 18:04.
Pushed by graesslin into branch 'KDE/4.7'.

Fix decoration rendering with GL_TEXTURE_RECTANGLE_ARB

When using graphicssystem native the texture may be using
GL_TEXTURE_RECTANGLE_ARB instead of GL_TEXTURE_2D. This
needs to be honoured in order to make KWin work reliable
with e.g. R300 chipsets.

BUG: 274607
CCBUG: 276622
FIXED-IN: 4.7.0

M  +11   -5    kwin/scene_opengl.cpp     
M  +1    -1    kwin/scene_opengl.h     

http://commits.kde.org/kde-workspace/f09e3a98d7def528b0d13d02824ec1b5843a7d11