summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-29 14:52:02 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-29 14:52:02 +0200
commit0dedfc2cd03f50b435476e56637b333d345fddbd (patch)
treec0b4a12c85c6972a7b662343b907101302894933 /linux-core/drm_ttm.c
parent279e8d26c6cf7347aa9cb6d50d025a41dff9a5be (diff)
Checkpoint ttm addition to buffer objects.
Diffstat (limited to 'linux-core/drm_ttm.c')
-rw-r--r--linux-core/drm_ttm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 8cd0af61..e111070e 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -784,6 +784,16 @@ void drm_ttm_object_deref_locked(drm_device_t *dev, drm_ttm_object_t *to)
}
}
+void drm_ttm_object_deref_unlocked(drm_device_t *dev, drm_ttm_object_t *to)
+{
+ if (atomic_dec_and_test(&to->usage)) {
+ mutex_lock(&dev->struct_mutex);
+ if (atomic_read(&to->usage) == 0)
+ drm_ttm_object_remove(dev, to);
+ mutex_unlock(&dev->struct_mutex);
+ }
+}
+
/*
* dev->struct_mutex locked.