drm/prime: proper locking+refcounting for obj->dma_buf link
[deliverable/linux.git] / include / drm / drmP.h
index 7782dbbbe1260a72ebd00bcf21397c65a3be0888..a95db49b3f9e0cb63584ce066162878332635128 100644 (file)
@@ -667,8 +667,16 @@ struct drm_gem_object {
 
        void *driver_private;
 
-       /* dma buf exported from this GEM object */
-       struct dma_buf *export_dma_buf;
+       /**
+        * dma_buf - dma buf associated with this GEM object
+        *
+        * Pointer to the dma-buf associated with this gem object (either
+        * through importing or exporting). We break the resulting reference
+        * loop when the last gem handle for this object is released.
+        *
+        * Protected by obj->object_name_lock
+        */
+       struct dma_buf *dma_buf;
 
        /**
         * import_attach - dma buf attachment backing this object
@@ -1196,7 +1204,7 @@ struct drm_device {
 
        /** \name GEM information */
        /*@{ */
-       spinlock_t object_name_lock;
+       struct mutex object_name_lock;
        struct idr object_name_idr;
        /*@} */
        int switch_power_state;
@@ -1575,6 +1583,9 @@ drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
        }
 }
 
+int drm_gem_handle_create_tail(struct drm_file *file_priv,
+                              struct drm_gem_object *obj,
+                              u32 *handlep);
 int drm_gem_handle_create(struct drm_file *file_priv,
                          struct drm_gem_object *obj,
                          u32 *handlep);
This page took 0.028665 seconds and 5 git commands to generate.