don't inflate relative vblank sequence numbers on repeated calls (e.g. when
authorMichel Daenzer <michel@daenzer.net>
Sun, 2 Feb 2003 03:06:47 +0000 (03:06 +0000)
committerMichel Daenzer <michel@daenzer.net>
Sun, 2 Feb 2003 03:06:47 +0000 (03:06 +0000)
    interrupted by a signal)

bsd-core/drm_dma.c
bsd/drm_dma.h
libdrm/xf86drm.c
linux-core/drm_dma.c
linux/drm_dma.h

index 69c66c9..0f0dd4f 100644 (file)
@@ -619,6 +619,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
 
        if (vblwait.request.type & _DRM_VBLANK_RELATIVE) {
                vblwait.request.sequence += atomic_read(&dev->vbl_received);
+               vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
        }
 
        flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
index 69c66c9..0f0dd4f 100644 (file)
@@ -619,6 +619,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
 
        if (vblwait.request.type & _DRM_VBLANK_RELATIVE) {
                vblwait.request.sequence += atomic_read(&dev->vbl_received);
+               vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
        }
 
        flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
index 6c83066..d250365 100644 (file)
@@ -1105,6 +1105,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
 
     do {
        ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
+       vbl->request.type &= ~DRM_VBLANK_RELATIVE;
     } while (ret && errno == EINTR);
 
     return ret;
index 33af34b..df4ed80 100644 (file)
@@ -628,6 +628,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
        switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
        case _DRM_VBLANK_RELATIVE:
                vblwait.request.sequence += atomic_read( &dev->vbl_received );
+               vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
        case _DRM_VBLANK_ABSOLUTE:
                break;
        default:
index 33af34b..df4ed80 100644 (file)
@@ -628,6 +628,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
        switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
        case _DRM_VBLANK_RELATIVE:
                vblwait.request.sequence += atomic_read( &dev->vbl_received );
+               vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
        case _DRM_VBLANK_ABSOLUTE:
                break;
        default: