summaryrefslogtreecommitdiff
path: root/linux-core/drm_object.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@nx6125b.(none)>2007-06-05 10:09:11 +1000
committerDave Airlie <airlied@nx6125b.(none)>2007-06-05 10:09:11 +1000
commit07345af838a7443d29d12cb3fe91614e43c4fa81 (patch)
tree9a16e9ea79c70c6aea65ac11e395dfbf83459453 /linux-core/drm_object.c
parent704ca0638977f58742a8bff6aba9905fe862cfb3 (diff)
parent4327d7f3142cdbf3f3f94426ae33e2d30b5a40c8 (diff)
Merge branch 'origin' into radeon-ttm
Conflicts: shared-core/radeon_drv.h
Diffstat (limited to 'linux-core/drm_object.c')
-rw-r--r--linux-core/drm_object.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/linux-core/drm_object.c b/linux-core/drm_object.c
index 23412ed0..03906034 100644
--- a/linux-core/drm_object.c
+++ b/linux-core/drm_object.c
@@ -240,11 +240,17 @@ int drm_user_object_ref(drm_file_t * priv, uint32_t user_token,
{
drm_device_t *dev = priv->head->dev;
drm_user_object_t *uo;
+ drm_hash_item_t *hash;
int ret;
mutex_lock(&dev->struct_mutex);
- uo = drm_lookup_user_object(priv, user_token);
- if (!uo || (uo->type != type)) {
+ ret = drm_ht_find_item(&dev->object_hash, user_token, &hash);
+ if (ret) {
+ DRM_ERROR("Could not find user object to reference.\n");
+ goto out_err;
+ }
+ uo = drm_hash_entry(hash, drm_user_object_t, hash);
+ if (uo->type != type) {
ret = -EINVAL;
goto out_err;
}
@@ -253,7 +259,6 @@ int drm_user_object_ref(drm_file_t * priv, uint32_t user_token,
goto out_err;
mutex_unlock(&dev->struct_mutex);
*object = uo;
- DRM_ERROR("Referenced an object\n");
return 0;
out_err:
mutex_unlock(&dev->struct_mutex);
@@ -281,7 +286,6 @@ int drm_user_object_unref(drm_file_t * priv, uint32_t user_token,
}
drm_remove_ref_object(priv, ro);
mutex_unlock(&dev->struct_mutex);
- DRM_ERROR("Unreferenced an object\n");
return 0;
out_err:
mutex_unlock(&dev->struct_mutex);