summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Brenneman <kbrenneman@nvidia.com>2016-03-14 15:26:01 -0600
committerKyle Brenneman <kbrenneman@nvidia.com>2016-03-24 12:46:41 -0600
commit1d7ab91b76d0fbefaff4f4b8c7d019cbd18c9ff9 (patch)
treec9794cc792513f0fe42012055fadb5bb7371a342
parent547daaf228c918026825f0b58a56638afaf54d0e (diff)
Remove the x11glvnd extension.
Delete the x11glvnd directory. Commented out the two tests that depend on it, testx11glvndproto and testglxnscreens. Eventually, they should be rewritten to use the GLX_EXT_libglvnd extension instead.
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/x11glvnd/Makefile.am59
-rw-r--r--src/x11glvnd/x11glvnd.h81
-rw-r--r--src/x11glvnd/x11glvndclient.c206
-rw-r--r--src/x11glvnd/x11glvndproto.h136
-rw-r--r--src/x11glvnd/x11glvndserver.c552
-rw-r--r--src/x11glvnd/x11glvndserver.h55
-rw-r--r--tests/Makefile.am35
9 files changed, 19 insertions, 1107 deletions
diff --git a/configure.ac b/configure.ac
index b2ba9f8..932901f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,7 +240,6 @@ AC_CONFIG_FILES([Makefile
src/GLESv1/Makefile
src/GLESv2/Makefile
src/GLX/Makefile
- src/x11glvnd/Makefile
src/GLdispatch/Makefile
src/GLdispatch/vnd-glapi/Makefile
src/util/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 01c6e4c..b57606a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,5 @@
SUBDIRS = util \
GLdispatch \
- x11glvnd \
GLX \
OpenGL \
GLESv1 \
diff --git a/src/x11glvnd/Makefile.am b/src/x11glvnd/Makefile.am
deleted file mode 100644
index a907718..0000000
--- a/src/x11glvnd/Makefile.am
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2013, NVIDIA CORPORATION.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and/or associated documentation files (the
-# "Materials"), to deal in the Materials without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Materials, and to
-# permit persons to whom the Materials are furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# unaltered in all copies or substantial portions of the Materials.
-# Any additions, deletions, or changes to the original source files
-# must be clearly indicated in accompanying documentation.
-#
-# If only executable code is distributed, then the accompanying
-# documentation must state that "this software is based in part on the
-# work of the Khronos Group."
-#
-# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-
-noinst_HEADERS = \
- x11glvnd.h \
- x11glvndproto.h \
- x11glvndserver.h
-
-noinst_LTLIBRARIES = libx11glvnd_client.la
-
-INCLUDES = \
- -I$(top_srcdir)/include \
- -I$(srcdir)/../util/uthash/src
-
-libx11glvnd_client_la_CFLAGS = $(X11_CFLAGS) $(INCLUDES)
-
-libx11glvnd_client_la_LIBADD = $(XEXT_LIBS)
-
-libx11glvnd_client_la_SOURCES = \
- x11glvndclient.c
-
-x11glvnd_LTLIBRARIES = x11glvnd.la
-
-x11glvnddir = $(libdir)/xorg/modules/extensions
-
-x11glvnd_la_CFLAGS = \
- $(XORG_CFLAGS) \
- $(X11_CFLAGS) \
- $(INCLUDES)
-
-x11glvnd_la_LDFLAGS = \
- -module -avoid-version
-
-x11glvnd_la_SOURCES = \
- x11glvndserver.c
diff --git a/src/x11glvnd/x11glvnd.h b/src/x11glvnd/x11glvnd.h
deleted file mode 100644
index e9d5aa1..0000000
--- a/src/x11glvnd/x11glvnd.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#ifndef __X11GLVND_H__
-#define __X11GLVND_H__
-
-#include <X11/Xlib.h>
-
-/*
- * Describes the client-side functions implemented by the x11glvnd extension.
- * This is a simple extension to query the X server for XID -> screen and screen
- * -> vendor mappings, used by libGLX. This may eventually be replaced by a
- * server-side GLX extension which does the same thing.
- */
-
-#define XGLV_EXTENSION_NAME "x11glvnd"
-
-/*!
- * Determines if the x11glvnd extension is supported.
- *
- * \param[out] event_base_return Returns the base event code.
- * \param[out] error_base_return Returns the base error code.
- * \return True if the extension is available, or False if it is not.
- */
-Bool XGLVQueryExtension(Display *dpy, int *event_base_return, int *error_base_return);
-
-/*!
- * Returns the version of the x11glvnd extension supported by the server.
- *
- * \param[out] major Returns the major version number.
- * \param[out] minor Returns the minor version number.
- * \return nonzero if the server supports a compatible version of x11glvnd.
- */
-Bool XGLVQueryVersion(Display *dpy, int *major, int *minor);
-
-/*!
- * Returns the screen associated with this XID, or -1 if there was an error.
- */
-int XGLVQueryXIDScreenMapping(
- Display *dpy,
- XID xid
-);
-
-/*!
- * Returns the vendor associated with this screen, or NULL if there was an
- * error.
- *
- * The caller must free the string with XFree.
- */
-char *XGLVQueryScreenVendorMapping(
- Display *dpy,
- int screen
-);
-
-#endif // __X11GLVND_H__
diff --git a/src/x11glvnd/x11glvndclient.c b/src/x11glvnd/x11glvndclient.c
deleted file mode 100644
index d01ccab..0000000
--- a/src/x11glvnd/x11glvndclient.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include <assert.h>
-
-#include "glvnd_list.h"
-#include "x11glvnd.h"
-#include "x11glvndproto.h"
-
-const char *xglv_ext_name = XGLV_EXTENSION_NAME;
-static XExtensionInfo *xglv_ext_info = NULL;
-
-static /* const */ XExtensionHooks xglv_ext_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- NULL, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-
-static XEXT_GENERATE_FIND_DISPLAY(find_display, xglv_ext_info,
- (char *)xglv_ext_name,
- &xglv_ext_hooks,
- XGLV_NUM_EVENTS, NULL);
-
-#define CHECK_EXTENSION(dpy, i, val) \
- do { \
- if (!XextHasExtension(i)) { \
- XMissingExtension(dpy, xglv_ext_name); \
- UnlockDisplay(dpy); \
- SyncHandle(); \
- return val; \
- } \
- } while (0)
-
-
-Bool XGLVQueryExtension(Display *dpy, int *event_base_return, int *error_base_return)
-{
- XExtDisplayInfo *info = find_display(dpy);
- if (XextHasExtension(info)) {
- *event_base_return = info->codes->first_event;
- *error_base_return = info->codes->first_error;
- return True;
- } else {
- return False;
- }
-}
-
-Bool XGLVQueryVersion(Display *dpy, int *major, int *minor)
-{
- XExtDisplayInfo *info = find_display(dpy);
- xglvQueryVersionReq *req;
- xglvQueryVersionReply rep;
-
- LockDisplay(dpy);
-
- CHECK_EXTENSION(dpy, info, False);
-
- GetReq(glvQueryVersion, req);
-
- req->reqType = info->codes->major_opcode;
- req->glvndReqType = X_glvQueryVersion;
- req->majorVersion = XGLV_EXT_MAJOR;
- req->minorVersion = XGLV_EXT_MINOR;
-
- if (!_XReply(dpy, (xReply*)&rep, 0, xTrue)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *major = rep.majorVersion;
- *minor = rep.minorVersion;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-/*
- * Returns the screen associated with this XID, or -1 if there was an error.
- */
-int XGLVQueryXIDScreenMapping(
- Display *dpy,
- XID xid
-)
-{
- XExtDisplayInfo *info = find_display(dpy);
- xglvQueryXIDScreenMappingReq *req;
- xglvQueryXIDScreenMappingReply rep;
-
- LockDisplay(dpy);
-
- CHECK_EXTENSION(dpy, info, -1);
-
- GetReq(glvQueryXIDScreenMapping, req);
-
- req->reqType = info->codes->major_opcode;
- req->glvndReqType = X_glvQueryXIDScreenMapping;
- req->xid = xid;
-
- if (!_XReply(dpy, (xReply*)&rep, 0, xTrue)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return -1;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return rep.screen;
-}
-
-/*
- * Returns the vendor associated with this screen, or NULL if there was an
- * error.
- */
-char *XGLVQueryScreenVendorMapping(
- Display *dpy,
- int screen
-)
-{
- XExtDisplayInfo *info = find_display(dpy);
- xglvQueryScreenVendorMappingReq *req;
- xglvQueryScreenVendorMappingReply rep;
- size_t length, nbytes, slop;
- char *buf;
-
- LockDisplay(dpy);
-
- CHECK_EXTENSION(dpy, info, NULL);
-
- GetReq(glvQueryScreenVendorMapping, req);
- req->reqType = info->codes->major_opcode;
- req->glvndReqType = X_glvQueryScreenVendorMapping;
- req->screen = screen;
-
- if (!_XReply(dpy, (xReply*)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
- }
-
-
- length = rep.length;
- nbytes = rep.n;
-
- if (!nbytes) {
- buf = NULL;
- assert(!length);
- } else {
- slop = nbytes & 3;
- buf = (char *)Xmalloc(nbytes);
- if (!buf) {
- _XEatData(dpy, length);
- } else {
- _XRead(dpy, (char *)buf, nbytes);
- if (slop) {
- _XEatData(dpy, 4-slop);
- }
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return buf;
-}
-
diff --git a/src/x11glvnd/x11glvndproto.h b/src/x11glvnd/x11glvndproto.h
deleted file mode 100644
index eb1a534..0000000
--- a/src/x11glvnd/x11glvndproto.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#ifndef __X11GLVND_PROTO_H__
-#define __X11GLVND_PROTO_H__
-
-/*!
- * File describing protocol for the x11glvnd extension.
- */
-
-#include "X11/Xmd.h"
-
-#define XGLV_NUM_EVENTS 0
-#define XGLV_NUM_ERRORS 0
-
-#define XGLV_EXT_MAJOR 1
-#define XGLV_EXT_MINOR 0
-
-// TODO: X_glvQueryXIDVendorMapping?
-#define X_glvQueryVersion 0
-#define X_glvQueryXIDScreenMapping 1
-#define X_glvQueryScreenVendorMapping 2
-#define X_glvLastRequest (X_glvQueryScreenVendorMapping+1)
-
-#define GLVND_PAD(x) (((x)+3) & ~3)
-
-#define GLVND_REPLY_HEADER(reply, len) \
- (reply).type = X_Reply; \
- (reply).unused = 0; \
- (reply).sequenceNumber = client->sequence; \
- (reply).length = len
-
-/*
- * Following convenience macros are temporary and will be #undef'ed
- * after the protocol definitions.
- */
-
-#define __GLV_REQ_PREAMBLE \
- CARD8 reqType; \
- CARD8 glvndReqType; \
- CARD16 length B16
-
-#define __GLV_REPLY_PREAMBLE \
- BYTE type; \
- BYTE unused; \
- CARD16 sequenceNumber B16; \
- CARD32 length B32
-
-#define __GLV_DEFINE_REQ(name, layout) \
- typedef struct xglv ## name ## ReqRec { \
- __GLV_REQ_PREAMBLE; \
- layout \
- } xglv ## name ## Req; \
-static const size_t sz_xglv ## name ## Req = \
- GLVND_PAD(sizeof(xglv ## name ## Req))
-
-#define __GLV_DEFINE_REPLY(name, layout) \
- typedef struct xglv ## name ## ReplyRec { \
- __GLV_REPLY_PREAMBLE; \
- layout \
- } xglv ## name ## Reply; \
-static const size_t sz_xglv ## name ## Reply = \
- 32 // sizeof(xReply)
-
-__GLV_DEFINE_REQ(QueryVersion,
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
-);
-
-__GLV_DEFINE_REPLY(QueryVersion,
- CARD32 majorVersion B32;
- CARD32 minorVersion B32;
- CARD32 padl4 B32;
- CARD32 padl5 B32;
- CARD32 padl6 B32;
- CARD32 padl7 B32;
-);
-
-__GLV_DEFINE_REQ(QueryXIDScreenMapping,
- CARD32 xid B32;
-);
-
-__GLV_DEFINE_REPLY(QueryXIDScreenMapping,
- INT32 screen B32;
- CARD32 padl3 B32;
- CARD32 padl4 B32;
- CARD32 padl5 B32;
- CARD32 padl6 B32;
- CARD32 padl7 B32;
-);
-
-__GLV_DEFINE_REQ(QueryScreenVendorMapping,
- INT32 screen B32;
-);
-
-__GLV_DEFINE_REPLY(QueryScreenVendorMapping,
- CARD32 n B32;
- CARD32 padl3 B32;
- CARD32 padl4 B32;
- CARD32 padl5 B32;
- CARD32 padl6 B32;
- CARD32 padl7 B32;
-);
-
-#undef __GLV_DEFINE_REQ
-#undef __GLV_DEFINE_REPLY
-#undef __GLV_REPLY_PREAMBLE
-#undef __GLV_REQ_PREAMBLE
-
-#endif
diff --git a/src/x11glvnd/x11glvndserver.c b/src/x11glvnd/x11glvndserver.c
deleted file mode 100644
index 61db9da..0000000
--- a/src/x11glvnd/x11glvndserver.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-// #include "include/scrnintstr.h"
-
-#include <xorg-server.h>
-#include <xorgVersion.h>
-#include <string.h>
-#include <xf86Module.h>
-#include <scrnintstr.h>
-#include <windowstr.h>
-#include <dixstruct.h>
-#include <extnsionst.h>
-#include <xf86.h>
-
-#include "x11glvnd.h"
-#include "x11glvndproto.h"
-#include "x11glvndserver.h"
-#include "glvnd_list.h"
-
-#define XGLV_ABI_HAS_DIX_REGISTER_PRIVATE_KEY (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 8)
-#define XGLV_ABI_HAS_DEV_PRIVATE_REWORK (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4)
-#define XGLV_ABI_HAS_DIX_LOOKUP_RES_BY (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 6)
-#define XGLV_ABI_EXTENSION_MODULE_HAS_SETUP_FUNC_AND_INIT_DEPS \
- (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) <= 12)
-#define XGLV_ABI_HAS_LOAD_EXTENSION_LIST (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 17)
-#define XGLV_ABI_SWAP_MACROS_HAVE_N_ARG (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) <= 11)
-
-/*
- * Screen-private structure
- */
-typedef struct XGLVScreenPrivRec {
- char *vendorLib;
-} XGLVScreenPriv;
-
-static inline Bool xglvInitPrivateSpace(void);
-static inline XGLVScreenPriv *xglvGetScreenPrivate(ScreenPtr pScreen);
-static inline void xglvSetScreenPrivate(ScreenPtr pScreen, XGLVScreenPriv *priv);
-static inline int xglvLookupResource(pointer *result, XID id, RESTYPE rtype,
- ClientPtr client, Mask access_mode);
-
-#if XGLV_ABI_HAS_DIX_REGISTER_PRIVATE_KEY
-// ABI >= 8
-static DevPrivateKeyRec glvXGLVScreenPrivKey;
-#elif XGLV_ABI_HAS_DEV_PRIVATE_REWORK // XGLV_ABI_HAS_DIX_REGISTER_PRIVATE_KEY
-// ABI 4 - 7
-// In ABI 5, DevPrivateKey is int* and needs to point to a unique int.
-// In ABI 4, DevPrivateKey is void* and just needs to be unique.
-// We just use the ABI 5 behavior for both for consistency.
-static int glvXGLVScreenPrivKey;
-#else
-// ABI <= 3
-static int glvXGLVScreenPrivKey = -1;
-#endif
-
-#if XGLV_ABI_SWAP_MACROS_HAVE_N_ARG
-
-#define XGLV_SWAPS(x) \
-do { \
- int _XGLV_SWAPN; \
- swaps(x, _XGLV_SWAPN);\
-} while(0)
-
-#define XGLV_SWAPL(x) \
-do { \
- int _XGLV_SWAPN; \
- swapl(x, _XGLV_SWAPN);\
-} while(0)
-
-#else
-
-#define XGLV_SWAPS(x) swaps(x)
-#define XGLV_SWAPL(x) swapl(x)
-
-#endif // XGLV_ABI_SWAP_FUNCS_TAKE_N_ARG
-
-/* Dispatch information */
-typedef int ProcVectorFunc(ClientPtr);
-typedef ProcVectorFunc *ProcVectorFuncPtr;
-
-#define PROC_VECTOR_ENTRY(foo) [X_glv ## foo] = ProcGLV ## foo
-#define PROC_PROTO(foo) static int ProcGLV ## foo (ClientPtr client)
-
-PROC_PROTO(QueryVersion);
-PROC_PROTO(QueryXIDScreenMapping);
-PROC_PROTO(QueryScreenVendorMapping);
-
-static ProcVectorFuncPtr glvProcVector[X_glvLastRequest] = {
- PROC_VECTOR_ENTRY(QueryVersion),
- PROC_VECTOR_ENTRY(QueryXIDScreenMapping),
- PROC_VECTOR_ENTRY(QueryScreenVendorMapping),
-};
-
-#undef PROC_VECTOR_ENTRY
-
-static void GLVExtensionInit(void);
-
-/* Module information */
-static ExtensionModule glvExtensionModule = {
- GLVExtensionInit,
- XGLV_EXTENSION_NAME,
- NULL,
-#if XGLV_ABI_EXTENSION_MODULE_HAS_SETUP_FUNC_AND_INIT_DEPS
- NULL,
- NULL
-#endif
-};
-
-static XF86ModuleVersionInfo x11glvndVersionInfo =
-{
- "x11glvnd",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_NUMERIC(4,0,2,0,0),
- 1, 0, 0,
- NULL, // ABI_CLASS_EXTENSION,
- ABI_EXTENSION_VERSION,
- MOD_CLASS_EXTENSION,
- {0, 0, 0, 0}
-};
-
-static void *glvSetup(void *module, void *opts, int *errmaj, int *errmin);
-
-/*
- * x11glvndModuleData is a magic symbol needed to load the x11glvnd module in
- * the X server.
- */
-PUBLIC const XF86ModuleData x11glvndModuleData = { &x11glvndVersionInfo,
- glvSetup, NULL };
-
-static void *glvSetup(void *module, void *opts, int *errmaj, int *errmin)
-{
- static Bool x11glvndSetupDone = FALSE;
- typedef int (*LoaderGetABIVersionProc)(const char *abiclass);
- LoaderGetABIVersionProc pLoaderGetABIVersion;
- int videoMajor = 0;
-
- if (x11glvndSetupDone) {
- if (errmaj) {
- *errmaj = LDR_ONCEONLY;
- }
- return NULL;
- }
- x11glvndSetupDone = TRUE;
-
- xf86Msg(X_INFO, "x11glvnd Loading\n");
-
- // All of the ABI checks use the video driver ABI version number, so that's
- // what we'll check here.
- if ((pLoaderGetABIVersion = (LoaderGetABIVersionProc)LoaderSymbol("LoaderGetABIVersion"))) {
- videoMajor = GET_ABI_MAJOR(pLoaderGetABIVersion(ABI_CLASS_VIDEODRV));
- }
-
- if (videoMajor != GET_ABI_MAJOR(ABI_VIDEODRV_VERSION)) {
- xf86Msg(X_INFO, "x11glvnd: X server major video driver ABI mismatch: expected %d but saw %d\n",
- GET_ABI_MAJOR(ABI_VIDEODRV_VERSION), videoMajor);
- return NULL;
- }
-
-#if XGLV_ABI_HAS_LOAD_EXTENSION_LIST
- LoadExtensionList(&glvExtensionModule, 1, False);
-#else
- LoadExtension(&glvExtensionModule, False);
-#endif
-
- return (pointer)1;
-}
-
-typedef struct DrawableTypeRec {
- RESTYPE rtype;
- struct glvnd_list entry;
-} XGLVDrawableType;
-
-struct glvnd_list xglvDrawableTypes;
-
-int LookupXIDScreenMapping(ClientPtr client, XID xid);
-
-int LookupXIDScreenMapping(ClientPtr client, XID xid)
-{
- DrawablePtr pDraw;
- Status status;
- XGLVDrawableType *drawType;
-
- glvnd_list_for_each_entry(drawType, &xglvDrawableTypes, entry) {
- pDraw = NULL;
- status = xglvLookupResource((void **)&pDraw, xid,
- RT_WINDOW, client,
- BadDrawable);
- if (status == Success) {
- break;
- }
- }
-
- if (pDraw) {
- return pDraw->pScreen->myNum;
- } else {
- return -1;
- }
-}
-
-/*
- * Hook for GLX drivers to register their GLX drawable types.
- */
-void _XGLVRegisterGLXDrawableType(RESTYPE rtype)
-{
- XGLVDrawableType *drawType = malloc(sizeof(*drawType));
-
- drawType->rtype = rtype;
- glvnd_list_add(&drawType->entry, &xglvDrawableTypes);
-}
-
-enum {
- OPTION_GL_VENDOR,
-};
-
-static char *GetVendorForThisScreen(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrnInfo = xf86Screens[pScreen->myNum];
- const char *str;
- char *processedStr;
- OptionInfoRec options[2];
-
- options[0].token = OPTION_GL_VENDOR;
- options[0].name = XGLV_X_CONFIG_OPTION_NAME;
- options[0].type = OPTV_STRING;
- memset(&options[0].value, 0, sizeof(options[0].value));
- options[0].found = False;
-
- /* Fill a blank entry to the table */
- options[1].token = -1;
- options[1].name = NULL;
- options[1].type = OPTV_NONE;
- memset(&options[1].value, 0, sizeof(options[1].value));
- options[1].found = False;
-
- if (!pScrnInfo->options) {
- xf86CollectOptions(pScrnInfo, NULL);
- }
-
- xf86ProcessOptions(pScreen->myNum,
- pScrnInfo->options,
- options);
-
- str = xf86GetOptValString(options, OPTION_GL_VENDOR);
- if (!str) {
- // Fall back to the driver name if no explicit option specified
- str = pScrnInfo->name;
- }
- if (!str) {
- str = "unknown";
- }
-
- processedStr = strdup(str);
- if (processedStr) {
- size_t i;
- size_t len = strlen(processedStr);
- for (i = 0; i < len; i++) {
- processedStr[i] = tolower(processedStr[i]);
- }
- }
-
- return processedStr;
-}
-
-static Bool xglvScreenInit(ScreenPtr pScreen)
-{
- XGLVScreenPriv *pScreenPriv;
-
- pScreenPriv = malloc(sizeof(XGLVScreenPriv));
-
- if (!pScreenPriv) {
- return False;
- }
-
- // Get the vendor library for this screen
- pScreenPriv->vendorLib = GetVendorForThisScreen(pScreen);
-
- if (!pScreenPriv->vendorLib) {
- free(pScreenPriv);
- return False;
- }
-
- xglvSetScreenPrivate(pScreen, pScreenPriv);
-
- return True;
-}
-
-static int ProcGLVQueryVersion(ClientPtr client)
-{
- xglvQueryVersionReply rep;
- REQUEST(xglvQueryVersionReq);
-
- REQUEST_SIZE_MATCH(*stuff);
-
- // Write the reply
- GLVND_REPLY_HEADER(rep, 0);
- rep.majorVersion = XGLV_EXT_MAJOR;
- rep.minorVersion = XGLV_EXT_MINOR;
-
- if (client->swapped) {
- XGLV_SWAPS(&rep.sequenceNumber);
- XGLV_SWAPL(&rep.length);
- XGLV_SWAPL(&rep.majorVersion);
- XGLV_SWAPL(&rep.minorVersion);
- }
-
- WriteToClient(client, sz_xglvQueryVersionReply, (char *)&rep);
- return client->noClientException;
-}
-
-// TODO: make sense to do this instead?
-//
-//static int ProcGLVQueryXIDVendorMapping(ClientPtr client)
-//{
-// // TODO: char *XGLVQueryXIDVendorMapping(XID xid)
-// // Returns the name of the vendor library for this XID
-//}
-
-static int ProcGLVQueryXIDScreenMapping(ClientPtr client)
-{
- xglvQueryXIDScreenMappingReply rep;
- REQUEST(xglvQueryXIDScreenMappingReq);
- int scrnum;
-
- REQUEST_SIZE_MATCH(*stuff);
-
- scrnum = LookupXIDScreenMapping(client, stuff->xid);
-
- // Write the reply
- GLVND_REPLY_HEADER(rep, 0);
- rep.screen = scrnum;
-
- if (client->swapped) {
- XGLV_SWAPS(&rep.sequenceNumber);
- XGLV_SWAPL(&rep.length);
- XGLV_SWAPL(&rep.screen);
- }
-
- WriteToClient(client, sz_xglvQueryXIDScreenMappingReply, (char *)&rep);
- return client->noClientException;
-}
-
-static int ProcGLVQueryScreenVendorMapping(ClientPtr client)
-{
- xglvQueryScreenVendorMappingReply rep;
- REQUEST(xglvQueryScreenVendorMappingReq);
- const char *vendor;
- size_t n, length;
- char *buf;
- ScreenPtr pScreen;
- XGLVScreenPriv *pScreenPriv;
-
- REQUEST_SIZE_MATCH(*stuff);
-
- if ((stuff->screen >= screenInfo.numScreens) ||
- (stuff->screen < 0)) {
- vendor = NULL;
- } else {
- pScreen = screenInfo.screens[stuff->screen];
- pScreenPriv = xglvGetScreenPrivate(pScreen);
- vendor = pScreenPriv->vendorLib;
- }
-
- if (vendor) {
- n = strlen(vendor) + 1;
- length = GLVND_PAD(n) >> 2;
- buf = malloc(length << 2);
- if (!buf) {
- return BadAlloc;
- }
- strncpy(buf, vendor, n);
-
- // Write the reply
- GLVND_REPLY_HEADER(rep, length);
- rep.n = n;
-
- if (client->swapped) {
- XGLV_SWAPS(&rep.sequenceNumber);
- XGLV_SWAPL(&rep.length);
- XGLV_SWAPL(&rep.n);
- }
-
- WriteToClient(client, sz_xglvQueryScreenVendorMappingReply, (char *)&rep);
- WriteToClient(client, (int)(length << 2), buf);
-
- free(buf);
- } else {
- GLVND_REPLY_HEADER(rep, 0);
- rep.n = 0;
- if (client->swapped) {
- XGLV_SWAPS(&rep.sequenceNumber);
- XGLV_SWAPL(&rep.length);
- XGLV_SWAPL(&rep.n);
- }
- WriteToClient(client, sz_xglvQueryScreenVendorMappingReply, (char *)&rep);
- }
-
- return client->noClientException;
-}
-
-static int ProcGLVDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- if (stuff->data >= X_glvLastRequest) {
- return BadRequest;
- }
-
- if (!glvProcVector[stuff->data]) {
- return BadImplementation;
- }
-
- return glvProcVector[stuff->data](client);
-}
-
-static int SProcGLVDispatch(ClientPtr client)
-{
- return BadImplementation;
-}
-
-static void GLVReset(ExtensionEntry *extEntry)
-{
- // nop
-}
-
-static void GLVExtensionInit(void)
-{
- ExtensionEntry *extEntry;
- char ext_name[] = XGLV_EXTENSION_NAME;
- size_t i;
- XGLVDrawableType *drawType;
-
- if ((extEntry = AddExtension(ext_name,
- XGLV_NUM_EVENTS,
- XGLV_NUM_ERRORS,
- ProcGLVDispatch,
- SProcGLVDispatch,
- GLVReset,
- StandardMinorOpcode)))
- {
- // do stuff with extEntry?
- }
-
- xglvInitPrivateSpace();
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- xglvScreenInit(screenInfo.screens[i]);
- }
-
- glvnd_list_init(&xglvDrawableTypes);
- drawType = malloc(sizeof(*drawType));
- drawType->rtype = RT_WINDOW;
- glvnd_list_add(&drawType->entry, &xglvDrawableTypes);
-}
-
-#if XGLV_ABI_HAS_DIX_REGISTER_PRIVATE_KEY
-// ABI >= 8
-
-Bool xglvInitPrivateSpace(void)
-{
- return dixRegisterPrivateKey(&glvXGLVScreenPrivKey, PRIVATE_SCREEN, 0);
-}
-
-XGLVScreenPriv *xglvGetScreenPrivate(ScreenPtr pScreen)
-{
- return (XGLVScreenPriv *) dixLookupPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey);
-}
-
-void xglvSetScreenPrivate(ScreenPtr pScreen, XGLVScreenPriv *priv)
-{
- dixSetPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey, priv);
-}
-
-#elif XGLV_ABI_HAS_DEV_PRIVATE_REWORK // XGLV_ABI_HAS_DIX_REGISTER_PRIVATE_KEY
-// ABI 4 - 7
-
-Bool xglvInitPrivateSpace(void)
-{
- return dixRequestPrivate(&glvXGLVScreenPrivKey, 0);
-}
-
-XGLVScreenPriv *xglvGetScreenPrivate(ScreenPtr pScreen)
-{
- return (XGLVScreenPriv *) dixLookupPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey);
-}
-
-void xglvSetScreenPrivate(ScreenPtr pScreen, XGLVScreenPriv *priv)
-{
- dixSetPrivate(&pScreen->devPrivates, &glvXGLVScreenPrivKey, priv);
-}
-
-#else
-// ABI <= 3
-
-Bool xglvInitPrivateSpace(void)
-{
- glvXGLVScreenPrivKey = AllocateScreenPrivateIndex();
- return (glvXGLVScreenPrivKey >= 0);
-}
-
-XGLVScreenPriv *xglvGetScreenPrivate(ScreenPtr pScreen)
-{
- return (XGLVScreenPriv *) (pScreen->devPrivates[glvXGLVScreenPrivKey].ptr);
-}
-
-void xglvSetScreenPrivate(ScreenPtr pScreen, XGLVScreenPriv *priv)
-{
- pScreen->devPrivates[glvXGLVScreenPrivKey].ptr = priv;
-}
-
-#endif
-
-int xglvLookupResource(pointer *result, XID id, RESTYPE rtype,
- ClientPtr client, Mask access_mode)
-{
-#if XGLV_ABI_HAS_DIX_LOOKUP_RES_BY
- return dixLookupResourceByType(result, id, rtype, client, access_mode);
-#elif XGLV_ABI_HAS_DEV_PRIVATE_REWORK
- return dixLookupResource(result, id, rtype, client, access_mode);
-#else
- *result = SecurityLookupIDByType(client, id, rtype, access_mode);
- return (*result ? Success : BadValue);
-#endif
-}
-
diff --git a/src/x11glvnd/x11glvndserver.h b/src/x11glvnd/x11glvndserver.h
deleted file mode 100644
index 5bb0556..0000000
--- a/src/x11glvnd/x11glvndserver.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#ifndef __X11GLVNDSERVER_H__
-#define __X11GLVNDSERVER_H__
-
-#include <X11/Xdefs.h>
-#include "compiler.h"
-
-/*!
- * Public symbols exported by the x11glvnd X server module. Server-side GLX can
- * hook into these symbols in order to implement tracking of GLX drawables and
- * potentially implement active notification of clients when XID -> screen
- * mappings change (this could be done via shared memory in the direct rendering
- * case). The latter will allow clients to cache XID -> screen values, saving a
- * round trip in the common case.
- *
- * XXX: Currently there is a race between the XID -> screen lookup and potential
- * destruction of a GLX drawable and recycling of its XID. Will we need to
- * somehow lock drawables on the server to prevent them from going away until we
- * have dispatched to the vendor? Or should it be safe to dispatch even if the
- * drawable disappears?
- */
-
-#define XGLV_X_CONFIG_OPTION_NAME "GLVendor"
-
-PUBLIC void _XGLVRegisterGLXDrawableType(RESTYPE rtype);
-
-#endif
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5d2ab01..2703656 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -41,41 +41,44 @@ TESTS = \
testglxmcloop.sh \
testglxmcthreads.sh \
testglxmclate.sh \
- testx11glvndproto.sh \
testglxmcoldlink.sh \
testglxgetclientstr.sh \
testglxqueryversion.sh \
- testglxnscreens.sh \
testglxnscrthreads.sh \
testpatchentrypoints.sh \
fini_test_env.sh
+# TODO: These tests depend on the x11glvnd server extension, which isn't used
+# anymore. They need to be rewritten to use the GLX_EXT_libglvnd extension
+# instead.
+#TESTS += testx11glvndproto.sh
+#TESTS += testglxnscreens.sh
+
EXTRA_DIST = $(TESTS)
check_PROGRAMS = \
testglxgetprocaddress \
testglxmakecurrent \
testglxmakecurrent_oldlink \
- testx11glvndproto \
testglxgetclientstr \
testglxqueryversion \
- testpatchentrypoints \
- testglxnscreens
+ testpatchentrypoints
+
+#check_PROGRAMS += testx11glvndproto
+#check_PROGRAMS += testglxnscreens
testglxnscreens_SOURCES = \
$(top_srcdir)/src/util/glvnd_pthread.c \
testglxnscreens.c \
test_utils.c
-X11GLVND_DIR = src/x11glvnd
-
-testglxnscreens_CFLAGS = -I$(top_srcdir)/$(X11GLVND_DIR) $(AM_CFLAGS)
-
-testglxnscreens_LDADD = -lX11
-testglxnscreens_LDADD += $(top_builddir)/src/GLX/libGLX.la
-testglxnscreens_LDADD += $(top_builddir)/src/OpenGL/libOpenGL.la
-testglxnscreens_LDADD += $(top_builddir)/src/util/trace/libtrace.la
-testglxnscreens_LDADD += -lX11 -ldl $(top_builddir)/$(X11GLVND_DIR)/libx11glvnd_client.la
+#testglxnscreens_CFLAGS = -I$(top_srcdir)/$(X11GLVND_DIR) $(AM_CFLAGS)
+#
+#testglxnscreens_LDADD = -lX11
+#testglxnscreens_LDADD += $(top_builddir)/src/GLX/libGLX.la
+#testglxnscreens_LDADD += $(top_builddir)/src/OpenGL/libOpenGL.la
+#testglxnscreens_LDADD += $(top_builddir)/src/util/trace/libtrace.la
+#testglxnscreens_LDADD += -lX11 -ldl $(top_builddir)/$(X11GLVND_DIR)/libx11glvnd_client.la
# The *_oldlink variant tests that linking against legacy libGL.so works
@@ -94,8 +97,8 @@ testglxmakecurrent_oldlink_LDADD = -lX11 -ldl
testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/GL/libGL.la
testglxmakecurrent_oldlink_LDADD += $(top_builddir)/src/util/trace/libtrace.la
-testx11glvndproto_CFLAGS = -I$(top_srcdir)/$(X11GLVND_DIR)
-testx11glvndproto_LDADD = -lX11 $(top_builddir)/$(X11GLVND_DIR)/libx11glvnd_client.la
+#testx11glvndproto_CFLAGS = -I$(top_srcdir)/$(X11GLVND_DIR)
+#testx11glvndproto_LDADD = -lX11 $(top_builddir)/$(X11GLVND_DIR)/libx11glvnd_client.la
# Disable annoying "unused" errors
AM_CFLAGS = \