summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
committerIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
commitc39bf5e273a4995a279ae2af59fc29e06ab47e29 (patch)
tree7b2edd0c9b039d75da7b95c8c97142c31494a03e /src/glx
parent7d40d230fa26abeb9f92bdcf8012eddbc585b118 (diff)
All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows
1,402 lines of code to be removed from Mesa (drivers and libGL). The big winner is dri_util.c. Primary changes are: 1. Remove all "deprecated" entry-points from the various structures in dri_interface.h. 2. Rename the remaining fields to removed "version numbers." So, bindContext3 becomes bindContext. Functions with "New" in the name (e.g., CreateNewContext) were *not* changed, but that is an option. Having "New" in the name is less annoying to me than having "3" in the name. 3. Remove all compatibility code that handles cases where the driver or the loader is too old to support the latest interfaces. 4. Append the API version to the __driCreateNewScreen function name. This is currently done by hand. In the future (i.e., the next time we make an incompatible change to the interface) we'll want to come up with a better way to do this. This prevents old loaders from being able to load new (incompatible) drivers. 5. Bump the API version to 20050722. All drivers (by way of dri_util.c) require this version. 6. All drivers are *required* to expose GLX_SGIX_fbconfig and GLX_OML_swap_method (or the moral equivalents). Support for these functions in implicit in the use of the "new" interface. 7. Some cases still exist that need to be compiled differently in a loader or core Mesa versus in a driver. These are identified by the define IN_DRI_DRIVER.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/x11/Makefile8
-rw-r--r--src/glx/x11/dri_glx.c77
-rw-r--r--src/glx/x11/glxclient.h26
-rw-r--r--src/glx/x11/glxcmds.c127
-rw-r--r--src/glx/x11/glxext.c188
-rw-r--r--src/glx/x11/glxextensions.c4
6 files changed, 57 insertions, 373 deletions
diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile
index 8982f01a155..bca2ee4ffa9 100644
--- a/src/glx/x11/Makefile
+++ b/src/glx/x11/Makefile
@@ -1,16 +1,12 @@
TOP = ../../..
include $(TOP)/configs/current
-# This is a bit messy. We want this libGL to be capable of loading old
-# interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However,
-# glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across.
-#
-# Furthermore, context creation has evolved over the years, such that this
+# Context creation has evolved over the years, such that this
# code will not build with DNIO defined. When we finally drop old interface
# support in libGL, we need to clean up both glxcmds.c and dri_interface.h.
DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \
- -DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY
+ -DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER
C_SOURCES = \
$(TOP)/src/mesa/glapi/glapi.c \
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index 7ac80eb74d7..a4a389ce5d8 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -55,14 +55,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RTLD_GLOBAL 0
#endif
-#ifdef BUILT_IN_DRI_DRIVER
-
-extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config);
-
-
-#else /* BUILT_IN_DRI_DRIVER */
-
#ifndef DEFAULT_DRIVER_DIR
/* this is normally defined in the Imakefile */
@@ -102,23 +94,6 @@ static void ErrorMessageF(const char *f, ...)
}
-/*
- * We'll save a pointer to this function when we couldn't find a
- * direct rendering driver for a given screen.
- */
-static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
- int numConfigs, __GLXvisualConfig *config)
-{
- (void) dpy;
- (void) scrn;
- (void) psc;
- (void) numConfigs;
- (void) config;
- return NULL;
-}
-
-
-
/**
* Extract the ith directory path out of a colon-separated list of paths. No
* more than \c dirLen characters, including the terminating \c NUL, will be
@@ -182,6 +157,19 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir)
/**
+ * Versioned name of the expected \c __driCreateNewScreen function.
+ *
+ * The version of the last incompatible loader/driver inteface change is
+ * appended to the name of the \c __driCreateNewScreen function. This
+ * prevents loaders from trying to load drivers that are too old.
+ *
+ * \todo
+ * Create a macro or something so that this is automatically updated.
+ */
+static const char createNewScreenName[] = "__driCreateNewScreen_20050722";
+
+
+/**
* Try to \c dlopen the named driver.
*
* This function adds the "_dri.so" suffix to the driver name and searches the
@@ -249,18 +237,16 @@ static __DRIdriver *OpenDriver(const char *driverName)
return NULL; /* out of memory! */
}
- driver->createScreenFunc = (CreateScreenFunc)
- dlsym(handle, "__driCreateScreen");
driver->createNewScreenFunc = (CreateNewScreenFunc)
- dlsym(handle, "__driCreateNewScreen");
+ dlsym(handle, createNewScreenName);
- if ( (driver->createScreenFunc == NULL)
- && (driver->createNewScreenFunc == NULL) ) {
+ if ( driver->createNewScreenFunc == NULL ) {
/* If the driver doesn't have this symbol then something's
* really, really wrong.
*/
- ErrorMessageF("Neither __driCreateScreen or __driCreateNewScreen "
- "are defined in %s_dri.so!\n", driverName);
+ ErrorMessageF("%s not defined in %s_dri.so!\n"
+ "Your driver may be too old for this libGL.\n",
+ createNewScreenName, driverName);
Xfree(driver);
dlclose(handle);
continue;
@@ -379,9 +365,6 @@ const char *glXGetDriverConfig (const char *driverName) {
}
-#endif /* BUILT_IN_DRI_DRIVER */
-
-
/* This function isn't currently used.
*/
static void driDestroyDisplay(Display *dpy, void *private)
@@ -420,7 +403,6 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
*/
pdisp->private = NULL;
pdisp->destroyDisplay = NULL;
- pdisp->createScreen = NULL;
if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
return NULL;
@@ -441,17 +423,9 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
pdisp->destroyDisplay = driDestroyDisplay;
- /* allocate array of pointers to createScreen funcs */
- pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
- if (!pdisp->createScreen) {
- Xfree(pdpyp);
- return NULL;
- }
-
- /* allocate array of pointers to createScreen funcs */
+ /* allocate array of pointers to createNewScreen funcs */
pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createNewScreen) {
- Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
@@ -460,20 +434,10 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
if (!pdpyp->libraryHandles) {
Xfree(pdisp->createNewScreen);
- Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
-#ifdef BUILT_IN_DRI_DRIVER
- /* we'll statically bind to the built-in __driCreateScreen function */
- for (scrn = 0; scrn < numScreens; scrn++) {
- pdisp->createScreen[scrn] = __driCreateScreen;
- pdisp->createNewScreen[scrn] = NULL;
- pdpyp->libraryHandles[scrn] = NULL;
- }
-
-#else
/* dynamically discover DRI drivers for all screens, saving each
* driver's "__driCreateScreen" function pointer. That's the bootstrap
* entrypoint for all DRI drivers.
@@ -481,17 +445,14 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
for (scrn = 0; scrn < numScreens; scrn++) {
__DRIdriver *driver = driGetDriver(dpy, scrn);
if (driver) {
- pdisp->createScreen[scrn] = driver->createScreenFunc;
pdisp->createNewScreen[scrn] = driver->createNewScreenFunc;
pdpyp->libraryHandles[scrn] = driver->handle;
}
else {
- pdisp->createScreen[scrn] = DummyCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
}
-#endif
return (void *)pdpyp;
}
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index 83e1f27269a..b8241b8cf23 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -105,17 +105,6 @@ struct __DRIdisplayRec {
void (*destroyDisplay)(Display *dpy, void *displayPrivate);
/**
- * Methods to create the private DRI screen data and initialize the
- * screen dependent methods.
- * This is an array [indexed by screen number] of function pointers.
- *
- * \deprecated This array of function pointers has been replaced by
- * \c __DRIdisplayRec::createNewScreen.
- * \sa __DRIdisplayRec::createNewScreen
- */
- CreateScreenFunc * createScreen;
-
- /**
* Opaque pointer to private per display direct rendering data.
* \c NULL if direct rendering is not supported on this display.
*/
@@ -124,8 +113,6 @@ struct __DRIdisplayRec {
/**
* Array of pointers to methods to create and initialize the private DRI
* screen data.
- *
- * \sa __DRIdisplayRec::createScreen
*/
CreateNewScreenFunc * createNewScreen;
};
@@ -137,7 +124,6 @@ struct __DRIdisplayRec {
struct __DRIdriverRec {
const char *name;
void *handle;
- CreateScreenFunc createScreenFunc;
CreateNewScreenFunc createNewScreenFunc;
struct __DRIdriverRec *next;
};
@@ -513,14 +499,6 @@ extern void __glFreeAttributeState(__GLXcontext *);
*/
typedef struct __GLXscreenConfigsRec {
/**
- * GLX visuals formated as \c __GLXvisualConfig structures.
- */
- /*@{*/
- __GLXvisualConfig * old_configs;
- int numOldConfigs;
- /*@}*/
-
- /**
* GLX extension string reported by the X-server.
*/
const char *serverGLXexts;
@@ -539,10 +517,10 @@ typedef struct __GLXscreenConfigsRec {
#endif
/**
- * Linked list of configurations for this screen. This is intended to
- * be a superset of \c old_configs.
+ * Linked list of configurations for this screen.
*/
__GLcontextModes *configs;
+
/**
* Per-screen dynamic GLX extension tracking. The \c direct_support
* field only contains enough bits for 64 extensions. Should libGL
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index b9fa4eeb451..5a16fb964d3 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -67,115 +67,6 @@ static const char __glXGLXClientVersion[] = "1.4";
#include "xf86dri.h"
static Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-
-static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
- Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx,
- const __GLcontextModes *fbconfig, int render_type );
-
-#ifndef DRI_NEW_INTERFACE_ONLY
-static Bool dummyBindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read, GLXContext gc );
-
-static Bool dummyUnbindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read, GLXContext gc );
-
-/****************************************************************************/
-
-/**
- * Used as glue when a driver does not support
- * \c __DRIcontextRec::bindContext2.
- *
- * XXX .bindContext is only defined as a function pointer if
- * !DRI_NEW_INTERFACE_ONLY.
- *
- * \sa DriverCreateContextWrapper, __DRIcontextRec::bindContext2
- */
-static Bool dummyBindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read,
- GLXContext gc )
-{
- assert( draw == read );
- return (*gc->driContext.bindContext)( dpy, scrn, draw, gc );
-}
-
-/**
- * Used as glue when a driver does not support
- * \c __DRIcontextRec::unbindContext2.
- *
- * XXX .unbindContext is only defined as a function pointer if
- * !DRI_NEW_INTERFACE_ONLY.
- *
- * \sa DriverCreateContextWrapper, __DRIcontextRec::unbindContext2
- */
-static Bool dummyUnbindContext2( Display *dpy, int scrn,
- GLXDrawable draw, GLXDrawable read,
- GLXContext gc )
-{
- assert( draw == read );
- return (*gc->driContext.unbindContext)( dpy, scrn, draw, gc, GL_FALSE );
-}
-#endif /* DRI_NEW_INTERFACE_ONLY */
-
-
-/****************************************************************************/
-/**
- * Wrap the call to the driver's \c createContext function.
- *
- * The \c createContext function is wrapped because not all drivers support
- * the "new" \c unbindContext2 and \c bindContext2 interfaces. libGL should
- * not have to check to see which functions the driver supports. Instead,
- * if either function is not supported it is wrapped. The wrappers test to
- * make sure that both drawables are the same and pass control to the old
- * interface.
- *
- * \sa dummyBindContext2, dummyUnbindContext2,
- * __DRIcontextRec::bindContext2, __DRIcontextRec::unbindContext2
- */
-
-static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
- Display *dpy, XVisualInfo *vis,
- void *shared,
- __DRIcontext *ctx,
- const __GLcontextModes *modes,
- int render_type )
-{
- void * ctx_priv = NULL;
-
- if ( psc->driScreen.createNewContext != NULL ) {
- assert( modes != NULL );
- ctx_priv = (*psc->driScreen.createNewContext)(dpy, modes, render_type,
- shared, ctx);
-
- /* If the driver supports the createNewContext interface, then
- * it MUST also support either the bindContext2 / unbindContext2
- * interface or the bindContext3 / unbindContext3 interface.
- */
-
- assert( (ctx_priv == NULL) || (ctx->unbindContext2 != NULL)
- || (ctx->unbindContext3 != NULL) );
- assert( (ctx_priv == NULL) || (ctx->bindContext2 != NULL)
- || (ctx->bindContext3 != NULL) );
- }
-#ifndef DRI_NEW_INTERFACE_ONLY
- else {
- if ( vis != NULL ) {
- ctx_priv = (*psc->driScreen.createContext)(dpy, vis, shared, ctx);
-
- if ( ctx_priv != NULL ) {
- if ( ctx->unbindContext2 == NULL ) {
- ctx->unbindContext2 = dummyUnbindContext2;
- }
-
- if ( ctx->bindContext2 == NULL ) {
- ctx->bindContext2 = dummyBindContext2;
- }
- }
- }
- }
-#endif
-
- return ctx_priv;
-}
#endif
@@ -469,10 +360,10 @@ CreateContext(Display *dpy, XVisualInfo *vis,
if (psc && psc->driScreen.private) {
void * const shared = (shareList != NULL)
? shareList->driContext.private : NULL;
- gc->driContext.private =
- DriverCreateContextWrapper( psc, dpy, vis, shared,
- &gc->driContext, mode,
- renderType );
+ gc->driContext.private =
+ (*psc->driScreen.createNewContext)( dpy, mode, renderType,
+ shared,
+ &gc->driContext );
if (gc->driContext.private) {
gc->isDirect = GL_TRUE;
gc->screen = mode->screen;
@@ -842,6 +733,12 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
return reply.isDirect;
}
+/**
+ * \todo
+ * Shouldn't this function \b always return \c GL_FALSE when
+ * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
+ * the GLX protocol here at all?
+ */
PUBLIC Bool GLX_PREFIX(glXIsDirect)(Display *dpy, GLXContext gc)
{
if (!gc) {
@@ -3052,8 +2949,10 @@ int __glXGetInternalVersion(void)
* 20040415 - Added support for bindContext3 and unbindContext3.
* 20040602 - Add __glXGetDrawableInfo. I though that was there
* months ago. :(
+ * 20050722 - Gut all the old interfaces. This breaks compatability with
+ * any DRI driver built to any previous version.
*/
- return 20040602;
+ return 20050722;
}
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 1d82af295fd..be6b84b262d 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -272,7 +272,6 @@ int __glXDebug = 0;
*/
int __glXCloseDisplay(Display *dpy, XExtCodes *codes);
-static GLboolean FillInVisuals( __GLXscreenConfigs * psc );
/************************************************************************/
@@ -352,12 +351,6 @@ static void FreeScreenConfigs(__GLXdisplayPrivate *priv)
if(psc->effectiveGLXexts)
Xfree(psc->effectiveGLXexts);
- if ( psc->old_configs != NULL ) {
- Xfree( psc->old_configs );
- psc->old_configs = NULL;
- psc->numOldConfigs = 0;
- }
-
psc->configs = NULL; /* NOTE: just for paranoia */
}
@@ -399,10 +392,6 @@ static int __glXFreeDisplayPrivate(XExtData *extension)
priv->driDisplay.private = NULL;
#endif
-#ifdef GLX_DIRECT_RENDERING
- XFree(priv->driDisplay.createScreen);
-#endif
-
Xfree((char*) priv);
return 0;
}
@@ -442,112 +431,6 @@ static Bool QueryVersion(Display *dpy, int opcode, int *major, int *minor)
}
-/**
- * Determine if a \c __GLcontextModes structure has the right mojo to be
- * converted to a \c __GLXvisualConfig to be sent to an "old" style DRI
- * driver.
- */
-#define MODE_HAS_MOJO(m) \
- ((m)->visualID != GLX_DONT_CARE) \
- && ((m)->sampleBuffers == 0) \
- && ((m)->samples == 0) \
- && (((m)->drawableType & GLX_WINDOW_BIT) != 0) \
- && (((m)->xRenderable == GL_TRUE) \
- || ((m)->xRenderable == GLX_DONT_CARE))
-
-
-/**
- * Convert the FBConfigs associated with a screen into an array of
- * \c __GLXvisualConfig structures. These structures are passed into DRI
- * drivers that use the "old" interface. The old-style drivers had a fairly
- * strict set of visual types that could be supported. FBConfigs that
- * cannot be supported are not converted.
- *
- * \param psc Screen whose FBConfigs need to be swizzled.
- *
- * \returns
- * If memory could be allocated and at least one FBConfig could be converted
- * to a \c __GLXvisualConfig structure, \c GL_TRUE is returned. Otherwise,
- * \c GL_FALSE is returned.
- *
- * \todo
- * When the old DRI driver interface is no longer supported, this function
- * can be removed.
- */
-static GLboolean
-FillInVisuals( __GLXscreenConfigs * psc )
-{
- __GLcontextModes *modes;
- int glx_visual_count;
-
-
- glx_visual_count = 0;
- for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) {
- if ( MODE_HAS_MOJO( modes ) ) {
- glx_visual_count++;
- }
- }
-
- psc->old_configs = (__GLXvisualConfig *)
- Xmalloc( sizeof( __GLXvisualConfig ) * glx_visual_count );
- if ( psc->old_configs == NULL ) {
- return GL_FALSE;
- }
-
- glx_visual_count = 0;
- for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) {
- if ( MODE_HAS_MOJO( modes ) ) {
-
-#define COPY_VALUE(src_tag,dst_tag) \
- psc->old_configs[glx_visual_count]. dst_tag = modes-> src_tag
-
- COPY_VALUE( visualID, vid );
- COPY_VALUE( rgbMode, rgba );
- COPY_VALUE( stereoMode, stereo );
- COPY_VALUE( doubleBufferMode, doubleBuffer );
-
- psc->old_configs[glx_visual_count].class =
- _gl_convert_to_x_visual_type( modes->visualType );
-
- COPY_VALUE( level, level );
- COPY_VALUE( numAuxBuffers, auxBuffers );
-
- COPY_VALUE( redBits, redSize );
- COPY_VALUE( greenBits, greenSize );
- COPY_VALUE( blueBits, blueSize );
- COPY_VALUE( alphaBits, alphaSize );
- COPY_VALUE( rgbBits, bufferSize );
- COPY_VALUE( accumRedBits, accumRedSize );
- COPY_VALUE( accumGreenBits, accumGreenSize );
- COPY_VALUE( accumBlueBits, accumBlueSize );
- COPY_VALUE( accumAlphaBits, accumAlphaSize );
- COPY_VALUE( depthBits, depthSize );
- COPY_VALUE( stencilBits, stencilSize );
-
- COPY_VALUE( visualRating, visualRating );
- COPY_VALUE( transparentPixel, transparentPixel );
- COPY_VALUE( transparentRed, transparentRed );
- COPY_VALUE( transparentGreen, transparentGreen );
- COPY_VALUE( transparentBlue, transparentBlue );
- COPY_VALUE( transparentAlpha, transparentAlpha );
- COPY_VALUE( transparentIndex, transparentIndex );
-
-#undef COPY_VALUE
-
- glx_visual_count++;
- }
- }
-
- psc->numOldConfigs = glx_visual_count;
- if ( glx_visual_count == 0 ) {
- Xfree( psc->old_configs );
- psc->old_configs = NULL;
- }
-
- return (glx_visual_count != 0);
-}
-
-
void
__glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count,
const INT32 *bp, Bool tagged_only,
@@ -865,9 +748,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
char *driverName;
/*
- * Get device name (like "tdfx") and the ddx version numbers.
- * We'll check the version in each DRI driver's "createScreen"
- * function.
+ * Get device name (like "tdfx") and the ddx version
+ * numbers. We'll check the version in each DRI driver's
+ * "createNewScreen" function.
*/
err_msg = "XF86DRIGetClientDriverName";
if (XF86DRIGetClientDriverName(dpy, scrn,
@@ -910,8 +793,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
if ( status == 0 ) {
/*
- * Map the SAREA region. Further mmap regions may be setup in
- * each DRI driver's "createScreen" function.
+ * Map the SAREA region. Further mmap regions
+ * may be setup in each DRI driver's
+ * "createNewScreen" function.
*/
status = drmMap(fd, hSAREA, SAREA_MAX,
&pSAREA);
@@ -1156,6 +1040,9 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
psc->ext_list_first_time = GL_TRUE;
/* Initialize the direct rendering per screen data and functions */
if (priv->driDisplay.private != NULL) {
+ /* FIXME: Should it be some sort of an error if createNewScreen[i]
+ * FIXME: is NULL?
+ */
if (priv->driDisplay.createNewScreen &&
priv->driDisplay.createNewScreen[i]) {
@@ -1165,21 +1052,6 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
& priv->driDisplay,
priv->driDisplay.createNewScreen[i] );
}
- else if (priv->driDisplay.createScreen &&
- priv->driDisplay.createScreen[i]) {
- /* screen initialization (bootstrap the driver) */
- if ( (psc->old_configs == NULL)
- && !FillInVisuals(psc) ) {
- FreeScreenConfigs(priv);
- return GL_FALSE;
- }
-
- psc->driScreen.screenConfigs = (void *)psc;
- psc->driScreen.private =
- (*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen,
- psc->numOldConfigs,
- psc->old_configs);
- }
}
#endif
}
@@ -1273,7 +1145,6 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
/* Assinging zero here assures we'll never go direct */
dpyPriv->driDisplay.private = 0;
dpyPriv->driDisplay.destroyDisplay = 0;
- dpyPriv->driDisplay.createScreen = 0;
}
else {
dpyPriv->driDisplay.private =
@@ -1607,44 +1478,23 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
}
+#ifdef GLX_DIRECT_RENDERING
static Bool BindContextWrapper( Display *dpy, GLXContext gc,
GLXDrawable draw, GLXDrawable read )
{
-#ifdef GLX_DIRECT_RENDERING
- if ( gc->driContext.bindContext3 != NULL ) {
- return (*gc->driContext.bindContext3)(dpy, gc->screen, draw, read,
- & gc->driContext);
- }
-#ifndef DRI_NEW_INTERFACE_ONLY
- else {
- return (*gc->driContext.bindContext2)(dpy, gc->screen, draw, read,
- gc);
- }
-#endif
-#endif
- return GL_FALSE;
+ return (*gc->driContext.bindContext)(dpy, gc->screen, draw, read,
+ & gc->driContext);
}
-static Bool UnbindContextWrapper( Display *dpy, GLXContext gc )
+static Bool UnbindContextWrapper( GLXContext gc )
{
-#ifdef GLX_DIRECT_RENDERING
- if ( gc->driContext.unbindContext3 != NULL ) {
- return (*gc->driContext.unbindContext3)(dpy, gc->screen,
- gc->currentDrawable,
- gc->currentReadable,
- & gc->driContext );
- }
-#ifndef DRI_NEW_INTERFACE_ONLY
- else {
- return (*gc->driContext.unbindContext2)(dpy, gc->screen,
- gc->currentDrawable,
- gc->currentReadable, gc);
- }
-#endif
-#endif
- return GL_FALSE;
+ return (*gc->driContext.unbindContext)(gc->currentDpy, gc->screen,
+ gc->currentDrawable,
+ gc->currentReadable,
+ & gc->driContext );
}
+#endif /* GLX_DIRECT_RENDERING */
/*
@@ -1707,7 +1557,7 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
/* Unbind the old direct rendering context */
if (oldGC->isDirect) {
if (oldGC->driContext.private) {
- if (! UnbindContextWrapper( oldGC->currentDpy, oldGC )) {
+ if (! UnbindContextWrapper( oldGC )) {
/* The make current failed. Just return GL_FALSE. */
return GL_FALSE;
}
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index 31f7aee5cc6..7c5d9719a63 100644
--- a/src/glx/x11/glxextensions.c
+++ b/src/glx/x11/glxextensions.c
@@ -89,7 +89,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
{ GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N },
{ GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */
- { GLX(OML_swap_method), VER(0,0), Y, N, N, N },
+ { GLX(OML_swap_method), VER(0,0), Y, Y, N, N },
{ GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
{ GLX(SGI_cushion), VER(0,0), N, N, N, N },
{ GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
@@ -99,7 +99,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(SGIS_color_range), VER(0,0), N, N, N, N },
{ GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
{ GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N },
- { GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N },
+ { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N },
{ GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
{ GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
{ GLX(SGIX_swap_group), VER(0,0), N, N, N, N },