summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/vblank.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/common/vblank.c')
-rw-r--r--src/mesa/drivers/dri/common/vblank.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c
index 9c219ea37d..e7ed545f13 100644
--- a/src/mesa/drivers/dri/common/vblank.c
+++ b/src/mesa/drivers/dri/common/vblank.c
@@ -292,6 +292,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.
*
* \param vbl_seq Vertical blank sequence number (MSC) after the last buffer