summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2006-09-28 14:09:20 +0000
committerMichel Dänzer <michel@daenzer.net>2006-09-28 14:09:20 +0000
commitebc879014c8b3cba1db69f2d8f9006cc031ba350 (patch)
tree380d90561679b2b20643b38d47e9ddcb091d9c57 /src/mesa
parent638ece315f4ee7be7f0fe0a0acd2550b4ccb8a7d (diff)
Add helper function that returns the current vblank sequence of a drawable.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/common/vblank.c21
-rw-r--r--src/mesa/drivers/dri/common/vblank.h2
2 files changed, 23 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
diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h
index 00f0e7506f..ec83adc78d 100644
--- a/src/mesa/drivers/dri/common/vblank.h
+++ b/src/mesa/drivers/dri/common/vblank.h
@@ -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 );