drm: provide device-refcount
[platform/adaptation/renesas_rcar/renesas_kernel.git] / include / drm / drmP.h
index 134ca01..4cbf1ec 100644 (file)
@@ -43,6 +43,7 @@
 #include <asm/current.h>
 #endif                         /* __alpha__ */
 #include <linux/kernel.h>
+#include <linux/kref.h>
 #include <linux/miscdevice.h>
 #include <linux/fs.h>
 #include <linux/init.h>
@@ -1100,6 +1101,7 @@ struct drm_device {
 
        /** \name Lifetime Management */
        /*@{ */
+       struct kref ref;                /**< Object ref-count */
        struct device *dev;             /**< Device structure of bus-device */
        struct drm_driver *driver;      /**< DRM driver managing the device */
        void *dev_private;              /**< DRM driver private data */
@@ -1678,7 +1680,8 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
 
 struct drm_device *drm_dev_alloc(struct drm_driver *driver,
                                 struct device *parent);
-void drm_dev_free(struct drm_device *dev);
+void drm_dev_ref(struct drm_device *dev);
+void drm_dev_unref(struct drm_device *dev);
 int drm_dev_register(struct drm_device *dev, unsigned long flags);
 void drm_dev_unregister(struct drm_device *dev);
 int drm_dev_set_unique(struct drm_device *dev, const char *fmt, ...);