diff options
author | Dave Airlie <airlied@linux.ie> | 2005-08-16 12:51:57 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-08-16 12:51:57 +0000 |
commit | 7af0186f4ccef285c2158770781ebfc3a26ddd66 (patch) | |
tree | e38ae798b605e3c433ba5d1a6c153baf0e9c15ce /linux-core/drm_context.c | |
parent | 8c21b783c3e38aa2c2d16e11ec01cf695f8e7f8a (diff) |
add Egberts 32/64 bit patch (its in kernel already...)
Diffstat (limited to 'linux-core/drm_context.c')
-rw-r--r-- | linux-core/drm_context.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c index baa8437d..5947c8e6 100644 --- a/linux-core/drm_context.c +++ b/linux-core/drm_context.c @@ -217,6 +217,7 @@ int drm_getsareactx(struct inode *inode, struct file *filp, drm_ctx_priv_map_t __user *argp = (void __user *)arg; drm_ctx_priv_map_t request; drm_map_t *map; + drm_map_list_t *_entry; if (copy_from_user(&request, argp, sizeof(request))) return -EFAULT; @@ -231,7 +232,16 @@ int drm_getsareactx(struct inode *inode, struct file *filp, map = dev->context_sareas[request.ctx_id]; up(&dev->struct_sem); - request.handle = map->handle; + request.handle = 0; + list_for_each_entry(_entry, &dev->maplist->head,head) { + if (_entry->map == map) { + request.handle = (void *)(unsigned long)_entry->user_token; + break; + } + } + if (request.handle == 0) + return -EINVAL; + if (copy_to_user(argp, &request, sizeof(request))) return -EFAULT; return 0; @@ -266,7 +276,8 @@ int drm_setsareactx(struct inode *inode, struct file *filp, down(&dev->struct_sem); list_for_each(list, &dev->maplist->head) { r_list = list_entry(list, drm_map_list_t, head); - if (r_list->map && r_list->map->handle == request.handle) + if (r_list->map + && r_list->user_token == (unsigned long) request.handle) goto found; } bad: |