From abc896638fdcd8ccb457ad7b43dbe7ad229ba501 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 1 May 2008 20:12:39 -0700 Subject: Use krefs for refcounting. krefs are way easier than a custom-coded spinlock+int combo. --- linux-core/drmP.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'linux-core/drmP.h') 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 /* For (un)lock_kernel */ #include #include +#include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) #include @@ -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; }; -- cgit v1.2.3