Bug 24321

Summary: glXQueryExtension doesn't set eventBase and errorBase
Product: Mesa Reporter: Andrey Tsyvarev <tsyvarev>
Component: GLXAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 7.5   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: return 0 for errorBase and eventBase
another patch for glXQueryContext()

Description Andrey Tsyvarev 2009-10-05 07:55:24 UTC
The description of glXQueryExtension states:

error base is used to return the value of the first error code and
event base is used to return the value of the first event code. The constant error codes and event codes should be added to these base values to get the actual value.

But this function doesn't set error base and event base value, though function returns True (GLX extension is supported by the display).

After executing this code:

Display* display = XOpenDisplay(NULL);
int errorBase = -10, eventBase = -10;
glXQueryExtension(display, &eventBase, &errorBase);

errorBase and eventBase remains -10.

Mesa 6.2 implements this function correctly.
Comment 1 Brian Paul 2009-10-06 08:28:33 UTC
I'm guessing that you're using the "fake" GLX library and not the real GLX library.  When you're using fake GLX we're just emulating the GLX library so the errorbase and eventbase values are meaningless.  I guess we could set them to zero.  I'll attach a patch.
Comment 2 Brian Paul 2009-10-06 08:29:10 UTC
Created attachment 30111 [details] [review]
return 0 for errorBase and eventBase

Does this patch help you?
Comment 3 Andrey Tsyvarev 2009-10-07 08:00:41 UTC
Yes, I use Mesa, configured with --with-driver=xlib.

> errorbase and eventbase values are meaningless

Is this mean, that GLX errors and events have never arised in this case of GLX?

And what about XQueryExtension() for GLX_EXTENSION_NAME?
As I undestand, it should return same errorBase and eventBase, as glXQueryExtension. But even in this "fake" GLX case, it returns concrete values(155 for first_error, and 93 for first_event on my system).
Comment 4 Brian Paul 2009-10-07 13:42:30 UTC
You're right, we can always call XQueryExtension().
We'll always return True from glXQueryExtension() since we're trying to fake GLX.  But when there really is GLX we can return real errorBase and eventBase values.  I don't know who would depend on this but we can do it.
I'll attach another patch.
Comment 5 Brian Paul 2009-10-07 13:47:32 UTC
Created attachment 30145 [details] [review]
another patch for glXQueryContext()
Comment 6 Brian Paul 2009-11-09 07:31:07 UTC
This was fixed with commit e3fff3daf031a997a1d4316e1a0e5c831573221d

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.