summaryrefslogtreecommitdiff
path: root/linux-core/drm_bufs.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-23 13:31:45 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-23 13:31:45 +0200
commit8fa43d4b2ff4137bab743bfaf6282aa327f16830 (patch)
tree50d16aa41bf6262afc35d7fb7aeb3ab771b7f6f8 /linux-core/drm_bufs.c
parente201511a0fbeb177a9ecd7f77d177fc88c1616fb (diff)
parent459b234d79daaa8a003da9ea48775a5587d5ba2a (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into drm-ttm-0-2-branch
Diffstat (limited to 'linux-core/drm_bufs.c')
-rw-r--r--linux-core/drm_bufs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index efb48dce..29983060 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -78,14 +78,16 @@ int drm_map_handle(drm_device_t *dev, drm_hash_item_t *hash,
#error Unsupported long size. Neither 64 nor 32 bits.
#endif
- if (use_hashed_handle) {
- return drm_ht_just_insert_please(&dev->map_hash, hash,
- user_token, 32 - PAGE_SHIFT - 3,
- PAGE_SHIFT, DRM_MAP_HASH_OFFSET);
- } else {
+ if (!use_hashed_handle) {
+ int ret;
hash->key = user_token;
- return drm_ht_insert_item(&dev->map_hash, hash);
+ ret = drm_ht_insert_item(&dev->map_hash, hash);
+ if (!ret)
+ return 0;
}
+ return drm_ht_just_insert_please(&dev->map_hash, hash,
+ user_token, 32 - PAGE_SHIFT - 3,
+ PAGE_SHIFT, DRM_MAP_HASH_OFFSET);
}
/**