summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_bufs.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-08 16:14:05 +1100
committerDave Airlie <airlied@linux.ie>2007-02-08 16:14:05 +1100
commit1545085a28f226b59c243f88b82ea25393b0d63f (patch)
treecb6c1f8827281b8ad41f2f22e8365769aafe25cb /drivers/char/drm/drm_bufs.c
parent756db73df7b7d6b9f6421c1fb2e1cabeaede5846 (diff)
downloadblackbird-op-linux-1545085a28f226b59c243f88b82ea25393b0d63f.tar.gz
blackbird-op-linux-1545085a28f226b59c243f88b82ea25393b0d63f.zip
drm: Allow for 44 bit user-tokens (or drm_file offsets)
Diffstat (limited to 'drivers/char/drm/drm_bufs.c')
-rw-r--r--drivers/char/drm/drm_bufs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index d917c8cb8a36..a6828cc14e58 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -79,14 +79,14 @@ static int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash,
if (!use_hashed_handle) {
int ret;
- hash->key = user_token;
+ hash->key = user_token >> PAGE_SHIFT;
ret = drm_ht_insert_item(&dev->map_hash, hash);
if (ret != -EINVAL)
return ret;
}
return drm_ht_just_insert_please(&dev->map_hash, hash,
user_token, 32 - PAGE_SHIFT - 3,
- PAGE_SHIFT, DRM_MAP_HASH_OFFSET);
+ 0, DRM_MAP_HASH_OFFSET >> PAGE_SHIFT);
}
/**
@@ -262,7 +262,7 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
return ret;
}
- list->user_token = list->hash.key;
+ list->user_token = list->hash.key << PAGE_SHIFT;
mutex_unlock(&dev->struct_mutex);
*maplist = list;
@@ -347,7 +347,8 @@ int drm_rmmap_locked(drm_device_t *dev, drm_local_map_t *map)
if (r_list->map == map) {
list_del(list);
- drm_ht_remove_key(&dev->map_hash, r_list->user_token);
+ drm_ht_remove_key(&dev->map_hash,
+ r_list->user_token >> PAGE_SHIFT);
drm_free(list, sizeof(*list), DRM_MEM_MAPS);
break;
}
OpenPOWER on IntegriCloud