Add helper function that returns the current vblank sequence of a drawable.

This commit is contained in:
Michel Dänzer 2006-09-28 14:09:20 +00:00
parent 638ece315f
commit ebc879014c
2 changed files with 23 additions and 0 deletions

View file

@ -290,6 +290,27 @@ driGetVBlankInterval( const __DRIdrawablePrivate *priv, GLuint flags )
}
/****************************************************************************/
/**
* Returns the current vertical blank sequence number of the given drawable.
*/
void
driGetCurrentVBlank( const __DRIdrawablePrivate *priv, GLuint flags,
GLuint *vbl_seq )
{
drmVBlank vbl;
vbl.request.type = DRM_VBLANK_RELATIVE;
if ( flags & VBLANK_FLAG_SECONDARY ) {
vbl.request.type |= DRM_VBLANK_SECONDARY;
}
vbl.request.sequence = 0;
(void) do_wait( &vbl, vbl_seq, priv->driScreenPriv->fd );
}
/****************************************************************************/
/**
* Waits for the vertical blank for use with glXSwapBuffers.

View file

@ -53,6 +53,8 @@ extern void driDrawableInitVBlank ( __DRIdrawablePrivate *priv, GLuint flags,
GLuint *vbl_seq );
extern unsigned driGetVBlankInterval( const __DRIdrawablePrivate *priv,
GLuint flags );
extern void driGetCurrentVBlank( const __DRIdrawablePrivate *priv,
GLuint flags, GLuint *vbl_seq );
extern int driWaitForVBlank( const __DRIdrawablePrivate *priv,
GLuint * vbl_seq, GLuint flags, GLboolean * missed_deadline );