diff options
author | Felix Kuehling <fxkuehl@gmx.de> | 2005-01-12 16:07:49 +0000 |
---|---|---|
committer | Felix Kuehling <fxkuehl@gmx.de> | 2005-01-12 16:07:49 +0000 |
commit | d4a8f16eb6a2fe13f2576f224e6c1a8b3ba89719 (patch) | |
tree | ce149b0baebfec680425a4d9da6608110d9c1142 /linux-core | |
parent | ee576367632b582e29f2b3d42f2eb9250cfdf219 (diff) |
Use virt_to_page instead of vmalloc_to_page in drm_do_vm_shm_nopage for
consistent pages allocated with drm_pci_alloc.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_vm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 3372498b..47693b03 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -151,7 +151,8 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, offset = address - vma->vm_start; i = (unsigned long)map->handle + offset; - page = vmalloc_to_page((void *)i); + page = (map->type == _DRM_CONSISTENT) ? + virt_to_page((void *)i) : vmalloc_to_page((void *)i); if (!page) return NOPAGE_OOM; get_page(page); @@ -663,8 +664,9 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) break; case _DRM_SHM: case _DRM_CONSISTENT: - /* Consistent memory is really like shared memory. It's only - * allocated in a different way. */ + /* Consistent memory is much like shared memory. The + * only difference is that drm_vm_shm_nopage must use + * virt_to_page instead of vmalloc_to_page. */ vma->vm_ops = &drm_vm_shm_ops; vma->vm_private_data = (void *)map; /* Don't let this area swap. Change when |