Bug 321843

Summary: glXCreateContextAttribsARB with emtpy attrib list creates bogus context on gma945
Product: [Plasma] kwin Reporter: Thomas Lübking <thomas.luebking>
Component: scene-openglAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: cfeck, fredrik, hrvoje.senjan
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.11
Attachments: Output with r111355

Description Thomas Lübking 2013-07-01 22:28:41 UTC
According to glXQueryContex() the resulting context is valid (returns 0) and returns same GLX_FBCONFIG_ID (98) and GLX_RENDER_TYPE (0) as a context created by the glXCreateNewContext equivalent

    	int attrib_list[] = { GLX_RENDER_TYPE, GLX_RGBA_TYPE, 0 };

or randomly:

    	int attrib_list[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 1, GLX_CONTEXT_MINOR_VERSION_ARB, 3, 0 };

with the difference that those contexts are reported to be direct and generates visual updates.

The way it is, GL compositing does not work at all on that chip/driver combo.

The "dead" context does not produce any GL Error output from kwin(1212)

I do atm. not have sufficient libs/headers on that device to actively debug GL (ie. gdwarf compile mesa) - if that is still required.

----------

OpenGL vendor string:                   Intel Open Source Technology Center
OpenGL renderer string:                 Mesa DRI Intel(R) IGD x86/MMX/SSE2
OpenGL version string:                  1.4 Mesa 9.1.3
Driver:                                 Intel
GPU class:                              i915/i945
OpenGL version:                         1.4
Mesa version:                           9.1.3
X server version:                       1.14.1
Linux kernel version:                   3.9.6
Direct rendering:                       no
Requires strict binding:                no
GLSL shaders:                           no
Texture NPOT support:                   yes
Virtual Machine:                        no

Reproducible: Always

Actual Results:  
No screen updates.
Comment 1 Fredrik Höglund 2013-07-01 23:20:05 UTC
All attributes have good default values, so passing in an empty list should work according to the specification.

But if specifying any attribute makes it work, then by all means set the version to 1.2 or something.
It's a reasonable workaround.

I just wonder why it's working with r600g, and not i915.
Comment 2 Hrvoje Senjan 2013-07-02 13:44:32 UTC
Created attachment 80900 [details]
Output with r111355

@Thomas, the patch indeed brought openGL1 to this chip. Thanks for that! :-)
Still remains https://bugs.kde.org/show_bug.cgi?id=321760#c12 (decos are not drawn)
(and *a lot* of kwin(1259) KWin::checkGLError: GL error ( PostPaint ):  "GL_INVALID_ENUM" but tbh. i can't remember was that present without the patch + LIBGL_ALWAYS_INDIRECT=no)
Comment 3 Thomas Lübking 2013-07-02 16:46:51 UTC
(In reply to comment #2)

> Still remains https://bugs.kde.org/show_bug.cgi?id=321760#c12 (decos are not drawn)

Can you open a new bug for that and attach the kwin supportinfo (now with GL)?

Have you tried both graphicssystems?
Also do you have commit 15d1bc6b4dbdd397c715a4036f30d58c2760357f ?

> (and *a lot* of kwin(1259) KWin::checkGLError: GL error ( PostPaint ): 
> "GL_INVALID_ENUM" but tbh. i can't remember was that present without 
The situation looks familiar and was then induced by lacking NPOT support and iirc somehow caused by using POT deco textures alongside ARB_Rectangle windows from GL_texture_from_pixmap.
Comment 4 Fredrik Höglund 2013-07-02 17:09:09 UTC
Run kwin with MESA_DEBUG=1
Comment 5 Thomas Lübking 2013-07-08 17:27:55 UTC
Git commit 7bf40a4b73f5059a5b8b12d034222387910f7182 by Thomas Lübking.
Committed on 01/07/2013 at 18:38.
Pushed by luebking into branch 'master'.

non-empty attrib_list for glXCreateContextAttribsARB

empty list is legal but causes bogus context on at least i915
REVIEW: 111355
FIXED-IN: 4.11

M  +2    -0    kwin/glxbackend.cpp

http://commits.kde.org/kde-workspace/7bf40a4b73f5059a5b8b12d034222387910f7182