diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2020-05-15 12:50:49 +0300 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2020-05-20 00:31:30 +0300 |
commit | 1a9458aeb8eb48bfa5f9b3e7682bddc28fd0b85e (patch) | |
tree | 3c2517226acde9ad1e2182f77f88bcb0ed5c0128 /drivers/gpu/drm/drm_gem.c | |
parent | 00c47f569d5fc1d7e2b58b2dfda64f3e01233e69 (diff) | |
download | linux-1a9458aeb8eb48bfa5f9b3e7682bddc28fd0b85e.tar.xz |
drm: remove drm_driver::gem_free_object
No drivers set the callback, so remove it all together.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-10-emil.l.velikov@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index eb0017985d91..21c69e71d685 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -975,15 +975,10 @@ drm_gem_object_free(struct kref *kref) container_of(kref, struct drm_gem_object, refcount); struct drm_device *dev = obj->dev; - if (obj->funcs) { + if (obj->funcs) obj->funcs->free(obj); - } else if (dev->driver->gem_free_object_unlocked) { + else if (dev->driver->gem_free_object_unlocked) dev->driver->gem_free_object_unlocked(obj); - } else if (dev->driver->gem_free_object) { - WARN_ON(!mutex_is_locked(&dev->struct_mutex)); - - dev->driver->gem_free_object(obj); - } } EXPORT_SYMBOL(drm_gem_object_free); @@ -999,21 +994,10 @@ EXPORT_SYMBOL(drm_gem_object_free); void drm_gem_object_put_unlocked(struct drm_gem_object *obj) { - struct drm_device *dev; - if (!obj) return; - dev = obj->dev; - - if (dev->driver->gem_free_object) { - might_lock(&dev->struct_mutex); - if (kref_put_mutex(&obj->refcount, drm_gem_object_free, - &dev->struct_mutex)) - mutex_unlock(&dev->struct_mutex); - } else { - kref_put(&obj->refcount, drm_gem_object_free); - } + kref_put(&obj->refcount, drm_gem_object_free); } EXPORT_SYMBOL(drm_gem_object_put_unlocked); |