}
-/*
-** GLX_MESA_swap_frame_usage
-*/
-
-int
-glXBeginFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
- (void) dpy;
- (void) drawable;
- return status;
-}
-
-
-int
-glXEndFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
- (void) dpy;
- (void) drawable;
- return status;
-}
-
-
-int
-glXGetFrameUsageMESA(Display * dpy, GLXDrawable drawable, GLfloat * usage)
-{
- int status = GLX_BAD_CONTEXT;
- (void) dpy;
- (void) drawable;
- (void) usage;
- return status;
-}
-
-int
-glXQueryFrameTrackingMESA(Display * dpy, GLXDrawable drawable,
- int64_t * sbc, int64_t * missedFrames,
- GLfloat * lastMissedUsage)
-{
- int status = GLX_BAD_CONTEXT;
- (void) dpy;
- (void) drawable;
- (void) sbc;
- (void) missedFrames;
- (void) lastMissedUsage;
- return status;
-}
-
/*
** GLX_SGI_video_sync
*/
}
#endif
-#ifdef __DRI_FRAME_TRACKING
- if (strcmp(extensions[i]->name, __DRI_FRAME_TRACKING) == 0) {
- psc->frameTracking = (__DRIframeTrackingExtension *) extensions[i];
- __glXEnableDirectExtension(psc, "GLX_MESA_swap_frame_usage");
- }
-#endif
-
#ifdef __DRI_READ_DRAWABLE
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
__glXEnableDirectExtension(psc, "GLX_SGI_make_current_read");
const __DRIcopySubBufferExtension *driCopySubBuffer;
#endif
-#ifdef __DRI_FRAME_TRACKING
- const __DRIframeTrackingExtension *frameTracking;
-#endif
-
#endif
/**
}
-/*
-** GLX_MESA_swap_frame_usage
-*/
-
-static GLint
-__glXBeginFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef __DRI_FRAME_TRACKING
- int screen = 0;
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
-
- if (pdraw != NULL && psc->frameTracking != NULL)
- status = psc->frameTracking->frameTracking(pdraw->driDrawable, GL_TRUE);
-#else
- (void) dpy;
- (void) drawable;
-#endif
- return status;
-}
-
-
-static GLint
-__glXEndFrameTrackingMESA(Display * dpy, GLXDrawable drawable)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef __DRI_FRAME_TRACKING
- int screen = 0;
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
- __GLXscreenConfigs *psc = GetGLXScreenConfigs(dpy, screen);
-
- if (pdraw != NULL && psc->frameTracking != NULL)
- status = psc->frameTracking->frameTracking(pdraw->driDrawable,
- GL_FALSE);
-#else
- (void) dpy;
- (void) drawable;
-#endif
- return status;
-}
-
-
-static GLint
-__glXGetFrameUsageMESA(Display * dpy, GLXDrawable drawable, GLfloat * usage)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef __DRI_FRAME_TRACKING
- int screen = 0;
- __GLXDRIdrawable *const pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
-
- if (pdraw != NULL && psc->frameTracking != NULL) {
- int64_t sbc, missedFrames;
- float lastMissedUsage;
-
- status = psc->frameTracking->queryFrameTracking(pdraw->driDrawable,
- &sbc,
- &missedFrames,
- &lastMissedUsage,
- usage);
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) usage;
-#endif
- return status;
-}
-
-
-static GLint
-__glXQueryFrameTrackingMESA(Display * dpy, GLXDrawable drawable,
- int64_t * sbc, int64_t * missedFrames,
- GLfloat * lastMissedUsage)
-{
- int status = GLX_BAD_CONTEXT;
-#ifdef __DRI_FRAME_TRACKING
- int screen = 0;
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
-
- if (pdraw != NULL && psc->frameTracking != NULL) {
- float usage;
-
- status = psc->frameTracking->queryFrameTracking(pdraw->driDrawable,
- sbc, missedFrames,
- lastMissedUsage,
- &usage);
- }
-#else
- (void) dpy;
- (void) drawable;
- (void) sbc;
- (void) missedFrames;
- (void) lastMissedUsage;
-#endif
- return status;
-}
-
-
/*
** GLX_SGI_video_sync
*/
/*** GLX_MESA_swap_control ***/
GLX_FUNCTION2(glXSwapIntervalMESA, __glXSwapIntervalMESA),
GLX_FUNCTION2(glXGetSwapIntervalMESA, __glXGetSwapIntervalMESA),
-
- /*** GLX_MESA_swap_frame_usage ***/
- GLX_FUNCTION2(glXBeginFrameTrackingMESA, __glXBeginFrameTrackingMESA),
- GLX_FUNCTION2(glXEndFrameTrackingMESA, __glXEndFrameTrackingMESA),
- GLX_FUNCTION2(glXGetFrameUsageMESA, __glXGetFrameUsageMESA),
- GLX_FUNCTION2(glXQueryFrameTrackingMESA, __glXQueryFrameTrackingMESA),
#endif
/*** GLX_ARB_get_proc_address ***/
{ GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */
#ifdef GLX_USE_APPLEGL
{ GLX(MESA_swap_control), VER(0,0), N, N, N, N },
- { GLX(MESA_swap_frame_usage), VER(0,0), N, N, N, N },
#else
{ GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
- { GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y },
#endif
{ GLX(NV_float_buffer), VER(0,0), N, N, N, N },
{ GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
dri2ConfigQueryf,
};
-static int
-driFrameTracking(__DRIdrawable *drawable, GLboolean enable)
-{
- return GLX_BAD_CONTEXT;
-}
-
-static int
-driQueryFrameTracking(__DRIdrawable *dpriv,
- int64_t * sbc, int64_t * missedFrames,
- float * lastMissedUsage, float * usage)
-{
- __DRIswapInfo sInfo;
- int status;
- int64_t ust;
- __DRIscreen *psp = dpriv->driScreenPriv;
-
- status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo );
- if ( status == 0 ) {
- *sbc = sInfo.swap_count;
- *missedFrames = sInfo.swap_missed_count;
- *lastMissedUsage = sInfo.swap_missed_usage;
-
- (*psp->systemTime->getUST)( & ust );
- *usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust );
- }
-
- return status;
-}
-
-const __DRIframeTrackingExtension driFrameTrackingExtension = {
- { __DRI_FRAME_TRACKING, __DRI_FRAME_TRACKING_VERSION },
- driFrameTracking,
- driQueryFrameTracking
-};
-
/**
* Calculate amount of swap interval used between GLX buffer swaps.
*
extern const __DRIextension driReadDrawableExtension;
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
extern const __DRIswapControlExtension driSwapControlExtension;
-extern const __DRIframeTrackingExtension driFrameTrackingExtension;
extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension;
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
mach64Screen->driScreen = sPriv;
i = 0;
- mach64Screen->extensions[i++] = &driFrameTrackingExtension.base;
if ( mach64Screen->irq != 0 ) {
mach64Screen->extensions[i++] = &driSwapControlExtension.base;
mach64Screen->extensions[i++] = &driMediaStreamCounterExtension.base;
const __DRIextension *mgaScreenExtensions[] = {
&driReadDrawableExtension,
&driSwapControlExtension.base,
- &driFrameTrackingExtension.base,
&driMediaStreamCounterExtension.base,
NULL
};
r128Screen->driScreen = sPriv;
i = 0;
- r128Screen->extensions[i++] = &driFrameTrackingExtension.base;
if ( r128Screen->irq != 0 ) {
r128Screen->extensions[i++] = &driSwapControlExtension.base;
r128Screen->extensions[i++] = &driMediaStreamCounterExtension.base;
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
- screen->extensions[i++] = &driFrameTrackingExtension.base;
screen->extensions[i++] = &driReadDrawableExtension;
if ( screen->irq != 0 ) {
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
- screen->extensions[i++] = &driFrameTrackingExtension.base;
screen->extensions[i++] = &driReadDrawableExtension;
screen->extensions[i++] = &dri2ConfigQueryExtension.base;
viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
i = 0;
- viaScreen->extensions[i++] = &driFrameTrackingExtension.base;
viaScreen->extensions[i++] = &driReadDrawableExtension;
if ( viaScreen->irqEnabled ) {
viaScreen->extensions[i++] = &driSwapControlExtension.base;