summaryrefslogtreecommitdiff
path: root/linux-core/drm_bufs.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-09-30 19:26:35 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-09-30 19:26:35 +0000
commit1c0a437fa20e8c3fb971cd8947754a9b274bea76 (patch)
treec0b73653cb99426e8f869115755b81fed67f3f9c /linux-core/drm_bufs.c
parent3aef3841d0c8099a97a56a285f0a21d9147405bd (diff)
Move things around to reduce public symbols and even out files. Switch to
get_order from drm_order.
Diffstat (limited to 'linux-core/drm_bufs.c')
-rw-r--r--linux-core/drm_bufs.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index 88ca09ce..602dd3f8 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -36,30 +36,6 @@
#include <linux/vmalloc.h>
#include "drmP.h"
-/**
- * Compute size order. Returns the exponent of the smaller power of two which
- * is greater or equal to given number.
- *
- * \param size size.
- * \return order.
- *
- * \todo Can be made faster.
- */
-int drm_order( unsigned long size )
-{
- int order;
- unsigned long tmp;
-
- for (order = 0, tmp = size >> 1; tmp; tmp >>= 1, order++)
- ;
-
- if (size & (size - 1))
- ++order;
-
- return order;
-}
-EXPORT_SYMBOL(drm_order);
-
/**
* Adjusts the memory offset to its absolute value according to the mapping
* type. Adds the map to the map list drm_device::maplist. Adds MTRR's where
@@ -227,7 +203,7 @@ int drm_addmap( struct inode *inode, struct file *filp,
case _DRM_SHM:
map->handle = vmalloc_32(map->size);
DRM_DEBUG( "%lu %d %p\n",
- map->size, drm_order( map->size ), map->handle );
+ map->size, get_order( map->size ), map->handle );
if ( !map->handle ) {
drm_free( map, sizeof(*map), DRM_MEM_MAPS );
return -ENOMEM;
@@ -460,7 +436,7 @@ int drm_addbufs_agp( struct inode *inode, struct file *filp,
return -EFAULT;
count = request.count;
- order = drm_order( request.size );
+ order = get_order( request.size );
size = 1 << order;
alignment = (request.flags & _DRM_PAGE_ALIGN)
@@ -628,7 +604,7 @@ int drm_addbufs_pci( struct inode *inode, struct file *filp,
return -EFAULT;
count = request.count;
- order = drm_order( request.size );
+ order = get_order( request.size );
size = 1 << order;
DRM_DEBUG( "count=%d, size=%d (%d), order=%d, queue_count=%d\n",
@@ -858,7 +834,7 @@ int drm_addbufs_sg( struct inode *inode, struct file *filp,
return -EFAULT;
count = request.count;
- order = drm_order( request.size );
+ order = get_order( request.size );
size = 1 << order;
alignment = (request.flags & _DRM_PAGE_ALIGN)
@@ -1158,7 +1134,7 @@ int drm_markbufs( struct inode *inode, struct file *filp,
DRM_DEBUG( "%d, %d, %d\n",
request.size, request.low_mark, request.high_mark );
- order = drm_order( request.size );
+ order = get_order( request.size );
if ( order < DRM_MIN_ORDER || order > DRM_MAX_ORDER ) return -EINVAL;
entry = &dma->bufs[order];