summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@hinata.boston.redhat.com>2007-05-16 15:50:40 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-11 11:11:12 -0400
commita7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4 (patch)
tree59e4e5041b8fc8a7a0c1f44dd6cd185d4df16bc3 /src/mesa/drivers
parent78a6aa57a0155d72280dd91c05513c847bf76f3b (diff)
Move GLX_MESA_swap_frame_usage DRI entry points to the new mechanism.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c18
-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.c2
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c3
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.h2
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.c3
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.h2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.h2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.h2
13 files changed, 23 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index ba677f6ff8..7815f361a8 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -52,11 +52,6 @@ static const int empty_attribute_list[1] = { None };
*/
static int api_ver = 0;
-/* forward declarations */
-static int driQueryFrameTracking( __DRIdrawable *drawable,
- int64_t *sbc, int64_t *missedFrames,
- float *lastMissedUsage, float *usage );
-
static void *driCreateNewDrawable(__DRIscreen *screen,
const __GLcontextModes *modes,
__DRIdrawable *pdraw,
@@ -515,8 +510,6 @@ static void *driCreateNewDrawable(__DRIscreen *screen,
pdraw->waitForSBC = driWaitForSBC;
pdraw->waitForMSC = driWaitForMSC;
pdraw->swapBuffersMSC = driSwapBuffersMSC;
- pdraw->frameTracking = NULL;
- pdraw->queryFrameTracking = driQueryFrameTracking;
/* This special default value is replaced with the configured
* default value when the drawable is first bound to a direct
@@ -826,6 +819,12 @@ int driCompareGLXAPIVersion( GLint required_version )
static int
+driFrameTracking(__DRIdrawable *drawable, GLboolean enable)
+{
+ return GLX_BAD_CONTEXT;
+}
+
+static int
driQueryFrameTracking(__DRIdrawable *drawable,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage)
@@ -849,6 +848,11 @@ driQueryFrameTracking(__DRIdrawable *drawable,
return status;
}
+const __DRIframeTrackingExtension driFrameTrackingExtension = {
+ { __DRI_FRAME_TRACKING },
+ driFrameTracking,
+ driQueryFrameTracking
+};
/**
* Calculate amount of swap interval used between GLX buffer swaps.
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 78320307d6..a7149bc552 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -78,6 +78,7 @@ extern __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp);
*/
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
extern const __DRIswapControlExtension driSwapControlExtension;
+extern const __DRIframeTrackingExtension driFrameTrackingExtension;
/**
* 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 27bf5e12a2..041ff6bef0 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -430,6 +430,7 @@ static const __DRIextension *intelExtensions[] = {
&driCopySubBufferExtension.base,
&driSwapControlExtension.base,
&intelAllocateExtension.base,
+ &driFrameTrackingExtension.base,
NULL
};
@@ -539,7 +540,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
if (glx_enable_extension != NULL) {
(*glx_enable_extension) (sPriv->psc, "GLX_SGI_video_sync");
- (*glx_enable_extension) (sPriv->psc, "GLX_MESA_swap_frame_usage");
(*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 c75a86bf5b..ed8d207a49 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -267,6 +267,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
static const __DRIextension *intelExtensions[] = {
&driCopySubBufferExtension.base,
&driSwapControlExtension.base,
+ &driFrameTrackingExtension.base,
NULL
};
@@ -359,7 +360,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
if (glx_enable_extension != NULL) {
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" );
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index 46314b426f..adbed09877 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -320,14 +320,13 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
mach64Screen->driScreen = 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" );
}
-
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
}
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 36da715770..732cb3f23a 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[2];
+ const __DRIextension *extensions[3];
} 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 eba96486f6..198c5d5ca9 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -195,6 +195,7 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
static const __DRIextension *mgaExtensions[] = {
&driSwapControlExtension.base,
+ &driFrameTrackingExtension.base,
NULL
};
@@ -242,7 +243,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
sPriv->extensions = mgaExtensions;
if ( glx_enable_extension != NULL ) {
- (*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_video_sync" );
}
diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c
index 9e5c25d720..c7bd876283 100644
--- a/src/mesa/drivers/dri/r128/r128_screen.c
+++ b/src/mesa/drivers/dri/r128/r128_screen.c
@@ -227,13 +227,12 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
r128Screen->driScreen = 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" );
}
-
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
}
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 9733927274..75dc084d9d 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[2];
+ const __DRIextension *extensions[3];
} r128ScreenRec, *r128ScreenPtr;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 362d70f9e5..4eaff652c7 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -744,6 +744,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
+ screen->extensions[i++] = &driFrameTrackingExtension.base;
if ( glx_enable_extension != NULL ) {
if ( screen->irq != 0 ) {
@@ -751,7 +752,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_video_sync" );
}
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h
index 954096f677..1001210917 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[4];
+ const __DRIextension *extensions[5];
} 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 153e401a16..025d8f63af 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -176,6 +176,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
i = 0;
+ viaScreen->extensions[i++] = &driFrameTrackingExtension.base;
if ( glx_enable_extension != NULL ) {
if ( viaScreen->irqEnabled ) {
viaScreen->extensions[i++] = &driSwapControlExtension.base;
@@ -183,7 +184,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
}
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
}
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 85f87c4da3..3dc52ba96a 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[2];
+ const __DRIextension *extensions[3];
} viaScreenPrivate;