summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-10-01 10:39:19 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-10-01 23:13:40 -0700
commit4c6bfa2c09ae2b0cffdf9211a6dfbcaefe0366b5 (patch)
treef6e73408541d675d96ed8fd4a192d5fd4ef73af9 /glx
parent45f447dafded5adfe11b7df3325c2d8f6ae0639b (diff)
GLX: More clearly document the GLX protocol version handling
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c1
-rw-r--r--glx/glxdri2.c6
-rw-r--r--glx/glxscreens.c12
-rw-r--r--glx/glxscreens.h9
4 files changed, 21 insertions, 7 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 30c25a917..ba4c12398 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -50,7 +50,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)
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 82568e696..ed7dc80ba 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -685,10 +685,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions);
}
- /* We know that the X server supports the protocol for at least GLX 1.4.
- * When a new version of GLX is created, we'll have to revisit this. We're
- * also going to assume (perhaps incorrectly?) that all DRI2-enabled
- * drivers support the required extension for GLX 1.3. The extensions
+ /* 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)
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 6ce24b2b4..674e2c681 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -42,6 +42,7 @@
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
+#include "protocol-versions.h"
static int glxScreenPrivateKeyIndex;
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex;
@@ -162,8 +163,8 @@ static const char GLServerExtensions[] =
** supported across all screens in a multi-screen system.
*/
static char GLXServerVendorName[] = "SGI";
-unsigned glxMajorVersion = 1;
-unsigned glxMinorVersion = 4;
+unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
+unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static char GLXServerExtensions[] =
"GLX_ARB_multisample "
"GLX_EXT_visual_info "
@@ -380,6 +381,13 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
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;
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index 2d696d2ea..bff436307 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -160,8 +160,17 @@ struct __GLXscreen {
char *GLXvendor;
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);