summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i830/i830_screen.c8
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c11
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c18
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c16
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.c18
-rw-r--r--src/mesa/drivers/dri/r200/r200_screen.c21
-rw-r--r--src/mesa/drivers/dri/r300/radeon_screen.c22
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c18
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c19
9 files changed, 66 insertions, 85 deletions
diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c
index b1a5618f41..af5049d629 100644
--- a/src/mesa/drivers/dri/i830/i830_screen.c
+++ b/src/mesa/drivers/dri/i830/i830_screen.c
@@ -147,10 +147,6 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return GL_FALSE;
- }
-
/* Allocate the private area */
i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate));
if (!i830Screen) {
@@ -286,7 +282,9 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
}
#endif
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+ if ( glx_enable_extension == NULL ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+ }
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index e474850c63..f9c618e644 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -80,10 +80,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
void * const psc = sPriv->psc->screenConfigs;
- if (glx_enable_extension == NULL) {
- return GL_FALSE;
- }
-
/* Allocate the private area */
intelScreen = (intelScreenPrivate *)CALLOC(sizeof(intelScreenPrivate));
if (!intelScreen) {
@@ -199,14 +195,15 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
}
}
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+ if (glx_enable_extension == NULL) {
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+ (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
+ }
sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA;
- (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
-
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index df1ed92fe7..e87c87c239 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -215,10 +215,6 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
fprintf( stderr, "%s\n", __FUNCTION__ );
- if ( glx_enable_extension == NULL ) {
- return NULL;
- }
-
/* Allocate the private area */
mach64Screen = (mach64ScreenPtr) CALLOC( sizeof(*mach64Screen) );
if ( !mach64Screen ) return NULL;
@@ -318,13 +314,15 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
mach64Screen->driScreen = sPriv;
- if ( mach64Screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
+ if ( glx_enable_extension == NULL ) {
+ if ( mach64Screen->irq != 0 ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ }
return mach64Screen;
}
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index ef080b5695..cf3db99b93 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -201,10 +201,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return GL_FALSE;
- }
-
/* Allocate the private area */
mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate));
if (!mgaScreen) {
@@ -233,11 +229,13 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
}
}
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
- (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ if ( glx_enable_extension == NULL ) {
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ }
if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
serverInfo->chipset != MGA_CARD_TYPE_G400) {
diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c
index b6177bf691..c1ec8cf621 100644
--- a/src/mesa/drivers/dri/r128/r128_screen.c
+++ b/src/mesa/drivers/dri/r128/r128_screen.c
@@ -103,10 +103,6 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return NULL;
- }
-
/* Allocate the private area */
r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) );
if ( !r128Screen ) return NULL;
@@ -218,13 +214,15 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
r128Screen->driScreen = sPriv;
- if ( r128Screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
+ if ( glx_enable_extension == NULL ) {
+ if ( r128Screen->irq != 0 ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ }
return r128Screen;
}
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c
index f0e09d5fc4..e68f7dae8a 100644
--- a/src/mesa/drivers/dri/r200/r200_screen.c
+++ b/src/mesa/drivers/dri/r200/r200_screen.c
@@ -240,10 +240,6 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return NULL;
- }
-
/* Allocate the private area */
screen = (r200ScreenPtr) CALLOC( sizeof(*screen) );
if ( !screen ) {
@@ -467,20 +463,21 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
- if ( screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
+ if ( glx_enable_extension == NULL ) {
+ if ( screen->irq != 0 ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
+ }
sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA;
- (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
-
return screen;
}
diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c
index 18919ddeb1..466e6b0409 100644
--- a/src/mesa/drivers/dri/r300/radeon_screen.c
+++ b/src/mesa/drivers/dri/r300/radeon_screen.c
@@ -316,10 +316,6 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
void *const psc = sPriv->psc->screenConfigs;
- if (glx_enable_extension == NULL) {
- return NULL;
- }
-
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC(sizeof(*screen));
if (!screen) {
@@ -586,20 +582,24 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
- if (screen->irq != 0) {
- (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
- (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
- (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
- }
+ if (glx_enable_extension == NULL) {
+ if (screen->irq != 0) {
+ (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
+ (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
+ }
- (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
+ }
#if R200_MERGED
sPriv->psc->allocateMemory = (void *)r200AllocateMemoryMESA;
sPriv->psc->freeMemory = (void *)r200FreeMemoryMESA;
sPriv->psc->memoryOffset = (void *)r200GetMemoryOffsetMESA;
- (*glx_enable_extension) (psc, "GLX_MESA_allocate_memory");
+ if (glx_enable_extension == NULL) {
+ (*glx_enable_extension) (psc, "GLX_MESA_allocate_memory");
+ }
#endif
return screen;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 0a2bb7e916..6822fed9ca 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -213,10 +213,6 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return NULL;
- }
-
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
if ( !screen ) {
@@ -395,13 +391,15 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
dri_priv->log2GARTTexGran;
}
- if ( screen->irq != 0 ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
+ if ( glx_enable_extension != NULL ) {
+ if ( screen->irq != 0 ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ }
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index 2ae2322f8a..b718fd446a 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -102,11 +102,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
void * const psc = sPriv->psc->screenConfigs;
- if ( glx_enable_extension == NULL ) {
- return GL_FALSE;
- }
-
-
/* Allocate the private area */
viaScreen = (viaScreenPrivate *) CALLOC(sizeof(viaScreenPrivate));
if (!viaScreen) {
@@ -175,13 +170,15 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
- if ( viaScreen->irqEnabled ) {
- (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
- (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
- }
+ if ( glx_enable_extension == NULL ) {
+ if ( viaScreen->irqEnabled ) {
+ (*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
+ (*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
+ }
- (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
+ }
return GL_TRUE;
}