Fix up BSD irq handling.
parent
ec48dfa835
commit
e6901cad69
|
@ -598,26 +598,6 @@ int DRM(control)( DRM_IOCTL_ARGS )
|
||||||
|
|
||||||
#if __HAVE_VBL_IRQ
|
#if __HAVE_VBL_IRQ
|
||||||
|
|
||||||
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
|
|
||||||
{
|
|
||||||
unsigned int cur_vblank;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* 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) ) {
|
|
||||||
ret = tsleep( &dev->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
|
||||||
if (ret)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
*sequence = cur_vblank;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DRM(wait_vblank)( DRM_IOCTL_ARGS )
|
int DRM(wait_vblank)( DRM_IOCTL_ARGS )
|
||||||
{
|
{
|
||||||
DRM_DEVICE;
|
DRM_DEVICE;
|
||||||
|
|
|
@ -598,26 +598,6 @@ int DRM(control)( DRM_IOCTL_ARGS )
|
||||||
|
|
||||||
#if __HAVE_VBL_IRQ
|
#if __HAVE_VBL_IRQ
|
||||||
|
|
||||||
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
|
|
||||||
{
|
|
||||||
unsigned int cur_vblank;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/* 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) ) {
|
|
||||||
ret = tsleep( &dev->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
|
||||||
if (ret)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
*sequence = cur_vblank;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DRM(wait_vblank)( DRM_IOCTL_ARGS )
|
int DRM(wait_vblank)( DRM_IOCTL_ARGS )
|
||||||
{
|
{
|
||||||
DRM_DEVICE;
|
DRM_DEVICE;
|
||||||
|
|
|
@ -92,7 +92,7 @@ void DRM(dma_service)( DRM_IRQ_ARGS )
|
||||||
RADEON_WRITE(RADEON_GEN_INT_STATUS, ack);
|
RADEON_WRITE(RADEON_GEN_INT_STATUS, ack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
|
static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
|
||||||
{
|
{
|
||||||
RADEON_WRITE( RADEON_GEN_INT_STATUS, RADEON_READ( RADEON_GEN_INT_STATUS ) );
|
RADEON_WRITE( RADEON_GEN_INT_STATUS, RADEON_READ( RADEON_GEN_INT_STATUS ) );
|
||||||
}
|
}
|
||||||
|
@ -156,10 +156,14 @@ int radeon_wait_irq(drm_device_t *dev, int swi_nr)
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
for (;;) {
|
||||||
|
if (RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr)
|
||||||
|
break;
|
||||||
ret = tsleep( &dev_priv->swi_queue, PZERO | PCATCH, \
|
ret = tsleep( &dev_priv->swi_queue, PZERO | PCATCH, \
|
||||||
"rdnirq", 3*hz );
|
"rdnirq", 3*hz );
|
||||||
if ( (ret == EWOULDBLOCK) || (ret == EINTR) )
|
if (ret)
|
||||||
return DRM_ERR(EBUSY);
|
break;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ */
|
||||||
}
|
}
|
||||||
|
@ -200,7 +204,7 @@ int radeon_vblank_wait(drm_device_t *dev, unsigned int *sequence)
|
||||||
}
|
}
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
ret = tsleep( &dev->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ */
|
||||||
|
|
|
@ -92,7 +92,7 @@ void DRM(dma_service)( DRM_IRQ_ARGS )
|
||||||
RADEON_WRITE(RADEON_GEN_INT_STATUS, ack);
|
RADEON_WRITE(RADEON_GEN_INT_STATUS, ack);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
|
static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
|
||||||
{
|
{
|
||||||
RADEON_WRITE( RADEON_GEN_INT_STATUS, RADEON_READ( RADEON_GEN_INT_STATUS ) );
|
RADEON_WRITE( RADEON_GEN_INT_STATUS, RADEON_READ( RADEON_GEN_INT_STATUS ) );
|
||||||
}
|
}
|
||||||
|
@ -156,10 +156,14 @@ int radeon_wait_irq(drm_device_t *dev, int swi_nr)
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
for (;;) {
|
||||||
|
if (RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr)
|
||||||
|
break;
|
||||||
ret = tsleep( &dev_priv->swi_queue, PZERO | PCATCH, \
|
ret = tsleep( &dev_priv->swi_queue, PZERO | PCATCH, \
|
||||||
"rdnirq", 3*hz );
|
"rdnirq", 3*hz );
|
||||||
if ( (ret == EWOULDBLOCK) || (ret == EINTR) )
|
if (ret)
|
||||||
return DRM_ERR(EBUSY);
|
break;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ */
|
||||||
}
|
}
|
||||||
|
@ -200,7 +204,7 @@ int radeon_vblank_wait(drm_device_t *dev, unsigned int *sequence)
|
||||||
}
|
}
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
ret = tsleep( &dev_priv->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
ret = tsleep( &dev->vbl_queue, 3*hz, "rdnvbl", PZERO | PCATCH);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ */
|
||||||
|
|
Loading…
Reference in New Issue