diff options
author | anholt <anholt@FreeBSD.org> | 2003-08-19 02:57:31 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2003-08-19 02:57:31 +0000 |
commit | 55fc74037ce1fed2313813918c5380b1c642828e (patch) | |
tree | e45c260fa868be8644bf3d316e3c7cc3cdc5a0eb /sys/dev/drm/mga_dma.c | |
parent | f9627255eea8f589c728f37d9a3a6e0040a24291 (diff) | |
download | FreeBSD-src-55fc74037ce1fed2313813918c5380b1c642828e.zip FreeBSD-src-55fc74037ce1fed2313813918c5380b1c642828e.tar.gz |
Update DRM from DRI CVS as of today. Notable changes include Radeon
suspend/resume support and Rage 128 pageflipping support (both of which require
XFree86 from CVS), along with miscellaneous cleanups.
Diffstat (limited to 'sys/dev/drm/mga_dma.c')
-rw-r--r-- | sys/dev/drm/mga_dma.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/drm/mga_dma.c b/sys/dev/drm/mga_dma.c index 5020f1e..45e6406 100644 --- a/sys/dev/drm/mga_dma.c +++ b/sys/dev/drm/mga_dma.c @@ -556,9 +556,9 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init ) (drm_mga_sarea_t *)((u8 *)dev_priv->sarea->handle + init->sarea_priv_offset); - DRM_IOREMAP( dev_priv->warp ); - DRM_IOREMAP( dev_priv->primary ); - DRM_IOREMAP( dev_priv->buffers ); + DRM_IOREMAP( dev_priv->warp, dev ); + DRM_IOREMAP( dev_priv->primary, dev ); + DRM_IOREMAP( dev_priv->buffers, dev ); if(!dev_priv->warp->handle || !dev_priv->primary->handle || @@ -641,15 +641,23 @@ int mga_do_cleanup_dma( drm_device_t *dev ) { DRM_DEBUG( "\n" ); +#if _HAVE_DMA_IRQ + /* Make sure interrupts are disabled here because the uninstall ioctl + * may not have been called from userspace and after dev_private + * is freed, it's too late. + */ + if ( dev->irq ) DRM(irq_uninstall)(dev); +#endif + if ( dev->dev_private ) { drm_mga_private_t *dev_priv = dev->dev_private; if ( dev_priv->warp != NULL ) - DRM_IOREMAPFREE( dev_priv->warp ); + DRM_IOREMAPFREE( dev_priv->warp, dev ); if ( dev_priv->primary != NULL ) - DRM_IOREMAPFREE( dev_priv->primary ); + DRM_IOREMAPFREE( dev_priv->primary, dev ); if ( dev_priv->buffers != NULL ) - DRM_IOREMAPFREE( dev_priv->buffers ); + DRM_IOREMAPFREE( dev_priv->buffers, dev ); if ( dev_priv->head != NULL ) { mga_freelist_cleanup( dev ); @@ -668,6 +676,8 @@ int mga_dma_init( DRM_IOCTL_ARGS ) DRM_DEVICE; drm_mga_init_t init; + LOCK_TEST_WITH_RETURN( dev, filp ); + DRM_COPY_FROM_USER_IOCTL( init, (drm_mga_init_t *)data, sizeof(init) ); switch ( init.func ) { |