Bug 323553 (kwin-catalyst-legacy) - kwin uses wrong OpenGL backend with my ati 4570 card (fglrx)
Summary: kwin uses wrong OpenGL backend with my ati 4570 card (fglrx)
Status: RESOLVED DUPLICATE of bug 323527
Alias: kwin-catalyst-legacy
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 4.11.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-15 17:36 UTC by Lamarque V. Souza
Modified: 2013-08-24 05:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output of 'qdbus org.kde.kwin /KWin org.kde.KWin.supportInformation' when kwin fails to detect direct rendering (2.59 KB, text/plain)
2013-08-15 17:37 UTC, Lamarque V. Souza
Details
Output of 'qdbus org.kde.kwin /KWin org.kde.KWin.supportInformation' using KWIN_COMPOSE=O2 (6.00 KB, text/plain)
2013-08-15 17:39 UTC, Lamarque V. Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lamarque V. Souza 2013-08-15 17:36:09 UTC
Today I have upgraded my notebook to 4.11.0. Almost everything worked out of the box, the only exception was kwin's compositing support.

Looking at ~/.xsession-errors I could see those messages:

OpenGL vendor string:                   ATI Technologies Inc.
OpenGL renderer string:                 ATI Mobility Radeon HD 4500/5100 Series
OpenGL version string:                  2.1 (3.3.11672 Compatibility Profile Context)
OpenGL shading language version string: 
Driver:                                 Catalyst
Driver version:                         2.1
GPU class:                              R700
OpenGL version:                         2.1
GLSL version:                           0.0
X server version:                       1.12.4
Linux kernel version:                   3.10.6
Direct rendering:                       no
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
kwin(17322) KWin::checkGLError: GL error ( Init ):  "GL_INVALID_ENUM" 
kwin(17322): OpenGL 1 compositing setup failed 
QObject::connect: Cannot connect (null)::resetCompositing() to KWin::Compositor::restart()
kwin(17322): Failed to initialize compositing, compositing disabled

For some reason kwin does not detect that my notebook's setup is direct rendering capable. After some research I have found out that setting those two environment variables make kwin work with direct rendering:

export KWIN_DIRECT_GL=1
export KWIN_COMPOSE=O2
kwin --replace &

KWIN_COMPOSE=O2 means to use OpenGL2 according to kwin's wiki page and by the message above kwin was trying to use OpenGL1.

Reproducible: Always

Steps to Reproduce:
1. Run kwin-4.11.0 with a notebook with ATI HD4570 card and catalyst drivers ati-drivers-13.1_pre897 (legacy drivers).
Actual Results:  
kwin does not detect that the card is direct rendering capable.

Expected Results:  
kwin should detect that the card is direct rendering capable and enable compositing.

kwin-4.10.5 works without problems.
Comment 1 Lamarque V. Souza 2013-08-15 17:37:26 UTC
Created attachment 81728 [details]
Output of 'qdbus org.kde.kwin /KWin org.kde.KWin.supportInformation' when kwin fails to detect direct rendering
Comment 2 Lamarque V. Souza 2013-08-15 17:39:00 UTC
Created attachment 81729 [details]
Output of 'qdbus org.kde.kwin /KWin org.kde.KWin.supportInformation' using KWIN_COMPOSE=O2
Comment 3 Thomas Lübking 2013-08-15 17:46:00 UTC
this should be determined by opengltest/opengltest.cpp and that file was last touched Sat Oct 13 10:33:38 2012 +0200

What's the ouput of
aticonfig --get-pcs-key=LDC,ReleaseVersion

*** This bug has been marked as a duplicate of bug 323527 ***
Comment 4 Lamarque V. Souza 2013-08-15 17:59:49 UTC
evolucao ~ # aticonfig --get-pcs-key=LDC,ReleaseVersion
String: 8.771-100825a-104565C-ATI
Comment 5 Thomas Lübking 2013-08-15 18:25:48 UTC
> String: 8.771-100825a-104565C-ATI

That explains it.
opengltest.cpp

 // Enable direct rendering for AMD Catalyst driver 8.973/8.98 and later. 

But we'll detect 8.771

Did you update/change catalyst/fglrx as well? Interim?
Is it now the legacy driver (but was the "regular" one previously)
Comment 6 Lamarque V. Souza 2013-08-15 18:51:11 UTC
No. Until yesterday kwin-4.10.5 worked with this setup and the only things I recompiled/updated from yesterday were all KDE and hddtemp packages.

Some week ago I updated my kernel from 3.4.54 to 3.10.6 and because of that I had to recompile fglrx but kwin-4.10.5 continued to work after that.

I am using the legacy drivers for more than a year now. This particular version (ati-drivers-13.1_pre897) was first installed in February of this year, by that time I was running kwin-4.10.1 according to my logs.

By what you wrote it kwin should not be enabling direct rendering for my driver for a long time. I really do not know why it was working before.
Comment 7 Thomas Lübking 2013-08-15 19:06:39 UTC
Two possible explanations:
- you had KWIN_DIRECT_GL=1 globally exported before
- kwin_opengl_test could not be found before (is supposed to be in /usr/lib/kde4/libexec) - in that case we "guessed" direct rendering was right (since it's for the nvidia blob, MESA, virtualbox and the newer fglrx drivers)

Other i don't know.
Can you still check the 4.10 package contents / installation (did you eventually change the user, use a test user?)
Comment 8 Lamarque V. Souza 2013-08-15 19:25:34 UTC
I think the second explanation is more likely.

I do not have the 4.10 packages anymore. Gentoo deletes them after upgrading. I did not test with a different user, just my user. I have just tried to recompile kwin-4.10.5 but I would have to download some other packages and I do not have time for that right now.
Comment 9 abulak 2013-08-15 19:32:37 UTC
tip for future:
You can use FEATURES="unmerge-backup" in your make.conf