]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm: remove drm_driver::gem_free_object
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 15 May 2020 09:50:49 +0000 (10:50 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 May 2020 21:31:30 +0000 (22:31 +0100)
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
drivers/gpu/drm/drm_gem.c
include/drm/drm_drv.h
include/drm/drm_gem.h

index eb0017985d9189ea960d7ff025ce5980c376e0de..21c69e71d685955aaf4ff774082ae2e8361bd29e 100644 (file)
@@ -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);
 
index 6d457652f199fa3f67225d87169ca59bb7525360..e6eff508f6878f33bd6b5c4decadcd01c54cb837 100644 (file)
@@ -327,14 +327,6 @@ struct drm_driver {
         */
        void (*debugfs_init)(struct drm_minor *minor);
 
-       /**
-        * @gem_free_object: deconstructor for drm_gem_objects
-        *
-        * This is deprecated and should not be used by new drivers. Use
-        * &drm_gem_object_funcs.free instead.
-        */
-       void (*gem_free_object) (struct drm_gem_object *obj);
-
        /**
         * @gem_free_object_unlocked: deconstructor for drm_gem_objects
         *
index 0b375069cd483f192b1958571b3012b4ab1e7b03..ec2d24a60a765a9bb8d5edd8e52c3fbb8e8611fe 100644 (file)
@@ -272,8 +272,9 @@ struct drm_gem_object {
         * attachment point for the device. This is invariant over the lifetime
         * of a gem object.
         *
-        * The &drm_driver.gem_free_object callback is responsible for cleaning
-        * up the dma_buf attachment and references acquired at import time.
+        * The &drm_driver.gem_free_object_unlocked callback is responsible for
+        * cleaning up the dma_buf attachment and references acquired at import
+        * time.
         *
         * Note that the drm gem/prime core does not depend upon drivers setting
         * this field any more. So for drivers where this doesn't make sense