* Used by drivers that implement the GLX_SGI_video_sync extension.
*/
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
-#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
+#define __DRI_MEDIA_STREAM_COUNTER_VERSION 2
struct __DRImediaStreamCounterExtensionRec {
__DRIextension base;
int (*waitForMSC)(__DRIdrawable *drawable,
int64_t target_msc, int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc);
+
+ /**
+ * Like the screen version of getMSC, but also takes a drawable so that
+ * the appropriate pipe's counter can be retrieved.
+ *
+ * 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 2
+ */
+ int (*getDrawableMSC)(__DRIscreen *screen, void *drawablePrivate,
+ int64_t *msc);
};
if ( (gc != NULL) && gc->isDirect ) {
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( gc->currentDpy,
gc->screen );
- if (psc->msc != NULL && psc->driScreen.private != NULL) {
- int ret;
- int64_t temp;
-
- ret = psc->msc->getMSC(&psc->driScreen, &temp);
- *count = (unsigned) temp;
- return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
+ if ( psc->msc && psc->driScreen.private ) {
+ __DRIdrawable * const pdraw =
+ GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
+ int64_t temp;
+ int ret;
+
+ /*
+ * Try to use getDrawableMSC first so we get the right
+ * counter...
+ */
+ if (psc->msc->base.version >= 2 && psc->msc->getDrawableMSC)
+ ret = (*psc->msc->getDrawableMSC)( &psc->driScreen,
+ pdraw->private,
+ & temp);
+ else
+ ret = (*psc->msc->getMSC)( &psc->driScreen, & temp);
+ *count = (unsigned) temp;
+ return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
}
#else
if (psc->msc != NULL && psc->driScreen.private ) {
__DRIdrawable * const pdraw =
GetDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
- if (pdraw != NULL) {
- int ret;
- int64_t msc;
- int64_t sbc;
-
- ret = (*psc->msc->waitForMSC)(pdraw, 0,
- divisor, remainder, &msc, &sbc);
- *count = (unsigned) msc;
- return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
- }
+ int ret;
+ int64_t msc;
+ int64_t sbc;
+
+ ret = (*psc->msc->waitForMSC)(pdraw, 0, divisor, remainder, &msc,
+ &sbc);
+ *count = (unsigned) msc;
+ return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
}
#else
&rect, 1, GL_TRUE);
}
+static int driDrawableGetMSC( __DRIscreen *screen, void *drawablePrivate,
+ int64_t *msc )
+{
+ __DRIscreenPrivate *sPriv = screen->private;
+
+ return sPriv->DriverAPI.GetDrawableMSC( sPriv, drawablePrivate, msc );
+}
+
/**
* Called directly from a number of higher-level GLX functions.
*/
-static int driGetMSC( __DRIscreen *screen, int64_t *msc )
+static int driGetMSC( __DRIscreen *screen, void *drawablePrivate, int64_t *msc )
{
__DRIscreenPrivate *sPriv = screen->private;
{ __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION },
driGetMSC,
driWaitForMSC,
+ driDrawableGetMSC,
};
static void driCopySubBuffer(__DRIdrawable *drawable,
pdp->numBackClipRects = 0;
pdp->pClipRects = NULL;
pdp->pBackClipRects = NULL;
+ pdp->vblSeq = 0;
+ pdp->vblFlags = 0;
psp = (__DRIscreenPrivate *)screen->private;
pdp->driScreenPriv = psp;
pdraw->private = pdp;
pdraw->destroyDrawable = driDestroyDrawable;
pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */
+ pdp->msc_base = 0;
/* This special default value is replaced with the configured
* default value when the drawable is first bound to a direct
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
+
+ /**
+ * New version of GetMSC so we can pass drawable data to the low level
+ * DRM driver (e.g. pipe info).
+ */
+ int (*GetDrawableMSC) ( __DRIscreenPrivate * priv,
+ __DRIdrawablePrivate *drawablePrivate,
+ int64_t *count);
};
drm_clip_rect_t *pBackClipRects;
/*@}*/
+ /**
+ * \name Vertical blank tracking information
+ * Used for waiting on vertical blank events.
+ */
+ /*@{*/
+ unsigned int vblSeq;
+ unsigned int vblFlags;
+ /*@}*/
+
+ /**
+ * \name Monotonic MSC tracking
+ *
+ * Low level driver is responsible for updating msc_base and
+ * vblSeq values so that higher level code can calculate
+ * a new msc value or msc target for a WaitMSC call. The new value
+ * will be:
+ * msc = msc_base + get_vblank_count() - vblank_base;
+ *
+ * And for waiting on a value, core code will use:
+ * actual_target = target_msc - msc_base + vblank_base;
+ */
+ /*@{*/
+ int64_t vblank_base;
+ int64_t msc_base;
+ /*@}*/
+
/**
* Pointer to context to which this drawable is currently bound.
*/
#include "vblank.h"
#include "xmlpool.h"
+static unsigned int msc_to_vblank(__DRIdrawablePrivate * dPriv, int64_t msc)
+{
+ return (unsigned int)(msc - dPriv->msc_base + dPriv->vblank_base);
+}
+
+static int64_t vblank_to_msc(__DRIdrawablePrivate * dPriv, unsigned int vblank)
+{
+ return (int64_t)(vblank - dPriv->vblank_base + dPriv->msc_base);
+}
+
/****************************************************************************/
/**
*
* Stores the 64-bit count of vertical refreshes since some (arbitrary)
* point in time in \c count. Unless the value wraps around, which it
- * may, it will never decrease.
+ * may, it will never decrease for a given drawable.
*
* \warning This function is called from \c glXGetVideoSyncSGI, which expects
* a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which
* currently always returns a \c sequence of type \c unsigned.
*
* \param priv Pointer to the DRI screen private struct.
+ * \param dPriv Pointer to the DRI drawable private struct
* \param count Storage to hold MSC counter.
* \return Zero is returned on success. A negative errno value
* is returned on failure.
*/
-int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count )
+int driDrawableGetMSC32( __DRIscreenPrivate * priv,
+ __DRIdrawablePrivate * dPriv,
+ int64_t * count)
{
drmVBlank vbl;
int ret;
vbl.request.type = DRM_VBLANK_RELATIVE;
vbl.request.sequence = 0;
+ if ( dPriv && dPriv->vblFlags & VBLANK_FLAG_SECONDARY )
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
ret = drmWaitVBlank( priv->fd, &vbl );
- *count = (int64_t)vbl.reply.sequence;
+
+ if (dPriv) {
+ *count = vblank_to_msc(dPriv, vbl.reply.sequence);
+ } else {
+ /* Old driver (no knowledge of drawable MSC callback) */
+ *count = vbl.reply.sequence;
+ }
return ret;
}
+/**
+ * Get the current MSC refresh counter.
+ *
+ * Stores the 64-bit count of vertical refreshes since some (arbitrary)
+ * point in time in \c count. Unless the value wraps around, which it
+ * may, it will never decrease.
+ *
+ * \warning This function is called from \c glXGetVideoSyncSGI, which expects
+ * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which
+ * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl
+ * currently always returns a \c sequence of type \c unsigned.
+ *
+ * Since this function doesn't take a drawable, it may end up getting the MSC
+ * value from a pipe not associated with the caller's context, resuling in
+ * undesired behavior.
+ *
+ * \param priv Pointer to the DRI screen private struct.
+ * \param count Storage to hold MSC counter.
+ * \return Zero is returned on success. A negative errno value
+ * is returned on failure.
+ */
+int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count )
+{
+ return driDrawableGetMSC32(priv, NULL, count);
+}
/****************************************************************************/
/**
*/
vbl.request.type = dont_wait ? DRM_VBLANK_RELATIVE :
DRM_VBLANK_ABSOLUTE;
- vbl.request.sequence = next;
+ vbl.request.sequence = next ? msc_to_vblank(priv, next) : 0;
+ if ( priv->vblFlags & VBLANK_FLAG_SECONDARY )
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) {
/* FIXME: This doesn't seem like the right thing to return here.
return GLX_BAD_CONTEXT;
}
+ *msc = vblank_to_msc(priv, vbl.reply.sequence);
+
dont_wait = 0;
- if (target_msc != 0 && vbl.reply.sequence == target)
+ if (target_msc != 0 && *msc == target)
break;
/* Assuming the wait-done test fails, the next refresh to wait for
* If this refresh has already happened, we add divisor to obtain
* the next refresh after the current one that will satisfy it.
*/
- r = (vbl.reply.sequence % (unsigned int)divisor);
- next = (vbl.reply.sequence - r + (unsigned int)remainder);
- if (next <= vbl.reply.sequence) next += (unsigned int)divisor;
+ r = (*msc % (unsigned int)divisor);
+ next = (*msc - r + (unsigned int)remainder);
+ if (next <= *msc) next += (unsigned int)divisor;
} while ( r != (unsigned int)remainder );
}
*/
vbl.request.type = DRM_VBLANK_ABSOLUTE;
- vbl.request.sequence = target_msc;
+ vbl.request.sequence = target_msc ? msc_to_vblank(priv, target_msc) : 0;
+
+ if ( priv->vblFlags & VBLANK_FLAG_SECONDARY )
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
if ( drmWaitVBlank( priv->driScreenPriv->fd, &vbl ) != 0 ) {
/* FIXME: This doesn't seem like the right thing to return here.
}
}
- *msc = (target_msc & 0xffffffff00000000LL);
- *msc |= vbl.reply.sequence;
+ *msc = vblank_to_msc(priv, vbl.reply.sequence);
+
if ( *msc < target_msc ) {
*msc += 0x0000000100000000LL;
}
* direct rendering context.
*/
-void driDrawableInitVBlank( __DRIdrawablePrivate *priv, GLuint flags,
- GLuint *vbl_seq )
+void driDrawableInitVBlank( __DRIdrawablePrivate *priv )
{
if ( priv->swap_interval == (unsigned)-1 ) {
/* Get current vertical blank sequence */
- drmVBlank vbl = { .request={ .type = DRM_VBLANK_RELATIVE, .sequence = 0 } };
- do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd );
-
- priv->swap_interval = (flags & (VBLANK_FLAG_THROTTLE |
- VBLANK_FLAG_SYNC)) != 0 ? 1 : 0;
+ drmVBlank vbl;
+
+ vbl.request.type = DRM_VBLANK_RELATIVE;
+ if ( priv->vblFlags & VBLANK_FLAG_SECONDARY )
+ vbl.request.type |= DRM_VBLANK_SECONDARY;
+ vbl.request.sequence = 0;
+ do_wait( &vbl, &priv->vblSeq, priv->driScreenPriv->fd );
+ priv->vblank_base = priv->vblSeq;
+
+ priv->swap_interval =
+ (priv->vblFlags & (VBLANK_FLAG_THROTTLE | VBLANK_FLAG_SYNC)) ? 1 : 0;
}
}
*/
extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count );
+extern int driDrawableGetMSC32( __DRIscreenPrivate * priv,
+ __DRIdrawablePrivate * drawablePrivate,
+ int64_t * count);
extern int driWaitForMSC32( __DRIdrawablePrivate *priv,
int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc );
extern GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache );
-extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags,
- GLuint *vbl_seq );
+extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv );
extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate *priv,
GLuint flags );
extern void driGetCurrentVBlank( const __DRIdrawablePrivate *priv,
.UnbindContext = ffbUnbindContext,
.GetSwapInfo = NULL,
.GetMSC = NULL,
+ .GetDrawableMSC = NULL,
.WaitForMSC = NULL,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
.UnbindContext = i810UnbindContext,
.GetSwapInfo = NULL,
.GetMSC = NULL,
+ .GetDrawableMSC = NULL,
.WaitForMSC = NULL,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
.y2 = sarea->planeB_y + sarea->planeB_h };
GLint areaA = driIntersectArea( drw_rect, planeA_rect );
GLint areaB = driIntersectArea( drw_rect, planeB_rect );
- GLuint flags = intel_fb->vblank_flags;
+ GLuint flags = dPriv->vblFlags;
GLboolean pf_active;
GLint pf_planes;
/* Update vblank info
*/
if (areaB > areaA || (areaA == areaB && areaB > 0)) {
- flags = intel_fb->vblank_flags | VBLANK_FLAG_SECONDARY;
+ flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
} else {
- flags = intel_fb->vblank_flags & ~VBLANK_FLAG_SECONDARY;
+ flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
}
- if (flags != intel_fb->vblank_flags && intel_fb->vblank_flags &&
- !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ)) {
+ /* Check to see if we changed pipes */
+ if (flags != dPriv->vblFlags && dPriv->vblFlags &&
+ !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
+ int64_t count;
drmVBlank vbl;
int i;
+ /*
+ * Deal with page flipping
+ */
vbl.request.type = DRM_VBLANK_ABSOLUTE;
- if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) {
vbl.request.type |= DRM_VBLANK_SECONDARY;
}
drmWaitVBlank(intel->driFd, &vbl);
}
- intel_fb->vblank_flags = flags;
- driGetCurrentVBlank(dPriv, intel_fb->vblank_flags, &intel_fb->vbl_seq);
- intel_fb->vbl_waited = intel_fb->vbl_seq;
+ /*
+ * Update msc_base from old pipe
+ */
+ driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count);
+ dPriv->msc_base = count;
+ /*
+ * Then get new vblank_base and vblSeq values
+ */
+ dPriv->vblFlags = flags;
+ driGetCurrentVBlank(dPriv, dPriv->vblFlags, &dPriv->vblSeq);
+ dPriv->vblank_base = dPriv->vblSeq;
+
+ intel_fb->vbl_waited = dPriv->vblSeq;
for (i = 0; i < intel_fb->pf_num_pages; i++) {
if (intel_fb->color_rb[i])
}
}
} else {
- intel_fb->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
+ dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY;
}
/* Update Mesa's notion of window size */
*/
static GLboolean
-intelScheduleSwap(const __DRIdrawablePrivate * dPriv, GLboolean *missed_target)
+intelScheduleSwap(__DRIdrawablePrivate * dPriv, GLboolean *missed_target)
{
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
- unsigned int interval = driGetVBlankInterval(dPriv, intel_fb->vblank_flags);
+ unsigned int interval = driGetVBlankInterval(dPriv, dPriv->vblFlags);
struct intel_context *intel =
intelScreenContext(dPriv->driScreenPriv->private);
const intelScreenPrivate *intelScreen = intel->intelScreen;
drm_i915_vblank_swap_t swap;
GLboolean ret;
- if (!intel_fb->vblank_flags ||
- (intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) ||
+ if (!dPriv->vblFlags ||
+ (dPriv->vblFlags & VBLANK_FLAG_NO_IRQ) ||
intelScreen->current_rotation != 0 ||
intelScreen->drmMinor < (intel_fb->pf_active ? 9 : 6))
return GL_FALSE;
swap.seqtype = DRM_VBLANK_ABSOLUTE;
- if (intel_fb->vblank_flags & VBLANK_FLAG_SYNC) {
+ if (dPriv->vblFlags & VBLANK_FLAG_SYNC) {
swap.seqtype |= DRM_VBLANK_NEXTONMISS;
} else if (interval == 0) {
return GL_FALSE;
}
swap.drawable = dPriv->hHWDrawable;
- target = swap.sequence = intel_fb->vbl_seq + interval;
+ target = swap.sequence = dPriv->vblSeq + interval;
- if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) {
swap.seqtype |= DRM_VBLANK_SECONDARY;
}
if (!drmCommandWriteRead(intel->driFd, DRM_I915_VBLANK_SWAP, &swap,
sizeof(swap))) {
- intel_fb->vbl_seq = swap.sequence;
+ dPriv->vblSeq = swap.sequence;
swap.sequence -= target;
*missed_target = swap.sequence > 0 && swap.sequence <= (1 << 23);
intel_get_renderbuffer(&intel_fb->Base, BUFFER_BACK_LEFT)->vbl_pending =
intel_get_renderbuffer(&intel_fb->Base,
BUFFER_FRONT_LEFT)->vbl_pending =
- intel_fb->vbl_seq;
+ dPriv->vblSeq;
if (swap.seqtype & DRM_VBLANK_FLIP) {
intel_flip_renderbuffers(intel_fb);
if (screen->current_rotation != 0 ||
!intelScheduleSwap(dPriv, &missed_target)) {
- driWaitForVBlank(dPriv, &intel_fb->vbl_seq, intel_fb->vblank_flags,
+ driWaitForVBlank(dPriv, &dPriv->vblSeq, dPriv->vblFlags,
&missed_target);
if (screen->current_rotation != 0 || !intelPageFlip(dPriv)) {
if (driDrawPriv->swap_interval == (unsigned)-1) {
int i;
- intel_fb->vblank_flags = (intel->intelScreen->irq_active != 0)
+ driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
? driGetDefaultVBlankFlags(&intel->optionCache)
: VBLANK_FLAG_NO_IRQ;
(*dri_interface->getUST) (&intel_fb->swap_ust);
- driDrawableInitVBlank(driDrawPriv, intel_fb->vblank_flags,
- &intel_fb->vbl_seq);
- intel_fb->vbl_waited = intel_fb->vbl_seq;
+ driDrawableInitVBlank(driDrawPriv);
+ intel_fb->vbl_waited = driDrawPriv->vblSeq;
for (i = 0; i < (intel->intelScreen->third.handle ? 3 : 2); i++) {
if (intel_fb->color_rb[i])
- intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_seq;
+ intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq;
}
}
intel->driDrawable = driDrawPriv;
*/
void LOCK_HARDWARE( struct intel_context *intel )
{
+ __DRIdrawablePrivate *dPriv = intel->driDrawable;
char __ret=0;
struct intel_framebuffer *intel_fb = NULL;
struct intel_renderbuffer *intel_rb = NULL;
BUFFER_BACK_LEFT);
}
- if (intel_rb && intel_fb->vblank_flags &&
- !(intel_fb->vblank_flags & VBLANK_FLAG_NO_IRQ) &&
+ if (intel_rb && dPriv->vblFlags &&
+ !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ) &&
(intel_fb->vbl_waited - intel_rb->vbl_pending) > (1<<23)) {
drmVBlank vbl;
vbl.request.type = DRM_VBLANK_ABSOLUTE;
- if ( intel_fb->vblank_flags & VBLANK_FLAG_SECONDARY ) {
+ if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) {
vbl.request.type |= DRM_VBLANK_SECONDARY;
}
/* VBI
*/
- GLuint vbl_seq;
- GLuint vblank_flags;
GLuint vbl_waited;
int64_t swap_ust;
.UnbindContext = intelUnbindContext,
.GetSwapInfo = intelGetSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
if (!rect)
{
UNLOCK_HARDWARE( intel );
- driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target );
+ driWaitForVBlank( dPriv, &dPriv->vblSeq, dPriv->vblFlags,
+ &missed_target );
LOCK_HARDWARE( intel );
}
#include "context.h"
#include "framebuffer.h"
#include "macros.h"
+#include "utils.h"
+#include "vblank.h"
#include "swrast/swrast.h"
GLboolean intel_intersect_cliprects( drm_clip_rect_t *dst,
}
}
+ /* Get updated plane info so we sync against the right vblank counter */
+ if (intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) {
+ drmI830Sarea *sarea = intel->sarea;
+ drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w,
+ .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h };
+ drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y,
+ .x2 = sarea->planeA_x + sarea->planeA_w,
+ .y2 = sarea->planeA_y + sarea->planeA_h };
+ drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y,
+ .x2 = sarea->planeB_x + sarea->planeB_w,
+ .y2 = sarea->planeB_y + sarea->planeB_h };
+ GLint areaA = driIntersectArea( drw_rect, planeA_rect );
+ GLint areaB = driIntersectArea( drw_rect, planeB_rect );
+ GLuint flags = dPriv->vblFlags;
+
+ /* Update vblank info
+ */
+ if (areaB > areaA || (areaA == areaB && areaB > 0)) {
+ flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY;
+ } else {
+ flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY;
+ }
+
+ /* Check to see if we changed pipes */
+ if (flags != dPriv->vblFlags && dPriv->vblFlags &&
+ !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) {
+ int64_t count;
+
+ /*
+ * Update msc_base from old pipe
+ */
+ driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count);
+ dPriv->msc_base = count;
+ /*
+ * Then get new vblank_base and vblSeq values
+ */
+ dPriv->vblFlags = flags;
+ driGetCurrentVBlank(dPriv, dPriv->vblFlags, &dPriv->vblSeq);
+ dPriv->vblank_base = dPriv->vblSeq;
+ }
+ } else {
+ dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY;
+ }
+
_mesa_resize_framebuffer(&intel->ctx,
(GLframebuffer*)dPriv->driverPrivate,
dPriv->w, dPriv->h);
GLcontext *shareCtx = (GLcontext *) sharedContextPrivate;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
intelScreenPrivate *intelScreen = (intelScreenPrivate *)sPriv->private;
- volatile drmI830Sarea *saPriv = (volatile drmI830Sarea *)
- (((GLubyte *)sPriv->pSAREA)+intelScreen->sarea_priv_offset);
+ volatile drmI830Sarea *saPriv = (drmI830Sarea *)
+ (((GLubyte *)sPriv->pSAREA)+intelScreen->sarea_priv_offset);
if (!_mesa_initialize_context(&intel->ctx,
mesaVis, shareCtx,
driParseConfigFiles (&intel->optionCache, &intelScreen->optionCache,
intel->driScreen->myNum, "i965");
- intel->vblank_flags = (intel->intelScreen->irq_active != 0)
- ? driGetDefaultVBlankFlags(&intel->optionCache) : VBLANK_FLAG_NO_IRQ;
-
ctx->Const.MaxTextureMaxAnisotropy = 2.0;
if (getenv("INTEL_STRICT_CONFORMANCE")) {
if (driContextPriv) {
struct intel_context *intel = (struct intel_context *) driContextPriv->driverPrivate;
+ driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0)
+ ? driGetDefaultVBlankFlags(&intel->optionCache) : VBLANK_FLAG_NO_IRQ;
+
+
if (intel->driReadDrawable != driReadPriv) {
intel->driReadDrawable = driReadPriv;
}
if ( intel->driDrawable != driDrawPriv ) {
- /* Shouldn't the readbuffer be stored also? */
- driDrawableInitVBlank( driDrawPriv, intel->vblank_flags,
- &intel->vbl_seq );
-
intel->driDrawable = driDrawPriv;
intelWindowMoved( intel );
+ /* Shouldn't the readbuffer be stored also? */
+ driDrawableInitVBlank( driDrawPriv );
}
_mesa_make_current(&intel->ctx,
*/
driOptionCache optionCache;
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
int64_t swap_ust;
int64_t swap_missed_ust;
.UnbindContext = intelUnbindContext,
.GetSwapInfo = intelGetSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
{
GLcontext *ctx, *shareCtx;
__DRIscreenPrivate *driScreen = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
struct dd_function_table functions;
mach64ContextPtr mmesa;
mach64ScreenPtr mach64Screen;
mmesa->do_irqs = (mmesa->mach64Screen->irq && !getenv("MACH64_NO_IRQS"));
- mmesa->vblank_flags = (mmesa->do_irqs)
+ dPriv->vblFlags = (mmesa->do_irqs)
? driGetDefaultVBlankFlags(&mmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
driContextPriv->driverPrivate = (void *)mmesa;
}
- driDrawableInitVBlank( driDrawPriv, newMach64Ctx->vblank_flags,
- &newMach64Ctx->vbl_seq );
+ driDrawableInitVBlank( driDrawPriv );
if ( newMach64Ctx->driDrawable != driDrawPriv ) {
newMach64Ctx->driDrawable = driDrawPriv;
/* VBI
*/
- GLuint vbl_seq;
- GLuint vblank_flags;
GLuint do_irqs;
/* Configuration cache
/* Copy the back color buffer to the front color buffer.
*/
-void mach64CopyBuffer( const __DRIdrawablePrivate *dPriv )
+void mach64CopyBuffer( __DRIdrawablePrivate *dPriv )
{
mach64ContextPtr mmesa;
GLint nbox, i, ret;
#endif
UNLOCK_HARDWARE( mmesa );
- driWaitForVBlank( dPriv, &mmesa->vbl_seq, mmesa->vblank_flags, &missed_target );
+ driWaitForVBlank( dPriv, &dPriv->vblSeq, dPriv->vblFlags, &missed_target );
LOCK_HARDWARE( mmesa );
/* use front buffer cliprects */
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height );
-extern void mach64CopyBuffer( const __DRIdrawablePrivate *dPriv );
+extern void mach64CopyBuffer( __DRIdrawablePrivate *dPriv );
#if ENABLE_PERF_BOXES
extern void mach64PerformanceCounters( mach64ContextPtr mmesa );
extern void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa );
.UnbindContext = mach64UnbindContext,
.GetSwapInfo = NULL,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
GLcontext *ctx, *shareCtx;
mgaContextPtr mmesa;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
mgaScreenPrivate *mgaScreen = (mgaScreenPrivate *)sPriv->private;
drm_mga_sarea_t *saPriv = (drm_mga_sarea_t *)(((char*)sPriv->pSAREA)+
mgaScreen->sarea_priv_offset);
debug_control );
#endif
- mmesa->vblank_flags = (mmesa->mgaScreen->irq == 0)
+ dPriv->vblFlags = (mmesa->mgaScreen->irq == 0)
? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache);
(*dri_interface->getUST)( & mmesa->swap_ust );
mgaContextPtr mmesa = (mgaContextPtr) driContextPriv->driverPrivate;
if (mmesa->driDrawable != driDrawPriv) {
- driDrawableInitVBlank( driDrawPriv, mmesa->vblank_flags,
- &mmesa->vbl_seq );
+ driDrawableInitVBlank( driDrawPriv );
+
mmesa->driDrawable = driDrawPriv;
mmesa->dirty = ~0;
mmesa->dirty_cliprects = (MGA_FRONT|MGA_BACK);
.UnbindContext = mgaUnbindContext,
.GetSwapInfo = getSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
drmBufPtr vertex_dma_buffer;
drmBufPtr iload_buffer;
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
int64_t swap_ust;
int64_t swap_missed_ust;
FLUSH_BATCH( mmesa );
mgaWaitForFrameCompletion( mmesa );
- driWaitForVBlank( dPriv, & mmesa->vbl_seq, mmesa->vblank_flags,
- & missed_target );
+ driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags, & missed_target );
if ( missed_target ) {
mmesa->swap_missed_count++;
(void) (*dri_interface->getUST)( & mmesa->swap_missed_ust );
struct gl_framebuffer *read_fb =
(struct gl_framebuffer*)driReadPriv->driverPrivate;
- driDrawableInitVBlank(driDrawPriv, nmesa->vblank_flags, &nmesa->vblank_seq );
+ driDrawableInitVBlank(driDrawPriv);
nmesa->driDrawable = driDrawPriv;
_mesa_resize_framebuffer(nmesa->glCtx, draw_fb,
/* Configuration cache */
driOptionCache optionCache;
- /* vblank stuff */
- uint32_t vblank_flags;
- uint32_t vblank_seq;
-
GLuint new_state;
GLuint new_render_state;
GLuint render_index;
.UnbindContext = nouveauUnbindContext,
.GetSwapInfo = nouveauGetSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
{
GLcontext *ctx, *shareCtx;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
struct dd_function_table functions;
r128ContextPtr rmesa;
r128ScreenPtr r128scrn;
r128DDInitSpanFuncs( ctx );
r128DDInitState( rmesa );
- rmesa->vblank_flags = (rmesa->r128Screen->irq != 0)
+ dPriv->vblFlags = (rmesa->r128Screen->irq != 0)
? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
driContextPriv->driverPrivate = (void *)rmesa;
newR128Ctx->dirty = R128_UPLOAD_ALL;
}
- driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags,
- &newR128Ctx->vbl_seq );
+ driDrawableInitVBlank( driDrawPriv );
newR128Ctx->driDrawable = driDrawPriv;
_mesa_make_current( newR128Ctx->glCtx,
GLuint c_textureBytes;
GLuint c_vertexBuffers;
- /* VBI
- */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
/* Configuration cache
*/
driOptionCache optionCache;
/* Copy the back color buffer to the front color buffer.
*/
-void r128CopyBuffer( const __DRIdrawablePrivate *dPriv )
+void r128CopyBuffer( __DRIdrawablePrivate *dPriv )
{
r128ContextPtr rmesa;
GLint nbox, i, ret;
}
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target );
+ driWaitForVBlank( dPriv, &dPriv->vblSeq, dPriv->vblFlags, &missed_target );
LOCK_HARDWARE( rmesa );
nbox = dPriv->numClipRects; /* must be in locked region */
#endif
}
-void r128PageFlip( const __DRIdrawablePrivate *dPriv )
+void r128PageFlip( __DRIdrawablePrivate *dPriv )
{
r128ContextPtr rmesa;
GLint ret;
}
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, &rmesa->vbl_seq, rmesa->vblank_flags, &missed_target );
+ driWaitForVBlank( dPriv, &dPriv->vblSeq, dPriv->vblFlags, &missed_target );
LOCK_HARDWARE( rmesa );
/* The kernel will have been initialized to perform page flipping
extern void r128ReadDepthPixelsLocked( r128ContextPtr rmesa, GLuint n,
const GLint x[], const GLint y[] );
-extern void r128CopyBuffer( const __DRIdrawablePrivate *dPriv );
-extern void r128PageFlip( const __DRIdrawablePrivate *dPriv );
+extern void r128CopyBuffer( __DRIdrawablePrivate *dPriv );
+extern void r128PageFlip( __DRIdrawablePrivate *dPriv );
void r128WaitForVBlank( r128ContextPtr rmesa );
extern void r128WaitForIdleLocked( r128ContextPtr rmesa );
.UnbindContext = r128UnbindContext,
.GetSwapInfo = NULL,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
void *sharedContextPrivate)
{
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
radeonScreenPtr screen = (radeonScreenPtr)(sPriv->private);
struct dd_function_table functions;
r200ContextPtr rmesa;
fthrottle_mode,
rmesa->r200Screen->irq);
- rmesa->vblank_flags = (rmesa->r200Screen->irq != 0)
+ dPriv->vblFlags = (rmesa->r200Screen->irq != 0)
? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
rmesa->prefer_gart_client_texturing =
fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
if ( newCtx->dri.drawable != driDrawPriv ) {
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
- &newCtx->vbl_seq );
+ driDrawableInitVBlank( driDrawPriv );
}
newCtx->dri.readable = driReadPriv;
GLuint TexGenCompSel;
GLmatrix tmpmat;
- /* VBI / buffer swap
+ /* buffer swap
*/
- GLuint vbl_seq;
- GLuint vblank_flags;
-
int64_t swap_ust;
int64_t swap_missed_ust;
/* Copy the back color buffer to the front color buffer.
*/
-void r200CopyBuffer( const __DRIdrawablePrivate *dPriv,
+void r200CopyBuffer( __DRIdrawablePrivate *dPriv,
const drm_clip_rect_t *rect)
{
r200ContextPtr rmesa;
if (!rect)
{
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
+ driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags, & missed_target );
LOCK_HARDWARE( rmesa );
}
}
}
-void r200PageFlip( const __DRIdrawablePrivate *dPriv )
+void r200PageFlip( __DRIdrawablePrivate *dPriv )
{
r200ContextPtr rmesa;
GLint ret;
*/
r200WaitForFrameCompletion( rmesa );
UNLOCK_HARDWARE( rmesa );
- driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
+ driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
(void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
struct r200_dma_region *region,
const char *caller );
-extern void r200CopyBuffer( const __DRIdrawablePrivate *drawable,
+extern void r200CopyBuffer( __DRIdrawablePrivate *drawable,
const drm_clip_rect_t *rect);
-extern void r200PageFlip( const __DRIdrawablePrivate *drawable );
+extern void r200PageFlip( __DRIdrawablePrivate *drawable );
extern void r200Flush( GLcontext *ctx );
extern void r200Finish( GLcontext *ctx );
extern void r200WaitForIdleLocked( r200ContextPtr rmesa );
void *sharedContextPrivate)
{
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
GLcontext* ctx;
GLcontext* shareCtx;
radeon->do_usleeps ? "usleeps" : "busy waits",
fthrottle_mode, radeon->radeonScreen->irq);
- radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
+ dPriv->vblFlags = (radeon->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ;
(*dri_interface->getUST) (&radeon->swap_ust);
radeon->glCtx);
if (radeon->dri.drawable != driDrawPriv) {
- driDrawableInitVBlank(driDrawPriv,
- radeon->vblank_flags,
- &radeon->vbl_seq);
+ driDrawableInitVBlank(driDrawPriv);
}
radeon->dri.readable = driReadPriv;
GLuint irqsEmitted;
drm_radeon_irq_wait_t iw;
- /* VBI / buffer swap */
- GLuint vbl_seq;
- GLuint vblank_flags;
-
+ /* buffer swap */
int64_t swap_ust;
int64_t swap_missed_ust;
/* Copy the back color buffer to the front color buffer.
*/
-void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv,
+void radeonCopyBuffer(__DRIdrawablePrivate * dPriv,
const drm_clip_rect_t * rect)
{
radeonContextPtr radeon;
if (!rect)
{
UNLOCK_HARDWARE(radeon);
- driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags,
+ driWaitForVBlank(dPriv, &dPriv->vblSeq, dPriv->vblFlags,
&missed_target);
LOCK_HARDWARE(radeon);
}
}
}
-void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
+void radeonPageFlip(__DRIdrawablePrivate * dPriv)
{
radeonContextPtr radeon;
GLint ret;
*/
radeonWaitForFrameCompletion(radeon);
UNLOCK_HARDWARE(radeon);
- driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags,
+ driWaitForVBlank(dPriv, &dPriv->vblSeq, dPriv->vblFlags,
&missed_target);
if (missed_target) {
radeon->swap_missed_count++;
#endif
#include "radeon_drm.h"
-extern void radeonCopyBuffer(const __DRIdrawablePrivate * drawable,
+extern void radeonCopyBuffer(__DRIdrawablePrivate * drawable,
const drm_clip_rect_t * rect);
-extern void radeonPageFlip(const __DRIdrawablePrivate * drawable);
+extern void radeonPageFlip(__DRIdrawablePrivate * drawable);
extern void radeonFlush(GLcontext * ctx);
extern void radeonFinish(GLcontext * ctx);
extern void radeonWaitForIdleLocked(radeonContextPtr radeon);
if ( newCtx->dri.drawable != driDrawPriv ) {
/* XXX we may need to validate the drawable here!!! */
- driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
- &newCtx->vbl_seq );
+ driDrawableInitVBlank( driDrawPriv );
}
newCtx->dri.readable = driReadPriv;
.UnbindContext = radeonUnbindContext,
.GetSwapInfo = getSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
.UnbindContext = r200UnbindContext,
.GetSwapInfo = getSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL,
.UnbindContext = sisUnbindContext,
.GetSwapInfo = NULL,
.GetMSC = NULL,
+ .GetDrawableMSC = NULL,
.WaitForMSC = NULL,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
.UnbindContext = tdfxUnbindContext,
.GetSwapInfo = NULL,
.GetMSC = NULL,
+ .GetDrawableMSC = NULL,
.WaitForMSC = NULL,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL
GLcontext *ctx, *shareCtx;
struct via_context *vmesa;
__DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+ __DRIdrawablePrivate *dPriv = driContextPriv->driDrawablePriv;
viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
drm_via_sarea_t *saPriv = (drm_via_sarea_t *)
(((GLubyte *)sPriv->pSAREA) + viaScreen->sareaPrivOffset);
driQueryOptionb(&vmesa->optionCache, "no_rast"))
FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1);
- vmesa->vblank_flags =
+ dPriv->vblFlags =
vmesa->viaScreen->irqEnabled ?
driGetDefaultVBlankFlags(&vmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
if (vmesa->driDrawable != driDrawPriv) {
- driDrawableInitVBlank(driDrawPriv, vmesa->vblank_flags,
- &vmesa->vbl_seq);
+ driDrawableInitVBlank(driDrawPriv);
}
if ((vmesa->driDrawable != driDrawPriv)
*/
driOptionCache optionCache;
- GLuint vblank_flags;
- GLuint vbl_seq;
-
int64_t swap_ust;
int64_t swap_missed_ust;
* except that WAIT_IDLE() will spin the CPU polling, while this is
* IRQ driven.
*/
-static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv,
+static void viaWaitIdleVBlank( __DRIdrawablePrivate *dPriv,
struct via_context *vmesa,
GLuint value )
{
vmesa->thrashing)
viaSwapOutWork(vmesa);
- driWaitForVBlank( dPriv, & vmesa->vbl_seq,
- vmesa->vblank_flags, & missed_target );
+ driWaitForVBlank( dPriv, & dPriv->vblSeq, dPriv->vblFlags,
+ & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
(*dri_interface->getUST)( &vmesa->swap_missed_ust );
/*
* Copy the back buffer to the front buffer.
*/
-void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
+void viaCopyBuffer(__DRIdrawablePrivate *dPriv)
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
VIA_FLUSH_DMA(vmesa);
- if (vmesa->vblank_flags == VBLANK_FLAG_SYNC &&
+ if (dPriv->vblFlags == VBLANK_FLAG_SYNC &&
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite-1);
else
}
-void viaPageFlip(const __DRIdrawablePrivate *dPriv)
+void viaPageFlip(__DRIdrawablePrivate *dPriv)
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
struct via_renderbuffer buffer_tmp;
VIA_FLUSH_DMA(vmesa);
- if (vmesa->vblank_flags == VBLANK_FLAG_SYNC &&
+ if (dPriv->vblFlags == VBLANK_FLAG_SYNC &&
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite - 1);
else
void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags);
void viaInitIoctlFuncs(GLcontext *ctx);
-void viaCopyBuffer(const __DRIdrawablePrivate *dpriv);
-void viaPageFlip(const __DRIdrawablePrivate *dpriv);
+void viaCopyBuffer(__DRIdrawablePrivate *dpriv);
+void viaPageFlip(__DRIdrawablePrivate *dpriv);
void viaCheckDma(struct via_context *vmesa, GLuint bytes);
void viaResetPageFlippingLocked(struct via_context *vmesa);
void viaWaitIdle(struct via_context *vmesa, GLboolean light);
.UnbindContext = viaUnbindContext,
.GetSwapInfo = getSwapInfo,
.GetMSC = driGetMSC32,
+ .GetDrawableMSC = driDrawableGetMSC32,
.WaitForMSC = driWaitForMSC32,
.WaitForSBC = NULL,
.SwapBuffersMSC = NULL