[patch] Use dlsym instead of glXGetProcAddress in xdriinfo

Felix Kühling fxkuehl at gmx.de
Wed Nov 23 08:43:49 PST 2005


Am Mittwoch, den 23.11.2005, 08:30 -0800 schrieb Ian Romanick:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Brian Paul wrote:
> > Ian Romanick wrote:
> > 
> >> Actually, this code is totally bogus.  In X.org's default libGL,
> >> glXGetProcAddress *NEVER* returns NULL.  Ever.  Replace
> >> "glXGetScreenDriver" above with "glXLikesToSegfault" and you'll see what
> >> I mean. :)
> > 
> > At one time, querying "gl*" functions always returned non-null, but
> > querying "glX*" functions would return NULL for invalid functions. Has
> > that changed?
> 
> Ah yes, that is still the case.  I guess that's what I get for reviewing
> patches after getting up at 5AM take someone to the airport. :)
> 
> I've added a wiki page for glXGetProcAddress FAQs:
> 
> http://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL
> 
> > In any case, it's kind of against the rules to create new glX functions
> > like glXGetScreenDriver without defining an extension and putting the
> > proper suffix on the function name.
> 
> I was thinking the same thing, but I think we've already shipped a
> version with these names. :(  I think these functions initially didn't
> even begin with glX.  That was added later so that glXGetProcAddress
> could be used.  I might be misremembering, though (see previous 5AM
> comment).

You're remembering correctly. The original design proposed names that
started with __libgl... (or similar). I think we also discussed making
this a new extension and it was considered overkill. These functions are
not even defined in any GLX headers. The only program that I am aware of
using them is xdriinfo.

Regards,
  Felix

> 
> In this particular case, what should the suffix be?  MESA?  XORG?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
> 
> iD8DBQFDhJkTX1gOwKyEAw8RAq16AJ4xfQ1tbwOd4wSynRfQ0bKbrlj/2wCfdMZI
> hBqGr7x/Pq1+cXoO4+HSfOo=
> =X8i4
> -----END PGP SIGNATURE-----
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 
> 
-- 
| Felix Kühling <fxkuehl at gmx.de>                     http://fxk.de.vu |
| PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3  B152 151C 5CC1 D888 E595 |




More information about the xorg mailing list