diff options
author | Michel Daenzer <michel@daenzer.net> | 2002-09-26 12:49:18 +0000 |
---|---|---|
committer | Michel Daenzer <michel@daenzer.net> | 2002-09-26 12:49:18 +0000 |
commit | cc9a169d08c00975f623d717737b499defb4938e (patch) | |
tree | 6c3a77623555cd48ec7507e6f6dc390aee45c9a5 | |
parent | 97961e2c65773328fe9c2e1d66e4a0b8a253d54d (diff) |
DRM(vblank_wait) is driver specific
-rw-r--r-- | linux-core/drm_dma.c | 38 | ||||
-rw-r--r-- | linux/drm_dma.h | 38 | ||||
-rw-r--r-- | shared-core/radeon_irq.c | 39 | ||||
-rw-r--r-- | shared/radeon_irq.c | 39 |
4 files changed, 78 insertions, 76 deletions
diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c index 2938c77a..dc041592 100644 --- a/linux-core/drm_dma.c +++ b/linux-core/drm_dma.c @@ -604,44 +604,6 @@ int DRM(control)( struct inode *inode, struct file *filp, #if __HAVE_VBL_IRQ -int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *)dev->dev_private; - unsigned int cur_vblank; - int ret = 0; - - if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __func__ ); - return DRM_ERR(EINVAL); - } - - /* Assume that the user has missed the current sequence number by about - * a day rather than she wants to wait for years using vertical blanks :) - */ - while ( ( ( cur_vblank = atomic_read(&dev->vbl_received ) ) - + ~*sequence + 1 ) > (1<<23) ) { - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; -#ifdef __linux__ - interruptible_sleep_on( &dev->vbl_queue ); - - if (signal_pending(current)) { - ret = -EINTR; - break; - } -#endif /* __linux__ */ -#ifdef __FreeBSD__ - ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH); - if (ret) - break; -#endif /* __FreeBSD__ */ - } - - *sequence = cur_vblank; - - return ret; -} - int DRM(wait_vblank)( DRM_IOCTL_ARGS ) { drm_file_t *priv = filp->private_data; diff --git a/linux/drm_dma.h b/linux/drm_dma.h index 2938c77a..dc041592 100644 --- a/linux/drm_dma.h +++ b/linux/drm_dma.h @@ -604,44 +604,6 @@ int DRM(control)( struct inode *inode, struct file *filp, #if __HAVE_VBL_IRQ -int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_private_t *)dev->dev_private; - unsigned int cur_vblank; - int ret = 0; - - if ( !dev_priv ) { - DRM_ERROR( "%s called with no initialization\n", __func__ ); - return DRM_ERR(EINVAL); - } - - /* Assume that the user has missed the current sequence number by about - * a day rather than she wants to wait for years using vertical blanks :) - */ - while ( ( ( cur_vblank = atomic_read(&dev->vbl_received ) ) - + ~*sequence + 1 ) > (1<<23) ) { - dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; -#ifdef __linux__ - interruptible_sleep_on( &dev->vbl_queue ); - - if (signal_pending(current)) { - ret = -EINTR; - break; - } -#endif /* __linux__ */ -#ifdef __FreeBSD__ - ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH); - if (ret) - break; -#endif /* __FreeBSD__ */ - } - - *sequence = cur_vblank; - - return ret; -} - int DRM(wait_vblank)( DRM_IOCTL_ARGS ) { drm_file_t *priv = filp->private_data; diff --git a/shared-core/radeon_irq.c b/shared-core/radeon_irq.c index 7b170389..d652f1d2 100644 --- a/shared-core/radeon_irq.c +++ b/shared-core/radeon_irq.c @@ -163,6 +163,45 @@ int radeon_emit_and_wait_irq(drm_device_t *dev) } +int radeon_vblank_wait(drm_device_t *dev, unsigned int *sequence) +{ + drm_radeon_private_t *dev_priv = + (drm_radeon_private_t *)dev->dev_private; + unsigned int cur_vblank; + int ret = 0; + + if ( !dev_priv ) { + DRM_ERROR( "%s called with no initialization\n", __func__ ); + return DRM_ERR(EINVAL); + } + + /* Assume that the user has missed the current sequence number by about + * a day rather than she wants to wait for years using vertical blanks :) + */ + while ( ( ( cur_vblank = atomic_read(&dev->vbl_received ) ) + + ~*sequence + 1 ) > (1<<23) ) { + dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; +#ifdef __linux__ + interruptible_sleep_on( &dev->vbl_queue ); + + if (signal_pending(current)) { + ret = -EINTR; + break; + } +#endif /* __linux__ */ +#ifdef __FreeBSD__ + ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH); + if (ret) + break; +#endif /* __FreeBSD__ */ + } + + *sequence = cur_vblank; + + return ret; +} + + /* Needs the lock as it touches the ring. */ int radeon_irq_emit( DRM_IOCTL_ARGS ) diff --git a/shared/radeon_irq.c b/shared/radeon_irq.c index 7b170389..d652f1d2 100644 --- a/shared/radeon_irq.c +++ b/shared/radeon_irq.c @@ -163,6 +163,45 @@ int radeon_emit_and_wait_irq(drm_device_t *dev) } +int radeon_vblank_wait(drm_device_t *dev, unsigned int *sequence) +{ + drm_radeon_private_t *dev_priv = + (drm_radeon_private_t *)dev->dev_private; + unsigned int cur_vblank; + int ret = 0; + + if ( !dev_priv ) { + DRM_ERROR( "%s called with no initialization\n", __func__ ); + return DRM_ERR(EINVAL); + } + + /* Assume that the user has missed the current sequence number by about + * a day rather than she wants to wait for years using vertical blanks :) + */ + while ( ( ( cur_vblank = atomic_read(&dev->vbl_received ) ) + + ~*sequence + 1 ) > (1<<23) ) { + dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; +#ifdef __linux__ + interruptible_sleep_on( &dev->vbl_queue ); + + if (signal_pending(current)) { + ret = -EINTR; + break; + } +#endif /* __linux__ */ +#ifdef __FreeBSD__ + ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH); + if (ret) + break; +#endif /* __FreeBSD__ */ + } + + *sequence = cur_vblank; + + return ret; +} + + /* Needs the lock as it touches the ring. */ int radeon_irq_emit( DRM_IOCTL_ARGS ) |