diff options
author | Thomas Hellstrom <thomas@tungstengraphics.com> | 2006-07-11 14:37:37 +0000 |
---|---|---|
committer | Thomas Hellstrom <thomas@tungstengraphics.com> | 2006-07-11 14:37:37 +0000 |
commit | 126673d62afad6da84e833daa644a352d88a5e37 (patch) | |
tree | 360d6186280ab586fe748bb9bccc7db298117841 /linux-core/drm_vm.c | |
parent | a392349691ec2aa3f83d8a9fc4a485e4dbef4bbe (diff) |
Keep hashed user tokens, with the following changes:
32-bit physical device addresses are mapped directly to user-tokens. No
duplicate maps are allowed, and the addresses are assumed to be outside
of the range 0x10000000 through 0x30000000. The user-token is identical
to the 32-bit physical start-address of the map.
64-bit physical device addressed are mapped to user-tokens in the range
0x10000000 to 0x30000000 with page-size increments. The user_token should
not be interpreted as an address.
Other map types, like upcoming TTM maps are mapped to user-tokens in the
range
0x10000000 to 0x30000000 with page-size increments. The user_token should
not be interpreted as an address.
This keeps compatibility with buggy drivers, while still implementing a
hashed map lookup. The SiS and via device driver major bumps are
reverted.
Diffstat (limited to 'linux-core/drm_vm.c')
-rw-r--r-- | linux-core/drm_vm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 93037bda..19866dca 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -70,8 +70,7 @@ static __inline__ struct page *drm_do_vm_nopage(struct vm_area_struct *vma, if (!dev->agp || !dev->agp->cant_use_aperture) goto vm_nopage_error; - if (drm_ht_find_item(&dev->map_hash, (VM_OFFSET(vma) - DRM_MAP_HASH_OFFSET) >> PAGE_SHIFT, - &hash)) + if (drm_ht_find_item(&dev->map_hash, VM_OFFSET(vma), &hash)) goto vm_nopage_error; r_list = drm_hash_entry(hash, drm_map_list_t, hash); @@ -575,8 +574,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) ) return drm_mmap_dma(filp, vma); - if (drm_ht_find_item(&dev->map_hash, (VM_OFFSET(vma) - DRM_MAP_HASH_OFFSET) >> PAGE_SHIFT, - &hash)) { + if (drm_ht_find_item(&dev->map_hash, VM_OFFSET(vma), &hash)) { DRM_ERROR("Could not find map\n"); return -EINVAL; } |