diff options
author | Kristian Høgsberg <[email protected]> | 2007-05-16 18:13:41 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2007-10-11 11:21:29 -0400 |
commit | 106a6f29bbdc71982afd629bdf89369cefd1459e (patch) | |
tree | 2bf1779ad462d1804c4cdaadc3f8d8781652b690 | |
parent | a7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4 (diff) |
Move media stream counter entry points to new extension.
-rw-r--r-- | include/GL/internal/dri_interface.h | 76 | ||||
-rw-r--r-- | src/glx/x11/glxclient.h | 4 | ||||
-rw-r--r-- | src/glx/x11/glxcmds.c | 55 | ||||
-rw-r--r-- | src/glx/x11/glxext.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 45 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_screen.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_screen.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mga/mga_xmesa.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_screen.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_screen.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_screen.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_screen.h | 2 |
17 files changed, 102 insertions, 160 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index c518fd0849c..2c91876e0db 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -62,6 +62,7 @@ typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension; typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension; typedef struct __DRIallocateExtensionRec __DRIallocateExtension; typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension; +typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension; /*@}*/ @@ -137,6 +138,32 @@ struct __DRIframeTrackingExtensionRec { float * lastMissedUsage, float * usage); }; + +/** + * Used by drivers that implement the GLX_SGI_video_sync extension. + */ +#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter" +struct __DRImediaStreamCounterExtensionRec { + __DRIextension base; + + /** + * Get the number of vertical refreshes since some point in time before + * this function was first called (i.e., system start up). + */ + int (*getMSC)(__DRIscreen *screen, int64_t *msc); + + /** + * Wait for the MSC to equal target_msc, or, if that has already passed, + * the next time (MSC % divisor) is equal to remainder. If divisor is + * zero, the function will return as soon as MSC is greater than or equal + * to target_msc. + */ + int (*waitForMSC)(__DRIdrawable *drawable, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc); +}; + + /** * \name Functions provided by the driver loader. */ @@ -375,14 +402,6 @@ struct __DRIscreenRec { void *private; /** - * Get the number of vertical refreshes since some point in time before - * this function was first called (i.e., system start up). - * - * \since Internal API version 20030317. - */ - int (*getMSC)(__DRIscreen *screen, int64_t *msc); - - /** * Method to create the private DRI context data and initialize the * context dependent methods. * @@ -464,47 +483,6 @@ struct __DRIdrawableRec { * screen used to create this drawable. Never dereferenced in libGL. */ void *private; - - /** - * Get the number of completed swap buffers for this drawable. - * - * \since Internal API version 20030317. - */ - int (*getSBC)(__DRIdrawable *drawable, int64_t *sbc); - - /** - * Wait for the SBC to be greater than or equal target_sbc. - * - * \since Internal API version 20030317. - */ - int (*waitForSBC)(__DRIdrawable *drawable, - int64_t target_sbc, - int64_t * msc, int64_t * sbc); - - /** - * Wait for the MSC to equal target_msc, or, if that has already passed, - * the next time (MSC % divisor) is equal to remainder. If divisor is - * zero, the function will return as soon as MSC is greater than or equal - * to target_msc. - * - * \since Internal API version 20030317. - */ - int (*waitForMSC)(__DRIdrawable *drawable, - int64_t target_msc, int64_t divisor, int64_t remainder, - int64_t * msc, int64_t * sbc); - - /** - * Like \c swapBuffers, but does NOT have an implicit \c glFlush. Once - * rendering is complete, waits until MSC is equal to target_msc, or - * if that has already passed, waits until (MSC % divisor) is equal - * to remainder. If divisor is zero, the swap will happen as soon as - * MSC is greater than or equal to target_msc. - * - * \since Internal API version 20030317. - */ - int64_t (*swapBuffersMSC)(__DRIdrawable *drawable, - int64_t target_msc, - int64_t divisor, int64_t remainder); }; #endif diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index d9fc7a5a6c3..0709f3ef26e 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -493,6 +493,10 @@ struct __GLXscreenConfigsRec { __DRIframeTrackingExtension *frameTracking; #endif +#ifdef __DRI_MEDIA_STREAM_COUNTER + __DRImediaStreamCounterExtension *msc; +#endif + #endif /** diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 2b0403d37c9..a680c646d95 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -1931,19 +1931,18 @@ static int __glXGetVideoSyncSGI(unsigned int *count) * FIXME: there should be a GLX encoding for this call. I can find no * FIXME: documentation for the GLX encoding. */ -#ifdef GLX_DIRECT_RENDERING +#ifdef __DRI_MEDIA_STREAM_COUNTER GLXContext gc = __glXGetCurrentContext(); if ( (gc != NULL) && gc->isDirect ) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); - if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit ) - && psc->driScreen.private && psc->driScreen.getMSC) { + if (psc->msc != NULL && psc->driScreen.private != NULL) { int ret; int64_t temp; - ret = psc->driScreen.getMSC(&psc->driScreen, &temp); + ret = psc->msc->getMSC(&psc->driScreen, &temp); *count = (unsigned) temp; return (ret == 0) ? 0 : GLX_BAD_CONTEXT; } @@ -1956,7 +1955,7 @@ static int __glXGetVideoSyncSGI(unsigned int *count) static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) { -#ifdef GLX_DIRECT_RENDERING +#ifdef __DRI_MEDIA_STREAM_COUNTER GLXContext gc = __glXGetCurrentContext(); if ( divisor <= 0 || remainder < 0 ) @@ -1965,17 +1964,16 @@ static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count if ( (gc != NULL) && gc->isDirect ) { __GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen ); - if ( __glXExtensionBitIsEnabled( psc, SGI_video_sync_bit ) - && psc->driScreen.private ) { + if (psc->msc != NULL && psc->driScreen.private ) { __DRIdrawable * const pdraw = GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL); - if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL) ) { + if (pdraw != NULL) { int ret; int64_t msc; int64_t sbc; - ret = (*pdraw->waitForMSC)(pdraw, 0, - divisor, remainder, &msc, &sbc); + ret = (*psc->msc->waitForMSC)(pdraw, 0, + divisor, remainder, &msc, &sbc); *count = (unsigned) msc; return (ret == 0) ? 0 : GLX_BAD_CONTEXT; } @@ -2130,7 +2128,7 @@ static Bool __glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max) static Bool __glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc) { -#ifdef GLX_DIRECT_RENDERING +#if defined(__DRI_SWAP_BUFFER_COUNTER) && defined(__DRI_MEDIA_STREAM_COUNTER) __GLXdisplayPrivate * const priv = __glXInitialize(dpy); if ( priv != NULL ) { @@ -2139,11 +2137,10 @@ static Bool __glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable, __GLXscreenConfigs * const psc = &priv->screenConfigs[i]; assert( (pdraw == NULL) || (i != -1) ); - return ( (pdraw && pdraw->getSBC && psc->driScreen.getMSC) - && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) - && ((*psc->driScreen.getMSC)(&psc->driScreen, msc) == 0) - && ((*pdraw->getSBC)(pdraw, sbc ) == 0) - && (__glXGetUST( ust ) == 0) ); + return ( (pdraw && psc->sbc && psc->msc) + && ((*psc->msc->getMSC)(&psc->driScreen, msc) == 0) + && ((*psc->sbc->getSBC)(pdraw, sbc) == 0) + && (__glXGetUST(ust) == 0) ); } #else (void) dpy; @@ -2248,7 +2245,7 @@ static int64_t __glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) { -#ifdef GLX_DIRECT_RENDERING +#ifdef __DRI_SWAP_BUFFER_COUNTER int screen; __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); @@ -2263,10 +2260,10 @@ static int64_t __glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable, if ( divisor > 0 && remainder >= divisor ) return -1; - if ( (pdraw != NULL) && (pdraw->swapBuffersMSC != NULL) - && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) { - return (*pdraw->swapBuffersMSC)(pdraw, target_msc, divisor, remainder); - } + if (pdraw != NULL && psc->counters != NULL) + return (*psc->sbc->swapBuffersMSC)(pdraw, target_msc, + divisor, remainder); + #else (void) dpy; (void) drawable; @@ -2283,7 +2280,7 @@ static Bool __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc) { -#ifdef GLX_DIRECT_RENDERING +#ifdef __DRI_MEDIA_STREAM_COUNTER int screen; __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); @@ -2297,10 +2294,9 @@ static Bool __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, if ( divisor > 0 && remainder >= divisor ) return False; - if ( (pdraw != NULL) && (pdraw->waitForMSC != NULL) - && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit ) ) { - ret = (*pdraw->waitForMSC)(pdraw, target_msc, - divisor, remainder, msc, sbc); + if (pdraw != NULL && psc->msc != NULL) { + ret = (*psc->msc->waitForMSC)(pdraw, target_msc, + divisor, remainder, msc, sbc); /* __glXGetUST returns zero on success and non-zero on failure. * This function returns True on success and False on failure. @@ -2325,7 +2321,7 @@ static Bool __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc ) { -#ifdef GLX_DIRECT_RENDERING +#ifdef __DRI_SWAP_BUFFER_COUNTER int screen; __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); @@ -2337,9 +2333,8 @@ static Bool __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, if ( target_sbc < 0 ) return False; - if ( (pdraw != NULL) && (pdraw->waitForSBC != NULL) - && __glXExtensionBitIsEnabled( psc, OML_sync_control_bit )) { - ret = (*pdraw->waitForSBC)(pdraw, target_sbc, msc, sbc); + if (pdraw != NULL && psc->sbc != NULL) { + ret = (*psc->sbc->waitForSBC)(pdraw, target_sbc, msc, sbc); /* __glXGetUST returns zero on success and non-zero on failure. * This function returns True on success and False on failure. diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 8a70e677342..643db487c58 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -1051,10 +1051,23 @@ static void queryExtensions(__GLXscreenConfigs *psc) if (strcmp(extensions[i]->name, __DRI_FRAME_TRACKING) == 0) { psc->frameTracking = (__DRIframeTrackingExtension *) extensions[i]; __glXScrEnableExtension(&psc->driScreen, - "GLX_MESA_swap_frame_usage"); + "GLX_MESA_swap_frame_usage"); } #endif +#ifdef __DRI_MEDIA_STREAM_COUNTER + if (strcmp(extensions[i]->name, __DRI_MEDIA_STREAM_COUNTER) == 0) { + psc->msc = (__DRImediaStreamCounterExtension *) extensions[i]; + __glXScrEnableExtension(&psc->driScreen, + "GLX_SGI_video_sync"); + } +#endif + +#ifdef __DRI_SWAP_BUFFER_COUNTER + /* No driver supports this at this time and the extension is + * not defined in dri_interface.h. Will enable + * GLX_OML_sync_control if implemented. */ +#endif /* Ignore unknown extensions */ } } diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 7815f361a83..e20c4fe5fac 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -358,31 +358,6 @@ static int driGetMSC( __DRIscreen *screen, int64_t *msc ) return sPriv->DriverAPI.GetMSC( sPriv, msc ); } -/** - * Called directly from a number of higher-level GLX functions. - */ -static int driGetSBC(__DRIdrawable *drawable, int64_t *sbc) -{ - __DRIdrawablePrivate *dPriv = drawable->private; - __DRIswapInfo sInfo; - int status; - - - status = dPriv->driScreenPriv->DriverAPI.GetSwapInfo( dPriv, & sInfo ); - *sbc = sInfo.swap_count; - - return status; -} - -static int driWaitForSBC(__DRIdrawable *drawable, int64_t target_sbc, - int64_t * msc, int64_t * sbc) -{ - __DRIdrawablePrivate *dPriv = drawable->private; - - return dPriv->driScreenPriv->DriverAPI.WaitForSBC( dPriv, target_sbc, - msc, sbc ); -} - static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc, int64_t * sbc) @@ -409,15 +384,11 @@ static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc, return status; } -static int64_t driSwapBuffersMSC(__DRIdrawable *drawable, int64_t target_msc, - int64_t divisor, int64_t remainder) -{ - __DRIdrawablePrivate *dPriv = drawable->private; - - return dPriv->driScreenPriv->DriverAPI.SwapBuffersMSC( dPriv, target_msc, - divisor, - remainder ); -} +const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = { + { __DRI_MEDIA_STREAM_COUNTER }, + driGetMSC, + driWaitForMSC, +}; static void driCopySubBuffer(__DRIdrawable *drawable, int x, int y, int w, int h) @@ -506,11 +477,6 @@ static void *driCreateNewDrawable(__DRIscreen *screen, pdraw->destroyDrawable = driDestroyDrawable; pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */ - pdraw->getSBC = driGetSBC; - pdraw->waitForSBC = driWaitForSBC; - pdraw->waitForMSC = driWaitForMSC; - pdraw->swapBuffersMSC = driSwapBuffersMSC; - /* This special default value is replaced with the configured * default value when the drawable is first bound to a direct * rendering context. @@ -776,7 +742,6 @@ void * __DRI_CREATE_NEW_SCREEN( int scrn, __DRIscreen *psc, psc->destroyScreen = driDestroyScreen; psc->getExtensions = driGetExtensions; psc->createNewDrawable = driCreateNewDrawable; - psc->getMSC = driGetMSC; psc->createNewContext = driCreateNewContext; if (internal_api_version >= 20070121) diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index a7149bc5525..e43a5b752e8 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -79,6 +79,7 @@ extern __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp); extern const __DRIcopySubBufferExtension driCopySubBufferExtension; extern const __DRIswapControlExtension driSwapControlExtension; extern const __DRIframeTrackingExtension driFrameTrackingExtension; +extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension; /** * Used by DRI_VALIDATE_DRAWABLE_INFO diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 041ff6bef08..60d375874df 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -431,6 +431,7 @@ static const __DRIextension *intelExtensions[] = { &driSwapControlExtension.base, &intelAllocateExtension.base, &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, NULL }; @@ -539,7 +540,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) sPriv->extensions = intelExtensions; if (glx_enable_extension != NULL) { - (*glx_enable_extension) (sPriv->psc, "GLX_SGI_video_sync"); (*glx_enable_extension) (sPriv->psc, "GLX_SGI_make_current_read"); } diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index ed8d207a494..a4d63599e55 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -268,6 +268,7 @@ static const __DRIextension *intelExtensions[] = { &driCopySubBufferExtension.base, &driSwapControlExtension.base, &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, NULL }; @@ -358,10 +359,8 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) sPriv->extensions = intelExtensions; - if (glx_enable_extension != NULL) { - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); + if (glx_enable_extension != NULL) (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); - } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index adbed098777..04eb0815149 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -208,8 +208,6 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) { mach64ScreenPtr mach64Screen; ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv; - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); int i; if (sPriv->devPrivSize != sizeof(ATIDRIRec)) { @@ -321,12 +319,9 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) i = 0; mach64Screen->extensions[i++] = &driFrameTrackingExtension.base; - if ( glx_enable_extension != NULL ) { - if ( mach64Screen->irq != 0 ) { - mach64Screen->extensions[i++] = &driSwapControlExtension.base; - - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); - } + if ( mach64Screen->irq != 0 ) { + mach64Screen->extensions[i++] = &driSwapControlExtension.base; + mach64Screen->extensions[i++] = &driMediaStreamCounterExtension.base; } mach64Screen->extensions[i++] = NULL; sPriv->extensions = mach64Screen->extensions; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.h b/src/mesa/drivers/dri/mach64/mach64_screen.h index 732cb3f23ad..766554d7e4d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.h +++ b/src/mesa/drivers/dri/mach64/mach64_screen.h @@ -74,7 +74,7 @@ typedef struct { driOptionCache optionCache; - const __DRIextension *extensions[3]; + const __DRIextension *extensions[4]; } mach64ScreenRec, *mach64ScreenPtr; #endif /* __MACH64_SCREEN_H__ */ diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 198c5d5ca95..6f138351ccd 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -196,6 +196,7 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, static const __DRIextension *mgaExtensions[] = { &driSwapControlExtension.base, &driFrameTrackingExtension.base, + &driMediaStreamCounterExtension.base, NULL }; @@ -242,10 +243,8 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) sPriv->extensions = mgaExtensions; - if ( glx_enable_extension != NULL ) { + if ( glx_enable_extension != NULL ) (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); - (*glx_enable_extension)( sPriv->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 c7bd8762831..9d65ebddf7d 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -98,8 +98,6 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) { r128ScreenPtr r128Screen; R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv; - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); int i; if (sPriv->devPrivSize != sizeof(R128DRIRec)) { @@ -228,11 +226,9 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) i = 0; r128Screen->extensions[i++] = &driFrameTrackingExtension.base; - if ( glx_enable_extension != NULL ) { - if ( r128Screen->irq != 0 ) { - r128Screen->extensions[i++] = &driSwapControlExtension.base; - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); - } + if ( r128Screen->irq != 0 ) { + r128Screen->extensions[i++] = &driSwapControlExtension.base; + r128Screen->extensions[i++] = &driMediaStreamCounterExtension.base; } r128Screen->extensions[i++] = NULL; sPriv->extensions = r128Screen->extensions; diff --git a/src/mesa/drivers/dri/r128/r128_screen.h b/src/mesa/drivers/dri/r128/r128_screen.h index 75dc084d9d1..c333713766c 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.h +++ b/src/mesa/drivers/dri/r128/r128_screen.h @@ -78,7 +78,7 @@ typedef struct { /* Configuration cache with default values for all contexts */ driOptionCache optionCache; - const __DRIextension *extensions[3]; + const __DRIextension *extensions[4]; } r128ScreenRec, *r128ScreenPtr; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 4eaff652c7c..56493f5a3aa 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -745,15 +745,12 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) i = 0; screen->extensions[i++] = &driCopySubBufferExtension.base; screen->extensions[i++] = &driFrameTrackingExtension.base; - - if ( glx_enable_extension != NULL ) { - if ( screen->irq != 0 ) { - screen->extensions[i++] = &driSwapControlExtension.base; - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); - } - - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); + if ( screen->irq != 0 ) { + screen->extensions[i++] = &driSwapControlExtension.base; + screen->extensions[i++] = &driMediaStreamCounterExtension.base; } + if ( glx_enable_extension != NULL ) + (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) if (IS_R200_CLASS(screen)) diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index 10012109179..0caac17dafb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -104,7 +104,7 @@ typedef struct { /* Configuration cache with default values for all contexts */ driOptionCache optionCache; - const __DRIextension *extensions[5]; + const __DRIextension *extensions[6]; } radeonScreenRec, *radeonScreenPtr; #define IS_R100_CLASS(screen) \ diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 025d8f63af4..fddf0799346 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -177,14 +177,14 @@ viaInitDriver(__DRIscreenPrivate *sPriv) i = 0; viaScreen->extensions[i++] = &driFrameTrackingExtension.base; - if ( glx_enable_extension != NULL ) { - if ( viaScreen->irqEnabled ) { - viaScreen->extensions[i++] = &driSwapControlExtension.base; - (*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" ); - } + if ( viaScreen->irqEnabled ) { + viaScreen->extensions[i++] = &driSwapControlExtension.base; + viaScreen->extensions[i++] = &driMediaStreamCounterExtension.base; + } + if ( glx_enable_extension != NULL ) (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" ); - } + viaScreen->extensions[i++] = NULL; sPriv->extensions = viaScreen->extensions; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.h b/src/mesa/drivers/dri/unichrome/via_screen.h index 3dc52ba96a8..5e5bc851b05 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.h +++ b/src/mesa/drivers/dri/unichrome/via_screen.h @@ -71,7 +71,7 @@ typedef struct { /* Configuration cache with default values for all contexts */ driOptionCache optionCache; - const __DRIextension *extensions[3]; + const __DRIextension *extensions[4]; } viaScreenPrivate; |