summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@hinata.boston.redhat.com>2007-05-16 18:13:41 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-11 11:21:29 -0400
commit106a6f29bbdc71982afd629bdf89369cefd1459e (patch)
tree2bf1779ad462d1804c4cdaadc3f8d8781652b690 /src/mesa/drivers
parenta7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4 (diff)
Move media stream counter entry points to new extension.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c45
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h1
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c5
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c11
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.h2
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c5
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.c10
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.h2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c13
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.h2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c12
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.h2
13 files changed, 32 insertions, 80 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 7815f361a8..e20c4fe5fa 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 a7149bc552..e43a5b752e 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 041ff6bef0..60d375874d 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 ed8d207a49..a4d63599e5 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 adbed09877..04eb081514 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 732cb3f23a..766554d7e4 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 198c5d5ca9..6f138351cc 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 c7bd876283..9d65ebddf7 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 75dc084d9d..c333713766 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 4eaff652c7..56493f5a3a 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 1001210917..0caac17daf 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 025d8f63af..fddf079934 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 3dc52ba96a..5e5bc851b0 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;