Add helper function that returns the current vblank sequence of a drawable.
authorMichel Dänzer <michel@daenzer.net>
Thu, 28 Sep 2006 14:09:20 +0000 (14:09 +0000)
committerMichel Dänzer <michel@daenzer.net>
Thu, 28 Sep 2006 14:09:20 +0000 (14:09 +0000)
src/mesa/drivers/dri/common/vblank.c
src/mesa/drivers/dri/common/vblank.h

index 9c219ea37d8ebc6bba06636d7d63f64af3888202..e7ed545f13c87a41913d38894d5732e4202e5058 100644 (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.
index 00f0e7506f4c3d2a1d61a59d6a2356243c6ccd8b..ec83adc78dd1e98efeed9c24d6852215a0f1537d 100644 (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 );