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>
This commit is contained in:
Ian Romanick 2009-10-01 10:39:19 -07:00
parent 45f447dafd
commit 4c6bfa2c09
5 changed files with 22 additions and 8 deletions

View File

@ -50,7 +50,6 @@
#include "indirect_dispatch.h" #include "indirect_dispatch.h"
#include "indirect_table.h" #include "indirect_table.h"
#include "indirect_util.h" #include "indirect_util.h"
#include "protocol-versions.h"
static int static int
validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)

View File

@ -685,10 +685,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.GLXextensions); screen->base.GLXextensions);
} }
/* We know that the X server supports the protocol for at least GLX 1.4. /* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
* When a new version of GLX is created, we'll have to revisit this. We're * drivers support the required extensions for GLX 1.4. The extensions
* also going to assume (perhaps incorrectly?) that all DRI2-enabled
* drivers support the required extension for GLX 1.3. The extensions
* we're assuming are: * we're assuming are:
* *
* - GLX_SGI_make_current_read (1.3) * - GLX_SGI_make_current_read (1.3)

View File

@ -42,6 +42,7 @@
#include "glxserver.h" #include "glxserver.h"
#include "glxutil.h" #include "glxutil.h"
#include "glxext.h" #include "glxext.h"
#include "protocol-versions.h"
static int glxScreenPrivateKeyIndex; static int glxScreenPrivateKeyIndex;
static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex; static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex;
@ -162,8 +163,8 @@ static const char GLServerExtensions[] =
** supported across all screens in a multi-screen system. ** supported across all screens in a multi-screen system.
*/ */
static char GLXServerVendorName[] = "SGI"; static char GLXServerVendorName[] = "SGI";
unsigned glxMajorVersion = 1; unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
unsigned glxMinorVersion = 4; unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static char GLXServerExtensions[] = static char GLXServerExtensions[] =
"GLX_ARB_multisample " "GLX_ARB_multisample "
"GLX_EXT_visual_info " "GLX_EXT_visual_info "
@ -380,6 +381,13 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->GLextensions = xstrdup(GLServerExtensions); pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName); pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions); 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->GLXmajor = 1;
pGlxScreen->GLXminor = 2; pGlxScreen->GLXminor = 2;

View File

@ -160,8 +160,17 @@ struct __GLXscreen {
char *GLXvendor; char *GLXvendor;
char *GLXversion; char *GLXversion;
char *GLXextensions; 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 GLXmajor;
unsigned GLXminor; unsigned GLXminor;
/*@}*/
Bool (*CloseScreen)(int index, ScreenPtr pScreen); Bool (*CloseScreen)(int index, ScreenPtr pScreen);
Bool (*DestroyWindow)(WindowPtr pWindow); Bool (*DestroyWindow)(WindowPtr pWindow);

View File

@ -61,7 +61,7 @@
/* GLX */ /* GLX */
#define SERVER_GLX_MAJOR_VERSION 1 #define SERVER_GLX_MAJOR_VERSION 1
#define SERVER_GLX_MINOR_VERSION 2 #define SERVER_GLX_MINOR_VERSION 4
/* Xinerama */ /* Xinerama */
#define SERVER_PANORAMIX_MAJOR_VERSION 1 #define SERVER_PANORAMIX_MAJOR_VERSION 1