summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 22:02:34 (GMT)
committerDave Airlie <airlied@redhat.com>2013-08-19 00:46:56 (GMT)
commit36da5908a275d6319c17e758b5bde89b4f573959 (patch)
treed78c928f49e38c650701062c7badc20ff70d0b3e /include/drm
parent7106bf96f81b0c207aaab4b46aa2acc5cab334d4 (diff)
downloadlinux-fsl-qoriq-36da5908a275d6319c17e758b5bde89b4f573959.tar.xz
drm/gem: move drm_gem_object_handle_unreference_unlocked into drm_gem.c
We have three callers of this function now and it's neither performance critical nor really small. So an inline function feels like overkill and unecessarily separates the different parts of the code. Since all callers of drm_gem_object_handle_free are now in drm_gem.c we can make that static (and remove the unused EXPORT_SYMBOL). To avoid a forward declaration move it (and drm_gem_object_free_bug) up a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 5dc9894..0ef8e54 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1555,7 +1555,6 @@ int drm_gem_object_init(struct drm_device *dev,
struct drm_gem_object *obj, size_t size);
void drm_gem_private_object_init(struct drm_device *dev,
struct drm_gem_object *obj, size_t size);
-void drm_gem_object_handle_free(struct drm_gem_object *obj);
void drm_gem_vm_open(struct vm_area_struct *vma);
void drm_gem_vm_close(struct vm_area_struct *vma);
int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
@@ -1602,25 +1601,7 @@ drm_gem_object_handle_reference(struct drm_gem_object *obj)
atomic_inc(&obj->handle_count);
}
-static inline void
-drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
-{
- if (obj == NULL)
- return;
-
- if (atomic_read(&obj->handle_count) == 0)
- return;
-
- /*
- * Must bump handle count first as this may be the last
- * ref, in which case the object would disappear before we
- * checked for a name
- */
-
- if (atomic_dec_and_test(&obj->handle_count))
- drm_gem_object_handle_free(obj);
- drm_gem_object_unreference_unlocked(obj);
-}
+void drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj);
void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
int drm_gem_create_mmap_offset(struct drm_gem_object *obj);