Commit d8ec33fe authored by Adam Jackson's avatar Adam Jackson 🎧

glx: Use vnd layer for dispatch (v4)

The big change here is MakeCurrent and context tag tracking. We now
delegate context tags entirely to the vnd layer, and simply store a
pointer to the context state as the tag data. If a context is deleted
while it's current, we allocate a fake ID for the context and move the
context state there, so the tag data still points to a real context. As
a result we can stop trying so hard to detach the client from contexts
at disconnect time and just let resource destruction handle it.

Since vnd handles all the MakeCurrent protocol now, our request handlers
for it can just be return BadImplementation. We also remove a bunch of
LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already
allocated its tracking resource on that XID.

v2: Update to match v2 of the vnd import, and remove more redundant work
like request length checks.

v3: Add/remove the XID map from the vendor private thunk, not the
backend. (Kyle Brenneman)

v4: Fix deletion of ghost contexts (Kyle Brenneman)
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 8753218b
...@@ -1295,7 +1295,7 @@ if test "x$GLX" = xyes; then ...@@ -1295,7 +1295,7 @@ if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
AC_SUBST(XLIB_CFLAGS) AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension]) AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la' GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la'
GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
else else
GLX=no GLX=no
......
...@@ -123,8 +123,6 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) ...@@ -123,8 +123,6 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
if (req->length != expected_size) if (req->length != expected_size)
return BadLength; return BadLength;
LEGAL_NEW_RESOURCE(req->context, client);
/* The GLX_ARB_create_context spec says: /* The GLX_ARB_create_context spec says:
* *
* "* If <config> is not a valid GLXFBConfig, GLXBadFBConfig is * "* If <config> is not a valid GLXFBConfig, GLXBadFBConfig is
......
This diff is collapsed.
...@@ -56,13 +56,10 @@ ...@@ -56,13 +56,10 @@
int int
__glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateContextReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->visual); __GLX_SWAP_INT(&req->visual);
...@@ -75,13 +72,10 @@ __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc) ...@@ -75,13 +72,10 @@ __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig); __GLX_SWAP_INT(&req->fbconfig);
...@@ -115,13 +109,10 @@ __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) ...@@ -115,13 +109,10 @@ __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->context);
...@@ -131,69 +122,28 @@ __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc) ...@@ -131,69 +122,28 @@ __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_MakeCurrent(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_MakeCurrent(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client; return BadImplementation;
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeCurrent(cl, pc);
} }
int int
__glXDispSwap_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client; return BadImplementation;
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readdrawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeContextCurrent(cl, pc);
} }
int int
__glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client; return BadImplementation;
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeCurrentReadSGI(cl, pc);
} }
int int
__glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXIsDirectReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->context);
...@@ -203,13 +153,10 @@ __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc) ...@@ -203,13 +153,10 @@ __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->majorVersion); __GLX_SWAP_INT(&req->majorVersion);
__GLX_SWAP_INT(&req->minorVersion); __GLX_SWAP_INT(&req->minorVersion);
...@@ -220,13 +167,10 @@ __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc) ...@@ -220,13 +167,10 @@ __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitGLReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->contextTag);
...@@ -236,13 +180,10 @@ __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc) ...@@ -236,13 +180,10 @@ __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXWaitXReq *req = (xGLXWaitXReq *) pc; xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitXReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->contextTag);
...@@ -252,13 +193,10 @@ __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc) ...@@ -252,13 +193,10 @@ __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCopyContextReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->source); __GLX_SWAP_INT(&req->source);
__GLX_SWAP_INT(&req->dest); __GLX_SWAP_INT(&req->dest);
...@@ -270,13 +208,10 @@ __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc) ...@@ -270,13 +208,10 @@ __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
__GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->screen);
return __glXDisp_GetVisualConfigs(cl, pc); return __glXDisp_GetVisualConfigs(cl, pc);
} }
...@@ -284,13 +219,10 @@ __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) ...@@ -284,13 +219,10 @@ __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
__GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->screen);
return __glXDisp_GetFBConfigs(cl, pc); return __glXDisp_GetFBConfigs(cl, pc);
} }
...@@ -312,13 +244,10 @@ __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) ...@@ -312,13 +244,10 @@ __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->visual); __GLX_SWAP_INT(&req->visual);
...@@ -380,13 +309,10 @@ __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc) ...@@ -380,13 +309,10 @@ __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxpixmap); __GLX_SWAP_INT(&req->glxpixmap);
...@@ -412,13 +338,10 @@ __glXDispSwap_DestroyPixmap(__GLXclientState * cl, GLbyte * pc) ...@@ -412,13 +338,10 @@ __glXDispSwap_DestroyPixmap(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_QueryContext(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_QueryContext(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryContextReq);
__GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->context);
return __glXDisp_QueryContext(cl, pc); return __glXDisp_QueryContext(cl, pc);
...@@ -474,13 +397,10 @@ __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) ...@@ -474,13 +397,10 @@ __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
__GLX_SWAP_INT(&req->pbuffer); __GLX_SWAP_INT(&req->pbuffer);
return __glXDisp_DestroyPbuffer(cl, pc); return __glXDisp_DestroyPbuffer(cl, pc);
...@@ -604,13 +524,10 @@ __glXDispSwap_DestroyWindow(__GLXclientState * cl, GLbyte * pc) ...@@ -604,13 +524,10 @@ __glXDispSwap_DestroyWindow(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->drawable); __GLX_SWAP_INT(&req->drawable);
...@@ -621,13 +538,10 @@ __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc) ...@@ -621,13 +538,10 @@ __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXUseXFontReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag); __GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(&req->font); __GLX_SWAP_INT(&req->font);
...@@ -641,13 +555,10 @@ __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc) ...@@ -641,13 +555,10 @@ __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->screen);
...@@ -657,13 +568,10 @@ __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) ...@@ -657,13 +568,10 @@ __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
int int
__glXDispSwap_QueryServerString(__GLXclientState * cl, GLbyte * pc) __glXDispSwap_QueryServerString(__GLXclientState * cl, GLbyte * pc)
{ {
ClientPtr client = cl->client;
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
__GLX_SWAP_SHORT(&req->length); __GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen); __GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->name); __GLX_SWAP_INT(&req->name);
......
This diff is collapsed.
...@@ -62,4 +62,8 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *); ...@@ -62,4 +62,8 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *);
extern const char GLServerVersion[]; extern const char GLServerVersion[];
extern int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap); extern int DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap);
extern int
xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId,
XID contextId, GLXContextTag newContextTag);
#endif /* _glxext_h_ */ #endif /* _glxext_h_ */
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
*/ */
#include "extension_string.h" #include "extension_string.h"
#include "glxvndabi.h"
typedef struct __GLXconfig __GLXconfig; typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig { struct __GLXconfig {
......
...@@ -109,11 +109,6 @@ __glXregisterPresentCompleteNotify(void); ...@@ -109,11 +109,6 @@ __glXregisterPresentCompleteNotify(void);
** State kept per client. ** State kept per client.
*/ */
struct __GLXclientStateRec { struct __GLXclientStateRec {
/*
** Whether this structure is currently being used to support a client.
*/
Bool inUse;
/* /*
** Buffer for returned data. ** Buffer for returned data.
*/ */
......
...@@ -152,8 +152,6 @@ __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc) ...@@ -152,8 +152,6 @@ __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc)
__GLXcontext *cx; __GLXcontext *cx;
int error; int error;
REQUEST_SIZE_MATCH(xGLXUseXFontReq);
req = (xGLXUseXFontReq *) pc; req = (xGLXUseXFontReq *) pc;
cx = __glXForceCurrent(cl, req->contextTag, &error); cx = __glXForceCurrent(cl, req->contextTag, &error);
if (!cx) { if (!cx) {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include "glamor.h" #include "glamor.h"
#endif #endif
#include "ephyr_glamor_glx.h" #include "ephyr_glamor_glx.h"
#include "glx_extinit.h"
#include "xkbsrv.h" #include "xkbsrv.h"
extern Bool ephyr_glamor; extern Bool ephyr_glamor;
......
...@@ -56,6 +56,7 @@ executable( ...@@ -56,6 +56,7 @@ executable(
libxserver_xkb_stubs, libxserver_xkb_stubs,
libxserver_xi_stubs, libxserver_xi_stubs,
libxserver_glx, libxserver_glx,
libglxvnd,
], ],
install: true, install: true,
) )
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#ifdef RANDR #ifdef RANDR
#include <randrstr.h> #include <randrstr.h>
#endif #endif
#include "glx_extinit.h"
#ifdef XV #ifdef XV
#include "kxv.h" #include "kxv.h"
...@@ -973,6 +974,8 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) ...@@ -973,6 +974,8 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
for (screen = card->screenList; screen; screen = screen->next) for (screen = card->screenList; screen; screen = screen->next)
KdAddScreen(pScreenInfo, screen, argc, argv); KdAddScreen(pScreenInfo, screen, argc, argv);
xorgGlxCreateVendor();
#if defined(CONFIG_UDEV) || defined(CONFIG_HAL) #if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
if (SeatId) /* Enable input hot-plugging */ if (SeatId) /* Enable input hot-plugging */
config_pre_init(); config_pre_init();
......
...@@ -1002,6 +1002,8 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) ...@@ -1002,6 +1002,8 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv)
vfbPixmapDepths[32] = TRUE; vfbPixmapDepths[32] = TRUE;
} }
xorgGlxCreateVendor();
for (i = 1; i <= 32; i++) { for (i = 1; i <= 32; i++) {
if (vfbPixmapDepths[i]) { if (vfbPixmapDepths[i]) {
if (NumFormats >= MAXFORMATS) if (NumFormats >= MAXFORMATS)
......
...@@ -15,7 +15,8 @@ xvfb_server = executable( ...@@ -15,7 +15,8 @@ xvfb_server = executable(
libxserver, libxserver,
libxserver_xkb_stubs, libxserver_xkb_stubs,
libxserver_xi_stubs, libxserver_xi_stubs,
libxserver_glx libxserver_glx,
libglxvnd,
], ],
install: true, install: true,
) )
...@@ -14,6 +14,10 @@ DRI3_BUILDDIR = $(top_builddir)/dri3 ...@@ -14,6 +14,10 @@ DRI3_BUILDDIR = $(top_builddir)/dri3
DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la DRI3_LIB = $(DRI3_BUILDDIR)/libdri3.la
endif endif
if GLX
GLXVND_LIB = $(top_builddir)/glx/libglxvnd.la
endif
if GLAMOR_EGL if GLAMOR_EGL
GLAMOR_EGL_SUBDIR = glamor_egl GLAMOR_EGL_SUBDIR = glamor_egl
endif endif
...@@ -70,6 +74,7 @@ LOCAL_LIBS = \ ...@@ -70,6 +74,7 @@ LOCAL_LIBS = \
$(DRI_LIB) \ $(DRI_LIB) \
$(DRI2_LIB) \ $(DRI2_LIB) \
$(DRI3_LIB) \ $(DRI3_LIB) \
$(GLXVND_LIB) \
$(top_builddir)/miext/sync/libsync.la \ $(top_builddir)/miext/sync/libsync.la \
$(top_builddir)/mi/libmi.la \ $(top_builddir)/mi/libmi.la \
$(top_builddir)/os/libos.la \ $(top_builddir)/os/libos.la \
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
#include "xf86InPriv.h" #include "xf86InPriv.h"
#include "picturestr.h" #include "picturestr.h"
#include "randrstr.h" #include "randrstr.h"
#include "glxvndabi.h"
#include "xf86Bus.h" #include "xf86Bus.h"
#ifdef XSERVER_LIBPCIACCESS #ifdef XSERVER_LIBPCIACCESS
#include "xf86VGAarbiter.h" #include "xf86VGAarbiter.h"
......
...@@ -83,6 +83,7 @@ glxSetup(void *module, void *opts, int *errmaj, int *errmin) ...@@ -83,6 +83,7 @@ glxSetup(void *module, void *opts, int *errmaj, int *errmin)
provider = LoaderSymbol("__glXDRI2Provider"); provider = LoaderSymbol("__glXDRI2Provider");
if (provider) if (provider)
GlxPushProvider(provider); GlxPushProvider(provider);
xorgGlxCreateVendor();
LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE); LoadExtensionList(GLXExt, ARRAY_SIZE(GLXExt), FALSE);
......
...@@ -51,6 +51,7 @@ srcs_xorg = [ ...@@ -51,6 +51,7 @@ srcs_xorg = [
xorg_link = [ xorg_link = [
libxserver, libxserver,
libglxvnd,
xorg_common, xorg_common,
xorg_loader,