summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-27 19:07:38 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-27 19:07:38 +0200
commit4fa58aa15242333a635cb590762c6e6312945745 (patch)
tree5946742abaf8fcbdbc5fcfd8077e551cf761a055 /linux-core
parent65e7274008446d2059b7fd7cd6d7b1d6b04da0ce (diff)
Add TTM map handle on reference.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_ttm.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 293b1f8c..6e132745 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -882,7 +882,15 @@ int drm_ttm_ioctl(drm_file_t *priv, drm_ttm_arg_t __user *data)
mutex_unlock(&dev->struct_mutex);
break;
case drm_ttm_reference:
- return drm_user_object_ref(priv, arg.handle, drm_ttm_type, &uo);
+ ret = drm_user_object_ref(priv, arg.handle, drm_ttm_type, &uo);
+ if (ret)
+ return ret;
+ mutex_lock(&dev->struct_mutex);
+ uo = drm_lookup_user_object(priv, arg.handle);
+ entry = drm_user_object_entry(uo, drm_ttm_object_t, base);
+ arg.user_token = entry->map_list.user_token;
+ mutex_unlock(&dev->struct_mutex);
+ break;
case drm_ttm_unreference:
return drm_user_object_unref(priv, arg.handle, drm_ttm_type);
case drm_ttm_destroy: