diff options
author | Kristian Høgsberg <[email protected]> | 2007-05-11 16:11:23 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2007-10-10 18:00:13 -0400 |
commit | aac367f48afc62176faf67aa6f329fbeae2004b4 (patch) | |
tree | 9afce18cf316c930ca764e27caeadb2b0fb2f0be /src/mesa/drivers | |
parent | fa72013adaab4d0755e852805e2e44d1a879a204 (diff) |
Remove screenConfigs from __DRIscreen.
The screenConfigs field of __DRIscreen points back to the containing
__GLXscreenConfigs struct. This is a serious abstraction violation; it
assumes that the loader is libGL and that there *is* a __GLXscreenConfigs
type in the loader.
Using the containerOf macro, we can get from the __DRIscreen pointer to
the containing __GLXscreenConfigs struct, at a place in the stack
where the above is a valid assumption. Besides, the __DRI* structs shouldn't
hold state other than the private pointer.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_screen.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mga/mga_xmesa.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_screen.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/savage/savage_xmesa.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/tdfx/tdfx_screen.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_screen.c | 11 |
9 files changed, 38 insertions, 47 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 7a11672a8f1..6ecde574b4f 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -430,7 +430,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv) PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface-> getProcAddress("glxEnableExtension")); - void *const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(I830DRIRec)) { fprintf(stderr, @@ -524,11 +523,11 @@ intelInitDriver(__DRIscreenPrivate * sPriv) } if (glx_enable_extension != NULL) { - (*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_SGI_make_current_read"); + (*glx_enable_extension) (sPriv->psc, "GLX_SGI_swap_control"); + (*glx_enable_extension) (sPriv->psc, "GLX_SGI_video_sync"); + (*glx_enable_extension) (sPriv->psc, "GLX_MESA_swap_control"); + (*glx_enable_extension) (sPriv->psc, "GLX_MESA_swap_frame_usage"); + (*glx_enable_extension) (sPriv->psc, "GLX_SGI_make_current_read"); } /* If we've got a new enough DDX that's initializing TTM and giving us diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 29ea07d78ef..97ccba09d82 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -271,7 +271,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; volatile drmI830Sarea *sarea; if (sPriv->devPrivSize != sizeof(I830DRIRec)) { @@ -352,12 +351,12 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) } if (glx_enable_extension != NULL) { - (*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_SGI_make_current_read" ); - (*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_copy_sub_buffer" ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 52b96bf0bc0..733a16b6aef 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -210,7 +210,6 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(ATIDRIRec)) { fprintf(stderr,"\nERROR! sizeof(ATIDRIRec) does not match passed size from device driver\n"); @@ -321,12 +320,12 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) 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)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); } - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->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 372d2ce4339..5b9d09d0bf3 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -200,7 +200,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(MGADRIRec)) { fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n"); @@ -236,11 +235,11 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) } 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" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); } if (serverInfo->chipset != MGA_CARD_TYPE_G200 && diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index a84b54924ac..9df9c65faef 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -100,7 +100,6 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(R128DRIRec)) { fprintf(stderr,"\nERROR! sizeof(R128DRIRec) does not match passed size from device driver\n"); @@ -228,12 +227,12 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) 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)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); } - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" ); } return r128Screen; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 2d44532a843..8f9509de5b2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -343,7 +343,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) unsigned char *RADEONMMIO; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) { fprintf(stderr,"\nERROR! sizeof(RADEONDRIRec) does not match passed size from device driver\n"); @@ -734,17 +733,17 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) 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)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); } - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" ); if (IS_R200_CLASS(screen)) - (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_allocate_memory" ); - (*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" ); - (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_copy_sub_buffer" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); } #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index e8a63ae51b9..9678c526aa0 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -266,8 +266,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv) __driConfigOptions, __driNConfigOptions); if (glx_enable_extension != NULL) { - (*glx_enable_extension)(sPriv->psc->screenConfigs, - "GLX_SGI_make_current_read"); + (*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read"); } #if 0 diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 899963d06d3..e9033c5ef3a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -75,7 +75,6 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void *const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) { fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n"); @@ -117,7 +116,7 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv ) } if (glx_enable_extension != NULL) { - (*glx_enable_extension)(psc, "GLX_SGI_make_current_read"); + (*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read"); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index c10b7d1a9b1..22e4bcebc91 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -100,7 +100,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv) VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); - void * const psc = sPriv->psc->screenConfigs; if (sPriv->devPrivSize != sizeof(VIADRIRec)) { fprintf(stderr,"\nERROR! sizeof(VIADRIRec) does not match passed size from device driver\n"); @@ -177,13 +176,13 @@ viaInitDriver(__DRIscreenPrivate *sPriv) 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)( sPriv->psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_control" ); } - (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); + (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" ); } return GL_TRUE; |