drm/i915: Remove the vm open count
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_vma_types.h
index ca575e1..eac36be 100644 (file)
@@ -95,6 +95,8 @@ enum i915_cache_level;
  *
  */
 
+struct i915_vma_resource;
+
 struct intel_remapped_plane_info {
        /* in gtt pages */
        u32 offset:31;
@@ -247,22 +249,20 @@ struct i915_vma {
 
 #define I915_VMA_BIND_MASK (I915_VMA_GLOBAL_BIND | I915_VMA_LOCAL_BIND)
 
-#define I915_VMA_ALLOC_BIT     12
-
-#define I915_VMA_ERROR_BIT     13
+#define I915_VMA_ERROR_BIT     12
 #define I915_VMA_ERROR         ((int)BIT(I915_VMA_ERROR_BIT))
 
-#define I915_VMA_GGTT_BIT      14
-#define I915_VMA_CAN_FENCE_BIT 15
-#define I915_VMA_USERFAULT_BIT 16
-#define I915_VMA_GGTT_WRITE_BIT        17
+#define I915_VMA_GGTT_BIT      13
+#define I915_VMA_CAN_FENCE_BIT 14
+#define I915_VMA_USERFAULT_BIT 15
+#define I915_VMA_GGTT_WRITE_BIT        16
 
 #define I915_VMA_GGTT          ((int)BIT(I915_VMA_GGTT_BIT))
 #define I915_VMA_CAN_FENCE     ((int)BIT(I915_VMA_CAN_FENCE_BIT))
 #define I915_VMA_USERFAULT     ((int)BIT(I915_VMA_USERFAULT_BIT))
 #define I915_VMA_GGTT_WRITE    ((int)BIT(I915_VMA_GGTT_WRITE_BIT))
 
-#define I915_VMA_SCANOUT_BIT   18
+#define I915_VMA_SCANOUT_BIT   17
 #define I915_VMA_SCANOUT       ((int)BIT(I915_VMA_SCANOUT_BIT))
 
        struct i915_active active;
@@ -271,6 +271,13 @@ struct i915_vma {
 #define I915_VMA_PAGES_ACTIVE (BIT(24) | 1)
        atomic_t pages_count; /* number of active binds to the pages */
 
+       /**
+        * Whether we hold a reference on the vm dma_resv lock to temporarily
+        * block vm freeing until the vma is destroyed.
+        * Protected by the vm mutex.
+        */
+       bool vm_ddestroy;
+
        /**
         * Support different GGTT views into the same object.
         * This means there can be multiple VMA mappings per object and per VM.
@@ -291,6 +298,9 @@ struct i915_vma {
        struct list_head evict_link;
 
        struct list_head closed_link;
+
+       /** The async vma resource. Protected by the vm_mutex */
+       struct i915_vma_resource *resource;
 };
 
 #endif