summaryrefslogtreecommitdiff
path: root/linux-core/drm_bufs.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/drm_bufs.c')
-rw-r--r--linux-core/drm_bufs.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index 02694f46..1d540322 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -135,6 +135,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
#if __REALLY_HAVE_AGP
case _DRM_AGP:
map->offset = map->offset + dev->agp->base;
+ map->mtrr = dev->agp->agp_mtrr; /* for getmap */
break;
#endif
default:
@@ -332,7 +333,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
buf->order = order;
buf->used = 0;
- buf->offset = (dma->byte_count + offset); /* ******** */
+ buf->offset = (dma->byte_count + offset);
buf->bus_address = agp_offset + offset;
buf->address = (void *)(agp_offset + offset);
buf->next = NULL;
@@ -346,7 +347,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
DRM_MEM_BUFS );
memset( buf->dev_private, 0, buf->dev_priv_size );
-#if DRM_DMA_HISTOGRAM
+#if __HAVE_DMA_HISTOGRAM
buf->time_queued = 0;
buf->time_dispatched = 0;
buf->time_completed = 0;
@@ -377,17 +378,12 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
DRM_DEBUG( "dma->buf_count : %d\n", dma->buf_count );
DRM_DEBUG( "entry->buf_count : %d\n", entry->buf_count );
-/* GH: Please leave this disabled for now. I need to fix this properly...
- */
-#if 0
- /* FIXME: work this mess out...
- */
+#if __HAVE_DMA_FREELIST
DRM(freelist_create)( &entry->freelist, entry->buf_count );
for ( i = 0 ; i < entry->buf_count ; i++ ) {
DRM(freelist_put)( dev, &entry->freelist, &entry->buflist[i] );
}
#endif
-
up( &dev->struct_sem );
request.count = entry->buf_count;
@@ -523,11 +519,11 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
buf->pending = 0;
init_waitqueue_head( &buf->dma_wait );
buf->pid = 0;
-#if DRM_DMA_HISTOGRAM
+#if __HAVE_DMA_HISTOGRAM
buf->time_queued = 0;
buf->time_dispatched = 0;
buf->time_completed = 0;
- buf->time_freed = 0;
+ buf->time_freed = 0;
#endif
DRM_DEBUG( "buffer %d @ %p\n",
entry->buf_count, buf->address );
@@ -549,17 +545,12 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
dma->page_count += entry->seg_count << page_order;
dma->byte_count += PAGE_SIZE * (entry->seg_count << page_order);
-/* GH: Please leave this disabled for now. I need to fix this properly...
- */
-#if 0
- /* FIXME: work this mess out...
- */
+#if __HAVE_DMA_FREELIST
DRM(freelist_create)( &entry->freelist, entry->buf_count );
for ( i = 0 ; i < entry->buf_count ; i++ ) {
DRM(freelist_put)( dev, &entry->freelist, &entry->buflist[i] );
}
#endif
-
up( &dev->struct_sem );
request.count = entry->buf_count;