diff options
author | Keith Packard <keithp@keithp.com> | 2008-05-01 20:12:39 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-05-01 20:12:39 -0700 |
commit | abc896638fdcd8ccb457ad7b43dbe7ad229ba501 (patch) | |
tree | 157a7961a250a9e443ef4a1e9a89320ecab8990b /linux-core/drmP.h | |
parent | c10695bb7ab44494badc21c822eac3140cf4e117 (diff) |
Use krefs for refcounting.
krefs are way easier than a custom-coded spinlock+int combo.
Diffstat (limited to 'linux-core/drmP.h')
-rw-r--r-- | linux-core/drmP.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 2ed17b81..0df9f19b 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -54,6 +54,7 @@ #include <linux/smp_lock.h> /* For (un)lock_kernel */ #include <linux/dma-mapping.h> #include <linux/mm.h> +#include <linux/kref.h> #include <linux/pagemap.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) #include <linux/mutex.h> @@ -614,20 +615,21 @@ struct drm_ati_pcigart_info { * DRM for its buffer objects. */ struct drm_gem_object { + /** Reference count of this object */ + struct kref refcount; + + /** Related drm device */ + struct drm_device *dev; + /** File representing the shmem storage */ struct file *filp; - spinlock_t lock; - /** * Size of the object, in bytes. Immutable over the object's * lifetime. */ size_t size; - /** Reference count of this object, protected by object_lock */ - int refcount; - void *driver_private; }; |