vserver 1.9.3
[linux-2.6.git] / drivers / char / drm / drm_dma.h
index 7212275..5cbdc93 100644 (file)
 
 #include "drmP.h"
 
-
-#ifndef __HAVE_DMA_WAITQUEUE
-#define __HAVE_DMA_WAITQUEUE   0
-#endif
-#ifndef __HAVE_DMA_RECLAIM
-#define __HAVE_DMA_RECLAIM     0
-#endif
-
-#if __HAVE_DMA
-
 /**
  * Initialize the DMA data.
  * 
@@ -116,9 +106,6 @@ void DRM(dma_takedown)(drm_device_t *dev)
                                  dma->bufs[i].buf_count *
                                  sizeof(*dma->bufs[0].buflist),
                                  DRM_MEM_BUFS);
-#if __HAVE_DMA_FREELIST
-                       DRM(freelist_destroy)(&dma->bufs[i].freelist);
-#endif
                }
        }
 
@@ -155,22 +142,11 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf)
        buf->filp     = NULL;
        buf->used     = 0;
 
-       if ( __HAVE_DMA_WAITQUEUE && waitqueue_active(&buf->dma_wait)) {
+       if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && waitqueue_active(&buf->dma_wait)) {
                wake_up_interruptible(&buf->dma_wait);
        }
-#if __HAVE_DMA_FREELIST
-       else {
-               drm_device_dma_t *dma = dev->dma;
-                               /* If processes are waiting, the last one
-                                  to wake will put the buffer on the free
-                                  list.  If no processes are waiting, we
-                                  put the buffer on the freelist here. */
-               DRM(freelist_put)(dev, &dma->bufs[buf->order].freelist, buf);
-       }
-#endif
 }
 
-#if !__HAVE_DMA_RECLAIM
 /**
  * Reclaim the buffers.
  *
@@ -178,7 +154,7 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf)
  *
  * Frees each buffer associated with \p filp not already on the hardware.
  */
-void DRM(reclaim_buffers)( struct file *filp )
+void DRM(core_reclaim_buffers)( struct file *filp )
 {
        drm_file_t    *priv   = filp->private_data;
        drm_device_t  *dev    = priv->dev;
@@ -202,29 +178,4 @@ void DRM(reclaim_buffers)( struct file *filp )
                }
        }
 }
-#endif
-
-#if !__HAVE_IRQ
-/* This stub DRM_IOCTL_CONTROL handler is for the drivers that used to require
- * IRQs for DMA but no longer do.  It maintains compatibility with the X Servers
- * that try to use the control ioctl by simply returning success.
- */
-int DRM(control)( struct inode *inode, struct file *filp,
-                 unsigned int cmd, unsigned long arg )
-{
-       drm_control_t ctl;
-
-       if ( copy_from_user( &ctl, (drm_control_t __user *)arg, sizeof(ctl) ) )
-               return -EFAULT;
-
-       switch ( ctl.func ) {
-       case DRM_INST_HANDLER:
-       case DRM_UNINST_HANDLER:
-               return 0;
-       default:
-               return -EINVAL;
-       }
-}
-#endif
 
-#endif /* __HAVE_DMA */