summaryrefslogtreecommitdiff
path: root/linux-core/drm_scatter.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-05-16 23:47:15 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-05-16 23:47:15 +0000
commit9e67da5626b683df58f2041fdb0f743eb4da7036 (patch)
tree899477e18e99e9b620e27961de58c0664b218825 /linux-core/drm_scatter.c
parent3903e5ac94c07cf31f0bc24eff5011ef8cc7afba (diff)
Allow drm to build under 2.4 and 2.5(.14)
Diffstat (limited to 'linux-core/drm_scatter.c')
-rw-r--r--linux-core/drm_scatter.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c
index 07e8e4e5..1aedb403 100644
--- a/linux-core/drm_scatter.c
+++ b/linux-core/drm_scatter.c
@@ -66,9 +66,6 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
drm_scatter_gather_t request;
drm_sg_mem_t *entry;
unsigned long pages, i, j;
- pgd_t *pgd;
- pmd_t *pmd;
- pte_t *pte;
DRM_DEBUG( "%s\n", __FUNCTION__ );
@@ -137,21 +134,10 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
DRM_DEBUG( "sg alloc virtual = %p\n", entry->virtual );
for ( i = entry->handle, j = 0 ; j < pages ; i += PAGE_SIZE, j++ ) {
- pgd = pgd_offset_k( i );
- if ( !pgd_present( *pgd ) )
+ entry->pagelist[j] = vmalloc_to_page((void *)i);
+ if (!entry->pagelist[j])
goto failed;
-
- pmd = pmd_offset( pgd, i );
- if ( !pmd_present( *pmd ) )
- goto failed;
-
- pte = pte_offset( pmd, i );
- if ( !pte_present( *pte ) )
- goto failed;
-
- entry->pagelist[j] = pte_page( *pte );
-
- SetPageReserved( entry->pagelist[j] );
+ SetPageReserved(entry->pagelist[j]);
}
request.handle = entry->handle;