Commit 202f2fef authored by Chris Wilson's avatar Chris Wilson

drm/i915: Avoid taking the mutex for dropping the refcnt upon creation

After allocation a handle for the fresh object, we know that we can
safely drop the refcnt without triggering a free so we do not need the
mutex. Strangely, this mutex acquisition is the one that appears on
driver profiles.
Signed-off-by: default avatarChris Wilson <>
parent f0c43d9b
......@@ -244,12 +244,17 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
return -ENOMEM;
ret = drm_gem_handle_create(file_priv, obj, &handle);
/* drop reference from allocate - handle holds it now */
if (ret) {
i915_gem_info_remove_obj(dev->dev_private, obj->size);
return ret;
/* drop reference from allocate - handle holds it now */
args->handle = handle;
return 0;
......@@ -4380,8 +4385,6 @@ struct drm_gem_object * i915_gem_alloc_object(struct drm_device *dev,
obj->madv = I915_MADV_WILLNEED;
return &obj->base;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment