aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-09-22 04:18:37 +1000
committerDave Airlie <airlied@linux.ie>2006-09-22 05:32:34 +1000
commite08870c87ab5b0c0c3cb05d0d0041240736493e4 (patch)
treefcc53c55b955143793187aad54d331f2e8f7a49a /drivers/char/drm
parent214ff13d9ebbba7940f29bc89669f85f12533083 (diff)
drm: allow multiple addMaps with the same 32-bit map offsset.
Reported on -mm kernels. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drm_bufs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index 03c6db9029c..029baea33b6 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -77,14 +77,16 @@ static 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 != -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);
}
/**