/* Returns a reference to the object named by the handle.  */
struct drm_gem_object* drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp, u32 handle)
/* Returns a reference to the object named by the handle.  */
struct drm_gem_object* drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp, u32 handle)
{
	struct drm_gem_object *obj;
	spin_lock(&filp->table_lock);
	obj = idr_find(&filp->object_idr, handle);
	if (obj == NULL) {
		spin_unlock(&filp->table_lock);
		return NULL;
	}
	drm_gem_object_reference(obj);
	spin_unlock(&filp->table_lock);
	return obj;
}