[PATCH xserver 2/4] glx: Use vnd layer for dispatch (v3)

Adam Jackson ajax at redhat.com
Mon Feb 5 19:57:52 UTC 2018


On Mon, 2018-02-05 at 12:05 -0700, Kyle Brenneman wrote:

> In __glXDisp_DestroyContext, doesn't it need to record the fake XID that 
> it generates? If I'm reading it right, if the client deletes a current 
> context and later unbinds it, then xorgGlxMakeCurrent will call 
> FreeResourceByType with the original (already freed) XID, not with the 
> fake one.

Hah, yes it does. What I'd written would have GCd the context at client
disconnect but not before. We do look up the context by tag but then
free it by its (memory of its) ID, so we need to update that ID when we
ghost it. Nice catch!

> In xorgGlxThunkRequest, it needs to call glxServer.removeXIDMap to 
> remove the XID for a GLXDestroyGLXPbufferSGIX request.
>
> The handling for created XID's in xorgGlxThunkRequest looks correct. As 
> a minor note, you could set the "resource" variable in the switch 
> statement, rather than in a separate if/else block.
> 
> Also, I think the "if (!vendor)" block after the switch is dead code. 
> Every branch in the switch assigns something to vendor and returns an 
> error if it gets NULL.

All quite right. New version in a second, the thunk was also missing
some bounds checking.

- ajax


More information about the xorg-devel mailing list