aboutsummaryrefslogtreecommitdiff
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorGravatar Daniel Vetter <daniel.vetter@ffwll.ch> 2013-08-15 00:02:34 +0200
committerGravatar Dave Airlie <airlied@redhat.com> 2013-08-19 10:46:56 +1000
commit36da5908a275d6319c17e758b5bde89b4f573959 (patch)
treed78c928f49e38c650701062c7badc20ff70d0b3e /include/drm/drmP.h
parentdrm/prime: add a bit of documentation about gem_obj->import_attach (diff)
downloadlinux-36da5908a275d6319c17e758b5bde89b4f573959.tar.gz
linux-36da5908a275d6319c17e758b5bde89b4f573959.tar.bz2
linux-36da5908a275d6319c17e758b5bde89b4f573959.zip
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/drmP.h')
-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 5dc98947375c..0ef8e5481e15 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);