Bug 8991

Summary: Protocol decode for X_GLXvop_GetDrawableAttributesSGIX(65546) is not implemented causing beryl blank screen
Product: xorg Reporter: wall_john <wall_john>
Component: Server/Ext/GLXAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: alexdeucher, colin, dberkholz, hanno, jcnengel, mat
Version: 7.2 (2007.02)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 8888    
Attachments:
Description Flags
xorg-server-1.1.99.901-GetDrawableAttributes.patch
none
xorg-server-1.1.99.901-glXDRIbindTexImage-target.patch
none
Enable generation of server-side dispatch for GetDrawableAttributesSGIX none

Description wall_john 2006-11-12 02:01:08 UTC
The protocol decode table in the server (GL/glx/indirect_table.c) has 
not an entry for X_GLXvop_GetDrawableAttributesSGIX(65546).

This cause beryl to complain:
...
beryl: pixmap 0x220004b can't be bound to texture
beryl: Couldn't bind redirected window 0x1000023 to texture
....
Comment 1 wall_john 2006-11-12 02:02:38 UTC
Created attachment 7752 [details] [review]
xorg-server-1.1.99.901-GetDrawableAttributes.patch
Comment 2 Kanru Chen 2006-11-25 23:57:36 UTC
I can confirm this bug. And the patch really helps.
Comment 3 Ian Romanick 2006-12-16 12:17:50 UTC
NAK.  The bug is in compiz / beryl.  They insist on using functions from
GLX_SGIX_pbuffer and GLX 1.3 WHEN THE SERVER DOES NOT SUPPORT EITHER.  That it
happened to work in the previous release is just dumb luck.
Comment 4 wall_john 2006-12-18 07:29:10 UTC
Created attachment 8157 [details] [review]
xorg-server-1.1.99.901-glXDRIbindTexImage-target.patch

if you use 'xorg-server-1.1.99.901-GetDrawableAttributes.patch' patch, you
should
use 'xorg-server-1.1.99.901-glXDRIbindTexImage-target.patch' together!
Comment 5 wall_john 2006-12-18 07:39:30 UTC
(In reply to comment #4)
> Created an attachment (id=8157) [edit]
> xorg-server-1.1.99.901-glXDRIbindTexImage-target.patch
> 
> if you use 'xorg-server-1.1.99.901-GetDrawableAttributes.patch' patch, you
> should
> use 'xorg-server-1.1.99.901-glXDRIbindTexImage-target.patch' together!

Because function '__glXDisp_GetDrawableAttributes' will always return
GLX_TEXTURE_RECTANGLE_EXT, and beryl will bind 'texture->target =
GL_TEXTURE_RECTANGLE_ARB;', so in function '__glXDRIbindTexImage' where
should always use "GL_TEXTURE_RECTANGLE_ARB" as target parameter!
Comment 6 Michel Dänzer 2006-12-18 10:38:35 UTC
(In reply to comment #3)
> NAK.  The bug is in compiz / beryl.  They insist on using functions from
> GLX_SGIX_pbuffer and GLX 1.3 WHEN THE SERVER DOES NOT SUPPORT EITHER.  

Sigh. Sorry Ian, but this rambling just isn't helpful. What are they supposed to
do, guess the drawable attributes and pray?

> That it happened to work in the previous release is just dumb luck.

But it worked. And it still works except for the dispatch, so I don't see why it
shouldn't be re-enabled.
Comment 7 Kristian Høgsberg 2006-12-18 19:14:21 UTC
(In reply to comment #6)
> (In reply to comment #3)
> > NAK.  The bug is in compiz / beryl.  They insist on using functions from
> > GLX_SGIX_pbuffer and GLX 1.3 WHEN THE SERVER DOES NOT SUPPORT EITHER.  
> 
> Sigh. Sorry Ian, but this rambling just isn't helpful. What are they supposed to
> do, guess the drawable attributes and pray?

I second that - and what is the problem, really, with providing bits of glx 1.3
while we're waiting for the big 1.3 push?  It's not like the functionality is
going to go away or change with 1.3, and as long as the server doesn't advertise
1.3 without implementing all the new entrypoints, I honestly don't see why we
can't do that.  If we want to fix it, let's finish up 1.3 instead of breaking
applications.
Comment 8 Sam Spilsbury 2006-12-31 08:42:36 UTC
Will these changes be included into xorg R7.2 final?
Comment 9 Colin Guthrie 2007-01-04 16:56:25 UTC
I needed these two patches on my 7.2 RC3 build to get rid of the compiz and
beryl errors.

Unf. I still get white/black screens etc. (like I used to get with nvidia blobs
when they were first released) but this is with the i810 driver.

The problem occured when we upgraded to Mesa 6.5.2 from 6.5 (confirmed as
reverting fixes the issue). I tried building server 1.1.99.903 to see if that
resolved the issue but it hasn't (so far). If anyone knows the solution, please
let me know.
Comment 10 Brian Paul 2007-01-09 16:55:10 UTC
That second patch is pretty ugly.  It'd be better to do something like this so
the original code is still visible and the reason for the change is documented:

#if 0  /* Code disabled to fix beryl (see bug 8991) */
 ... original code ...
#else
  target = GL_TEXTURE_RECTANGLE_ARB
#endif

Feel free to provide a more elaborate comment.
Comment 11 Adam Jackson 2007-01-10 12:35:28 UTC
(In reply to comment #10)
> That second patch is pretty ugly.  It'd be better to do something like this so
> the original code is still visible and the reason for the change is documented:

And, as I mentioned on xorg@, it's wrong.  EXT_tfp requires the implemented
behaviour; DoGetDrawableAttributes is wrong.
Comment 12 Ian Romanick 2007-01-11 15:38:14 UTC
Created attachment 8378 [details] [review]
Enable generation of server-side dispatch for GetDrawableAttributesSGIX

I punt.  If beryl and compiz assume that unadvertised GL or GLX functionality
is available, they are fundamentally broken.  By partially enabling this
functionality without advertising it, we are encouraging non-conformant,
non-portable applications.  This seems like a really bad thing for
infrastructure providers to do.  I guess I'm alone in that feeling.  Sigh...
Comment 13 Ian Romanick 2007-01-11 15:39:23 UTC
(In reply to comment #12)
> Created an attachment (id=8378) [edit]
> Enable generation of server-side dispatch for GetDrawableAttributesSGIX

The part I forgot to mention...apply this patch to glX_API.xml in Mesa and use
that to regenerate the server-side files.  I absolutely draw the line at
hand-editing generated source files. :)
Comment 14 Johannes Engel 2007-02-07 07:15:24 UTC
The patch from Wall John (and also the one in the xserver-1.2-branch in git) works somehow.
However it makes some KDE-applications unstable: kicker for example does not refresh anymore, sometimes the dialog for a command line (Alt+F2) does not show keyboard inputs although they are executed after pressing <Return>.
Comment 15 Daniel Stone 2007-02-27 01:34:37 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 16 Adam Jackson 2007-04-08 13:39:28 UTC
Move to 7.3 tracker.
Comment 17 Michel Dänzer 2007-08-01 10:19:47 UTC
(In reply to comment #14)
> However it makes some KDE-applications unstable: kicker for example does not
> refresh anymore, sometimes the dialog for a command line (Alt+F2) does not show
> keyboard inputs although they are executed after pressing <Return>.

If you're using XAA, make sure you have Option "XaaNoOffscreenPixmaps".

Fixed in xserver 1.2.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.