diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2020-05-15 12:50:50 +0300 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2020-05-20 00:31:30 +0300 |
commit | b5d250744cccfb40024de663ea1f4da04e6d959c (patch) | |
tree | dfee49ea555f7bb873fa91b69ff942b9424e9266 /include/drm/drm_gem.h | |
parent | 1a9458aeb8eb48bfa5f9b3e7682bddc28fd0b85e (diff) | |
download | linux-b5d250744cccfb40024de663ea1f4da04e6d959c.tar.xz |
drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()
With earlier patch we removed the overhead so now we can lift the helper
into the header effectively folding it with __drm_object_put.
v2: drop struct_mutex references (Daniel)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org> (v1)
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-11-emil.l.velikov@gmail.com
Diffstat (limited to 'include/drm/drm_gem.h')
-rw-r--r-- | include/drm/drm_gem.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index ec2d24a60a76..c3bdade093ae 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -364,27 +364,17 @@ static inline void drm_gem_object_get(struct drm_gem_object *obj) } /** - * __drm_gem_object_put - raw function to release a GEM buffer object reference + * drm_gem_object_put_unlocked - drop a GEM buffer object reference * @obj: GEM buffer object * - * This function is meant to be used by drivers which are not encumbered with - * &drm_device.struct_mutex legacy locking and which are using the - * gem_free_object_unlocked callback. It avoids all the locking checks and - * locking overhead of drm_gem_object_put() and drm_gem_object_put_unlocked(). - * - * Drivers should never call this directly in their code. Instead they should - * wrap it up into a ``driver_gem_object_put(struct driver_gem_object *obj)`` - * wrapper function, and use that. Shared code should never call this, to - * avoid breaking drivers by accident which still depend upon - * &drm_device.struct_mutex locking. + * This releases a reference to @obj. */ static inline void -__drm_gem_object_put(struct drm_gem_object *obj) +drm_gem_object_put_unlocked(struct drm_gem_object *obj) { kref_put(&obj->refcount, drm_gem_object_free); } -void drm_gem_object_put_unlocked(struct drm_gem_object *obj); void drm_gem_object_put(struct drm_gem_object *obj); int drm_gem_handle_create(struct drm_file *file_priv, |