driWaitForVBlank: Add support for secondary vertical blank.
authorMichel Dänzer <michel@daenzer.net>
Thu, 28 Sep 2006 14:03:41 +0000 (14:03 +0000)
committerMichel Dänzer <michel@daenzer.net>
Thu, 28 Sep 2006 14:03:41 +0000 (14:03 +0000)
src/mesa/drivers/dri/common/vblank.c
src/mesa/drivers/dri/common/vblank.h

index c7c7b82..2ec3c12 100644 (file)
@@ -326,9 +326,12 @@ driWaitForVBlank( const  __DRIdrawablePrivate *priv, GLuint * vbl_seq,
 
    deadline = original_seq + interval;
 
-   vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0;
    vbl.request.type = DRM_VBLANK_RELATIVE;
-      
+   if ( flags & VBLANK_FLAG_SECONDARY ) {
+      vbl.request.type |= DRM_VBLANK_SECONDARY;
+   }
+   vbl.request.sequence = ((flags & VBLANK_FLAG_SYNC) != 0) ? 1 : 0;
+
    if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) {
       return -1;
    }
@@ -343,6 +346,9 @@ driWaitForVBlank( const  __DRIdrawablePrivate *priv, GLuint * vbl_seq,
 
    /* Wait until the target vertical blank. */
    vbl.request.type = DRM_VBLANK_ABSOLUTE;
+   if ( flags & VBLANK_FLAG_SECONDARY ) {
+      vbl.request.type |= DRM_VBLANK_SECONDARY;
+   }
    vbl.request.sequence = deadline;
 
    if ( do_wait( & vbl, vbl_seq, priv->driScreenPriv->fd ) != 0 ) {
index 2663956..ca386a6 100644 (file)
@@ -42,6 +42,8 @@
                                          */
 #define VBLANK_FLAG_NO_IRQ    (1U << 7)  /* DRM has no IRQ to wait on.
                                          */
+#define VBLANK_FLAG_SECONDARY (1U << 8)  /* Wait for secondary vblank.
+                                         */
 
 extern int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count );
 extern int driWaitForMSC32( __DRIdrawablePrivate *priv,