aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/Makefile.in15
-rw-r--r--xorg-server/glx/glxcmds.c14
-rw-r--r--xorg-server/glx/glxdri2.c12
-rw-r--r--xorg-server/glx/glxext.c8
-rw-r--r--xorg-server/glx/glxscreens.c15
-rw-r--r--xorg-server/glx/glxscreens.h11
-rw-r--r--xorg-server/glx/glxserver.h3
-rw-r--r--xorg-server/glx/indirect_texture_compression.c4
8 files changed, 60 insertions, 22 deletions
diff --git a/xorg-server/glx/Makefile.in b/xorg-server/glx/Makefile.in
index 439f8d17b..65db3fd38 100644
--- a/xorg-server/glx/Makefile.in
+++ b/xorg-server/glx/Makefile.in
@@ -43,7 +43,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
$(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -114,7 +114,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_MAKEFLAGS = @AM_MAKEFLAGS@
APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
APP_MAN_DIR = @APP_MAN_DIR@
@@ -139,7 +138,6 @@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
-CXX = @CXX@
CYGPATH_W = @CYGPATH_W@
DARWIN_LIBS = @DARWIN_LIBS@
DBUS_CFLAGS = @DBUS_CFLAGS@
@@ -163,6 +161,7 @@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
DOLT_BASH = @DOLT_BASH@
+DOXYGEN = @DOXYGEN@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
@@ -180,8 +179,6 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FC = @FC@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
@@ -227,7 +224,6 @@ LTCXXCOMPILE = @LTCXXCOMPILE@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAIN_LIB = @MAIN_LIB@
-MAKEFLAGS = @MAKEFLAGS@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
@@ -253,6 +249,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
@@ -262,7 +259,6 @@ PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PROJECTROOT = @PROJECTROOT@
PS2PDF = @PS2PDF@
-Q = @Q@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
@@ -276,7 +272,6 @@ STRIP = @STRIP@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
-V = @V@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
VERSION = @VERSION@
WINDRES = @WINDRES@
@@ -318,8 +313,6 @@ XPBPROXY_LIBS = @XPBPROXY_LIBS@
XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
-XSDL_INCS = @XSDL_INCS@
-XSDL_LIBS = @XSDL_LIBS@
XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
@@ -362,6 +355,7 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
driverdir = @driverdir@
dvidir = @dvidir@
@@ -393,7 +387,6 @@ psdir = @psdir@
sbindir = @sbindir@
sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
-shavedir = @shavedir@
srcdir = @srcdir@
symbol_visibility = @symbol_visibility@
sysconfdir = @sysconfdir@
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index 847154718..72487a841 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -54,7 +54,6 @@
#include "indirect_dispatch.h"
#include "indirect_table.h"
#include "indirect_util.h"
-#include "protocol-versions.h"
static int
validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
@@ -743,8 +742,8 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
** client if it wants to work with older clients; however, in this
** implementation the server just returns its version number.
*/
- reply.majorVersion = SERVER_GLX_MAJOR_VERSION;
- reply.minorVersion = SERVER_GLX_MINOR_VERSION;
+ reply.majorVersion = glxMajorVersion;
+ reply.minorVersion = glxMinorVersion;
reply.length = 0;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
@@ -2062,7 +2061,7 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
if (ret == Success) {
if (barrier)
/* add source for cleanup when drawable is gone */
- AddResource(drawable, __glXSwapBarrierRes, (pointer)screen);
+ AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen);
else
/* delete source */
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
@@ -2364,6 +2363,7 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
char *buf;
__GLXscreen *pGlxScreen;
int err;
+ char ver_str[16];
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
@@ -2373,7 +2373,11 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
ptr = pGlxScreen->GLXvendor;
break;
case GLX_VERSION:
- ptr = pGlxScreen->GLXversion;
+ /* Return to the server version rather than the screen version
+ * to prevent confusion when they do not match.
+ */
+ snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion);
+ ptr = ver_str;
break;
case GLX_EXTENSIONS:
ptr = pGlxScreen->GLXextensions;
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c
index ed7fb4c4b..ed7dc80ba 100644
--- a/xorg-server/glx/glxdri2.c
+++ b/xorg-server/glx/glxdri2.c
@@ -685,6 +685,18 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
+ /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
+ * drivers support the required extensions for GLX 1.4. The extensions
+ * we're assuming are:
+ *
+ * - GLX_SGI_make_current_read (1.3)
+ * - GLX_SGIX_fbconfig (1.3)
+ * - GLX_SGIX_pbuffer (1.3)
+ * - GLX_ARB_multisample (1.4)
+ */
+ screen->base.GLXmajor = 1;
+ screen->base.GLXminor = 4;
+
screen->enterVT = pScrn->EnterVT;
pScrn->EnterVT = glxDRIEnterVT;
screen->leaveVT = pScrn->LeaveVT;
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index 95f09d296..42fcf5914 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -364,12 +364,18 @@ void GlxExtensionInit(void)
pScreen = screenInfo.screens[i];
for (p = __glXProviderStack; p != NULL; p = p->next) {
- if (p->screenProbe(pScreen) != NULL) {
+ __GLXscreen *glxScreen;
+
+ glxScreen = p->screenProbe(pScreen);
+ if (glxScreen != NULL) {
+ if (glxScreen->GLXminor < glxMinorVersion)
+ glxMinorVersion = glxScreen->GLXminor;
LogMessage(X_INFO,
"GLX: Initialized %s GL provider for screen %d\n",
p->name, i);
break;
}
+
}
if (!p)
diff --git a/xorg-server/glx/glxscreens.c b/xorg-server/glx/glxscreens.c
index c6f5700d5..2f6d39efa 100644
--- a/xorg-server/glx/glxscreens.c
+++ b/xorg-server/glx/glxscreens.c
@@ -46,6 +46,7 @@
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
+#include "protocol-versions.h"
static int glxScreenPrivateKeyIndex;
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex;
@@ -166,7 +167,8 @@ static const char GLServerExtensions[] =
** supported across all screens in a multi-screen system.
*/
static char GLXServerVendorName[] = "SGI";
-static char GLXServerVersion[] = "1.2";
+unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
+unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static char GLXServerExtensions[] =
"GLX_ARB_multisample "
"GLX_EXT_visual_info "
@@ -382,9 +384,17 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->pScreen = pScreen;
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
- pGlxScreen->GLXversion = xstrdup(GLXServerVersion);
pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions);
+ /* All GLX providers must support all of the functionality required for at
+ * least GLX 1.2. If the provider supports a higher version, the GLXminor
+ * version can be changed in the provider's screen-probe routine. For
+ * most providers, the screen-probe routine is the caller of this
+ * function.
+ */
+ pGlxScreen->GLXmajor = 1;
+ pGlxScreen->GLXminor = 2;
+
pGlxScreen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = glxCloseScreen;
pGlxScreen->DestroyWindow = pScreen->DestroyWindow;
@@ -458,7 +468,6 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
void __glXScreenDestroy(__GLXscreen *screen)
{
xfree(screen->GLXvendor);
- xfree(screen->GLXversion);
xfree(screen->GLXextensions);
xfree(screen->GLextensions);
}
diff --git a/xorg-server/glx/glxscreens.h b/xorg-server/glx/glxscreens.h
index 3c1bdd4ba..bff436307 100644
--- a/xorg-server/glx/glxscreens.h
+++ b/xorg-server/glx/glxscreens.h
@@ -161,6 +161,17 @@ struct __GLXscreen {
char *GLXversion;
char *GLXextensions;
+ /**
+ * \name GLX version supported by this screen.
+ *
+ * Since the GLX version advertised by the server is for the whole server,
+ * the GLX protocol code uses the minimum version supported on all screens.
+ */
+ /*@{*/
+ unsigned GLXmajor;
+ unsigned GLXminor;
+ /*@}*/
+
Bool (*CloseScreen)(int index, ScreenPtr pScreen);
Bool (*DestroyWindow)(WindowPtr pWindow);
};
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 87d7c3945..7f2f2dd76 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -249,4 +249,7 @@ extern int __glXImageSize(GLenum format, GLenum type,
GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
GLint alignment);
+extern unsigned glxMajorVersion;
+extern unsigned glxMinorVersion;
+
#endif /* !__GLX_server_h__ */
diff --git a/xorg-server/glx/indirect_texture_compression.c b/xorg-server/glx/indirect_texture_compression.c
index f20ebc8af..2de255533 100644
--- a/xorg-server/glx/indirect_texture_compression.c
+++ b/xorg-server/glx/indirect_texture_compression.c
@@ -56,7 +56,7 @@ int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *p
const GLenum target = *(GLenum *)(pc + 0);
const GLint level = *(GLint *)(pc + 4);
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
@@ -96,7 +96,7 @@ int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyt
const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) );
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));