From: Michel Daenzer Date: Sun, 2 Feb 2003 03:06:47 +0000 (+0000) Subject: don't inflate relative vblank sequence numbers on repeated calls (e.g. when X-Git-Tag: submit/1.0/20121108.012404~2429 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7d471b6ae936127311a816a8d15b4565746af48;p=profile%2Fivi%2Flibdrm.git don't inflate relative vblank sequence numbers on repeated calls (e.g. when interrupted by a signal) --- diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index 69c66c9..0f0dd4f 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -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; diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h index 69c66c9..0f0dd4f 100644 --- a/bsd/drm_dma.h +++ b/bsd/drm_dma.h @@ -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; diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 6c83066..d250365 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -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; diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c index 33af34b..df4ed80 100644 --- a/linux-core/drm_dma.c +++ b/linux-core/drm_dma.c @@ -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: diff --git a/linux/drm_dma.h b/linux/drm_dma.h index 33af34b..df4ed80 100644 --- a/linux/drm_dma.h +++ b/linux/drm_dma.h @@ -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: