From: Ian Romanick Date: Thu, 28 Jul 2005 21:57:17 +0000 (+0000) Subject: glxEnableExtension is a platform-specific function exported by the loader. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7c9eafa856623d5ce72afb8b20b7ccbcc3e671d;p=mesa.git glxEnableExtension is a platform-specific function exported by the loader. Therefore, drivers should not require it to run. --- diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index b1a5618f410..af5049d6296 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 e474850c634..f9c618e6441 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 df1ed92fe7d..e87c87c2397 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 ef080b5695a..cf3db99b937 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 b6177bf691d..c1ec8cf6219 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 f0e09d5fc4e..e68f7dae8ad 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 18919ddeb12..466e6b0409e 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 0a2bb7e9161..6822fed9ca6 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 2ae2322f8ac..b718fd446ab 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; }