From 4fa58aa15242333a635cb590762c6e6312945745 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sun, 27 Aug 2006 19:07:38 +0200 Subject: Add TTM map handle on reference. --- linux-core/drm_ttm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'linux-core') 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: -- cgit v1.2.3