diff options
author | anholt <anholt@FreeBSD.org> | 2003-04-25 01:18:47 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2003-04-25 01:18:47 +0000 |
commit | 6afbdfe8ea6944a3f1856cc687cc6ea5e1d09657 (patch) | |
tree | efa3d0f59b543fa0e752db53d7ddd71f5a18e325 /sys/dev/drm/mga_dma.c | |
parent | a521aa5aa4b354de2cb042c0909b4830a4884051 (diff) | |
download | FreeBSD-src-6afbdfe8ea6944a3f1856cc687cc6ea5e1d09657.zip FreeBSD-src-6afbdfe8ea6944a3f1856cc687cc6ea5e1d09657.tar.gz |
Update the DRM to the latest from DRI CVS. Includes some bugfixes and removal
of the infrastructure for the gamma driver which was removed a while back.
The DRM_LINUX option is removed because the handler is now provided by the
linux compat code itself.
Diffstat (limited to 'sys/dev/drm/mga_dma.c')
-rw-r--r-- | sys/dev/drm/mga_dma.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/drm/mga_dma.c b/sys/dev/drm/mga_dma.c index f04d166..5020f1e 100644 --- a/sys/dev/drm/mga_dma.c +++ b/sys/dev/drm/mga_dma.c @@ -644,9 +644,12 @@ int mga_do_cleanup_dma( drm_device_t *dev ) if ( dev->dev_private ) { drm_mga_private_t *dev_priv = dev->dev_private; - DRM_IOREMAPFREE( dev_priv->warp ); - DRM_IOREMAPFREE( dev_priv->primary ); - DRM_IOREMAPFREE( dev_priv->buffers ); + if ( dev_priv->warp != NULL ) + DRM_IOREMAPFREE( dev_priv->warp ); + if ( dev_priv->primary != NULL ) + DRM_IOREMAPFREE( dev_priv->primary ); + if ( dev_priv->buffers != NULL ) + DRM_IOREMAPFREE( dev_priv->buffers ); if ( dev_priv->head != NULL ) { mga_freelist_cleanup( dev ); @@ -688,7 +691,7 @@ int mga_dma_flush( DRM_IOCTL_ARGS ) drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private; drm_lock_t lock; - LOCK_TEST_WITH_RETURN( dev ); + LOCK_TEST_WITH_RETURN( dev, filp ); DRM_COPY_FROM_USER_IOCTL( lock, (drm_lock_t *)data, sizeof(lock) ); @@ -722,7 +725,7 @@ int mga_dma_reset( DRM_IOCTL_ARGS ) DRM_DEVICE; drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private; - LOCK_TEST_WITH_RETURN( dev ); + LOCK_TEST_WITH_RETURN( dev, filp ); return mga_do_dma_reset( dev_priv ); } @@ -732,7 +735,8 @@ int mga_dma_reset( DRM_IOCTL_ARGS ) * DMA buffer management */ -static int mga_dma_get_buffers( drm_device_t *dev, drm_dma_t *d ) +static int mga_dma_get_buffers( DRMFILE filp, + drm_device_t *dev, drm_dma_t *d ) { drm_buf_t *buf; int i; @@ -741,7 +745,7 @@ static int mga_dma_get_buffers( drm_device_t *dev, drm_dma_t *d ) buf = mga_freelist_get( dev ); if ( !buf ) return DRM_ERR(EAGAIN); - buf->pid = DRM_CURRENTPID; + buf->filp = filp; if ( DRM_COPY_TO_USER( &d->request_indices[i], &buf->idx, sizeof(buf->idx) ) ) @@ -763,7 +767,7 @@ int mga_dma_buffers( DRM_IOCTL_ARGS ) drm_dma_t d; int ret = 0; - LOCK_TEST_WITH_RETURN( dev ); + LOCK_TEST_WITH_RETURN( dev, filp ); DRM_COPY_FROM_USER_IOCTL( d, (drm_dma_t *)data, sizeof(d) ); @@ -788,7 +792,7 @@ int mga_dma_buffers( DRM_IOCTL_ARGS ) d.granted_count = 0; if ( d.request_count ) { - ret = mga_dma_get_buffers( dev, &d ); + ret = mga_dma_get_buffers( filp, dev, &d ); } DRM_COPY_TO_USER_IOCTL( (drm_dma_t *)data, d, sizeof(d) ); |