[Mesa-dev] [PATCH] glx: Demand success from CreateContext requests (v2)

Michel Dänzer michel at daenzer.net
Thu Aug 16 08:46:34 UTC 2018


On 2018-08-07 10:55 PM, Adam Jackson wrote:
> GLXCreate{,New}Context, like most X resource creation requests, does not
> emit a reply and therefore is emitted into the X stream asynchronously.
> However, unlike most resource creation requests, the GLXContext we
> return is a handle to library state instead of an XID. So if context
> creation fails for any reason - say, the server doesn't support indirect
> contexts - then we will fail in strange places for strange reasons.
> 
> We could make every GLX entrypoint robust against half-created contexts,
> or we could just verify that context creation worked. Reuse the
> __glXIsDirect code to do this, as a cheap way of verifying that the
> XID is real.
> 
> glXCreateContextAttribsARB solves this by using the _checked version of
> the xcb command, so effectively this change makes the classic context
> creation paths as robust as CreateContextAttribs.
> 
> v2: Better use of Bool, check that error != NULL first (Olivier Fourdan)
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list