aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 18:02:34 -0400
committerDave Airlie <airlied@redhat.com>2013-08-18 20:46:56 -0400
commit36da5908a275d6319c17e758b5bde89b4f573959 (patch)
treed78c928f49e38c650701062c7badc20ff70d0b3e /include/drm
parent7106bf96f81b0c207aaab4b46aa2acc5cab334d4 (diff)
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 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,
1555 struct drm_gem_object *obj, size_t size); 1555 struct drm_gem_object *obj, size_t size);
1556void drm_gem_private_object_init(struct drm_device *dev, 1556void drm_gem_private_object_init(struct drm_device *dev,
1557 struct drm_gem_object *obj, size_t size); 1557 struct drm_gem_object *obj, size_t size);
1558void drm_gem_object_handle_free(struct drm_gem_object *obj);
1559void drm_gem_vm_open(struct vm_area_struct *vma); 1558void drm_gem_vm_open(struct vm_area_struct *vma);
1560void drm_gem_vm_close(struct vm_area_struct *vma); 1559void drm_gem_vm_close(struct vm_area_struct *vma);
1561int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size, 1560int 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)
1602 atomic_inc(&obj->handle_count); 1601 atomic_inc(&obj->handle_count);
1603} 1602}
1604 1603
1605static inline void 1604void drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj);
1606drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
1607{
1608 if (obj == NULL)
1609 return;
1610
1611 if (atomic_read(&obj->handle_count) == 0)
1612 return;
1613
1614 /*
1615 * Must bump handle count first as this may be the last
1616 * ref, in which case the object would disappear before we
1617 * checked for a name
1618 */
1619
1620 if (atomic_dec_and_test(&obj->handle_count))
1621 drm_gem_object_handle_free(obj);
1622 drm_gem_object_unreference_unlocked(obj);
1623}
1624 1605
1625void drm_gem_free_mmap_offset(struct drm_gem_object *obj); 1606void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1626int drm_gem_create_mmap_offset(struct drm_gem_object *obj); 1607int drm_gem_create_mmap_offset(struct drm_gem_object *obj);