summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
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.