aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c17
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c50
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_evict.c6
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c10
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.h4
-rw-r--r--drivers/gpu/drm/i915/i915_gem_shrinker.c4
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem_userptr.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gpu_error.c8
10 files changed, 52 insertions, 53 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9e19cf0e7075..d7f03bceea57 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -117,9 +117,8 @@ static u64 i915_gem_obj_total_ggtt_size(struct drm_i915_gem_object *obj)
117 u64 size = 0; 117 u64 size = 0;
118 struct i915_vma *vma; 118 struct i915_vma *vma;
119 119
120 list_for_each_entry(vma, &obj->vma_list, vma_link) { 120 list_for_each_entry(vma, &obj->vma_list, obj_link) {
121 if (i915_is_ggtt(vma->vm) && 121 if (i915_is_ggtt(vma->vm) && drm_mm_node_allocated(&vma->node))
122 drm_mm_node_allocated(&vma->node))
123 size += vma->node.size; 122 size += vma->node.size;
124 } 123 }
125 124
@@ -155,7 +154,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
155 obj->madv == I915_MADV_DONTNEED ? " purgeable" : ""); 154 obj->madv == I915_MADV_DONTNEED ? " purgeable" : "");
156 if (obj->base.name) 155 if (obj->base.name)
157 seq_printf(m, " (name: %d)", obj->base.name); 156 seq_printf(m, " (name: %d)", obj->base.name);
158 list_for_each_entry(vma, &obj->vma_list, vma_link) { 157 list_for_each_entry(vma, &obj->vma_list, obj_link) {
159 if (vma->pin_count > 0) 158 if (vma->pin_count > 0)
160 pin_count++; 159 pin_count++;
161 } 160 }
@@ -164,7 +163,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
164 seq_printf(m, " (display)"); 163 seq_printf(m, " (display)");
165 if (obj->fence_reg != I915_FENCE_REG_NONE) 164 if (obj->fence_reg != I915_FENCE_REG_NONE)
166 seq_printf(m, " (fence: %d)", obj->fence_reg); 165 seq_printf(m, " (fence: %d)", obj->fence_reg);
167 list_for_each_entry(vma, &obj->vma_list, vma_link) { 166 list_for_each_entry(vma, &obj->vma_list, obj_link) {
168 seq_printf(m, " (%sgtt offset: %08llx, size: %08llx", 167 seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
169 i915_is_ggtt(vma->vm) ? "g" : "pp", 168 i915_is_ggtt(vma->vm) ? "g" : "pp",
170 vma->node.start, vma->node.size); 169 vma->node.start, vma->node.size);
@@ -230,7 +229,7 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data)
230 } 229 }
231 230
232 total_obj_size = total_gtt_size = count = 0; 231 total_obj_size = total_gtt_size = count = 0;
233 list_for_each_entry(vma, head, mm_list) { 232 list_for_each_entry(vma, head, vm_link) {
234 seq_printf(m, " "); 233 seq_printf(m, " ");
235 describe_obj(m, vma->obj); 234 describe_obj(m, vma->obj);
236 seq_printf(m, "\n"); 235 seq_printf(m, "\n");
@@ -342,7 +341,7 @@ static int per_file_stats(int id, void *ptr, void *data)
342 stats->shared += obj->base.size; 341 stats->shared += obj->base.size;
343 342
344 if (USES_FULL_PPGTT(obj->base.dev)) { 343 if (USES_FULL_PPGTT(obj->base.dev)) {
345 list_for_each_entry(vma, &obj->vma_list, vma_link) { 344 list_for_each_entry(vma, &obj->vma_list, obj_link) {
346 struct i915_hw_ppgtt *ppgtt; 345 struct i915_hw_ppgtt *ppgtt;
347 346
348 if (!drm_mm_node_allocated(&vma->node)) 347 if (!drm_mm_node_allocated(&vma->node))
@@ -454,12 +453,12 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
454 count, mappable_count, size, mappable_size); 453 count, mappable_count, size, mappable_size);
455 454
456 size = count = mappable_size = mappable_count = 0; 455 size = count = mappable_size = mappable_count = 0;
457 count_vmas(&vm->active_list, mm_list); 456 count_vmas(&vm->active_list, vm_link);
458 seq_printf(m, " %u [%u] active objects, %llu [%llu] bytes\n", 457 seq_printf(m, " %u [%u] active objects, %llu [%llu] bytes\n",
459 count, mappable_count, size, mappable_size); 458 count, mappable_count, size, mappable_size);
460 459
461 size = count = mappable_size = mappable_count = 0; 460 size = count = mappable_size = mappable_count = 0;
462 count_vmas(&vm->inactive_list, mm_list); 461 count_vmas(&vm->inactive_list, vm_link);
463 seq_printf(m, " %u [%u] inactive objects, %llu [%llu] bytes\n", 462 seq_printf(m, " %u [%u] inactive objects, %llu [%llu] bytes\n",
464 count, mappable_count, size, mappable_size); 463 count, mappable_count, size, mappable_size);
465 464
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f68f34606f2f..bcd2e481d014 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -138,10 +138,10 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
138 138
139 pinned = 0; 139 pinned = 0;
140 mutex_lock(&dev->struct_mutex); 140 mutex_lock(&dev->struct_mutex);
141 list_for_each_entry(vma, &ggtt->base.active_list, mm_list) 141 list_for_each_entry(vma, &ggtt->base.active_list, vm_link)
142 if (vma->pin_count) 142 if (vma->pin_count)
143 pinned += vma->node.size; 143 pinned += vma->node.size;
144 list_for_each_entry(vma, &ggtt->base.inactive_list, mm_list) 144 list_for_each_entry(vma, &ggtt->base.inactive_list, vm_link)
145 if (vma->pin_count) 145 if (vma->pin_count)
146 pinned += vma->node.size; 146 pinned += vma->node.size;
147 mutex_unlock(&dev->struct_mutex); 147 mutex_unlock(&dev->struct_mutex);
@@ -272,7 +272,7 @@ drop_pages(struct drm_i915_gem_object *obj)
272 int ret; 272 int ret;
273 273
274 drm_gem_object_reference(&obj->base); 274 drm_gem_object_reference(&obj->base);
275 list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) 275 list_for_each_entry_safe(vma, next, &obj->vma_list, obj_link)
276 if (i915_vma_unbind(vma)) 276 if (i915_vma_unbind(vma))
277 break; 277 break;
278 278
@@ -2416,7 +2416,7 @@ void i915_vma_move_to_active(struct i915_vma *vma,
2416 list_move_tail(&obj->ring_list[ring->id], &ring->active_list); 2416 list_move_tail(&obj->ring_list[ring->id], &ring->active_list);
2417 i915_gem_request_assign(&obj->last_read_req[ring->id], req); 2417 i915_gem_request_assign(&obj->last_read_req[ring->id], req);
2418 2418
2419 list_move_tail(&vma->mm_list, &vma->vm->active_list); 2419 list_move_tail(&vma->vm_link, &vma->vm->active_list);
2420} 2420}
2421 2421
2422static void 2422static void
@@ -2454,9 +2454,9 @@ i915_gem_object_retire__read(struct drm_i915_gem_object *obj, int ring)
2454 list_move_tail(&obj->global_list, 2454 list_move_tail(&obj->global_list,
2455 &to_i915(obj->base.dev)->mm.bound_list); 2455 &to_i915(obj->base.dev)->mm.bound_list);
2456 2456
2457 list_for_each_entry(vma, &obj->vma_list, vma_link) { 2457 list_for_each_entry(vma, &obj->vma_list, obj_link) {
2458 if (!list_empty(&vma->mm_list)) 2458 if (!list_empty(&vma->vm_link))
2459 list_move_tail(&vma->mm_list, &vma->vm->inactive_list); 2459 list_move_tail(&vma->vm_link, &vma->vm->inactive_list);
2460 } 2460 }
2461 2461
2462 i915_gem_request_assign(&obj->last_fenced_req, NULL); 2462 i915_gem_request_assign(&obj->last_fenced_req, NULL);
@@ -3317,7 +3317,7 @@ static int __i915_vma_unbind(struct i915_vma *vma, bool wait)
3317 struct drm_i915_private *dev_priv = obj->base.dev->dev_private; 3317 struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
3318 int ret; 3318 int ret;
3319 3319
3320 if (list_empty(&vma->vma_link)) 3320 if (list_empty(&vma->obj_link))
3321 return 0; 3321 return 0;
3322 3322
3323 if (!drm_mm_node_allocated(&vma->node)) { 3323 if (!drm_mm_node_allocated(&vma->node)) {
@@ -3351,7 +3351,7 @@ static int __i915_vma_unbind(struct i915_vma *vma, bool wait)
3351 vma->vm->unbind_vma(vma); 3351 vma->vm->unbind_vma(vma);
3352 vma->bound = 0; 3352 vma->bound = 0;
3353 3353
3354 list_del_init(&vma->mm_list); 3354 list_del_init(&vma->vm_link);
3355 if (i915_is_ggtt(vma->vm)) { 3355 if (i915_is_ggtt(vma->vm)) {
3356 if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL) { 3356 if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL) {
3357 obj->map_and_fenceable = false; 3357 obj->map_and_fenceable = false;
@@ -3609,7 +3609,7 @@ search_free:
3609 goto err_remove_node; 3609 goto err_remove_node;
3610 3610
3611 list_move_tail(&obj->global_list, &dev_priv->mm.bound_list); 3611 list_move_tail(&obj->global_list, &dev_priv->mm.bound_list);
3612 list_add_tail(&vma->mm_list, &vm->inactive_list); 3612 list_add_tail(&vma->vm_link, &vm->inactive_list);
3613 3613
3614 return vma; 3614 return vma;
3615 3615
@@ -3774,7 +3774,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
3774 /* And bump the LRU for this access */ 3774 /* And bump the LRU for this access */
3775 vma = i915_gem_obj_to_ggtt(obj); 3775 vma = i915_gem_obj_to_ggtt(obj);
3776 if (vma && drm_mm_node_allocated(&vma->node) && !obj->active) 3776 if (vma && drm_mm_node_allocated(&vma->node) && !obj->active)
3777 list_move_tail(&vma->mm_list, 3777 list_move_tail(&vma->vm_link,
3778 &to_i915(obj->base.dev)->gtt.base.inactive_list); 3778 &to_i915(obj->base.dev)->gtt.base.inactive_list);
3779 3779
3780 return 0; 3780 return 0;
@@ -3809,7 +3809,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
3809 * catch the issue of the CS prefetch crossing page boundaries and 3809 * catch the issue of the CS prefetch crossing page boundaries and
3810 * reading an invalid PTE on older architectures. 3810 * reading an invalid PTE on older architectures.
3811 */ 3811 */
3812 list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) { 3812 list_for_each_entry_safe(vma, next, &obj->vma_list, obj_link) {
3813 if (!drm_mm_node_allocated(&vma->node)) 3813 if (!drm_mm_node_allocated(&vma->node))
3814 continue; 3814 continue;
3815 3815
@@ -3872,7 +3872,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
3872 */ 3872 */
3873 } 3873 }
3874 3874
3875 list_for_each_entry(vma, &obj->vma_list, vma_link) { 3875 list_for_each_entry(vma, &obj->vma_list, obj_link) {
3876 if (!drm_mm_node_allocated(&vma->node)) 3876 if (!drm_mm_node_allocated(&vma->node))
3877 continue; 3877 continue;
3878 3878
@@ -3882,7 +3882,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
3882 } 3882 }
3883 } 3883 }
3884 3884
3885 list_for_each_entry(vma, &obj->vma_list, vma_link) 3885 list_for_each_entry(vma, &obj->vma_list, obj_link)
3886 vma->node.color = cache_level; 3886 vma->node.color = cache_level;
3887 obj->cache_level = cache_level; 3887 obj->cache_level = cache_level;
3888 3888
@@ -4556,7 +4556,7 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj)
4556 4556
4557 trace_i915_gem_object_destroy(obj); 4557 trace_i915_gem_object_destroy(obj);
4558 4558
4559 list_for_each_entry_safe(vma, next, &obj->vma_list, vma_link) { 4559 list_for_each_entry_safe(vma, next, &obj->vma_list, obj_link) {
4560 int ret; 4560 int ret;
4561 4561
4562 vma->pin_count = 0; 4562 vma->pin_count = 0;
@@ -4613,7 +4613,7 @@ struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
4613 struct i915_address_space *vm) 4613 struct i915_address_space *vm)
4614{ 4614{
4615 struct i915_vma *vma; 4615 struct i915_vma *vma;
4616 list_for_each_entry(vma, &obj->vma_list, vma_link) { 4616 list_for_each_entry(vma, &obj->vma_list, obj_link) {
4617 if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL && 4617 if (vma->ggtt_view.type == I915_GGTT_VIEW_NORMAL &&
4618 vma->vm == vm) 4618 vma->vm == vm)
4619 return vma; 4619 return vma;
@@ -4630,7 +4630,7 @@ struct i915_vma *i915_gem_obj_to_ggtt_view(struct drm_i915_gem_object *obj,
4630 if (WARN_ONCE(!view, "no view specified")) 4630 if (WARN_ONCE(!view, "no view specified"))
4631 return ERR_PTR(-EINVAL); 4631 return ERR_PTR(-EINVAL);
4632 4632
4633 list_for_each_entry(vma, &obj->vma_list, vma_link) 4633 list_for_each_entry(vma, &obj->vma_list, obj_link)
4634 if (vma->vm == ggtt && 4634 if (vma->vm == ggtt &&
4635 i915_ggtt_view_equal(&vma->ggtt_view, view)) 4635 i915_ggtt_view_equal(&vma->ggtt_view, view))
4636 return vma; 4636 return vma;
@@ -4651,7 +4651,7 @@ void i915_gem_vma_destroy(struct i915_vma *vma)
4651 if (!i915_is_ggtt(vm)) 4651 if (!i915_is_ggtt(vm))
4652 i915_ppgtt_put(i915_vm_to_ppgtt(vm)); 4652 i915_ppgtt_put(i915_vm_to_ppgtt(vm));
4653 4653
4654 list_del(&vma->vma_link); 4654 list_del(&vma->obj_link);
4655 4655
4656 kmem_cache_free(to_i915(vma->obj->base.dev)->vmas, vma); 4656 kmem_cache_free(to_i915(vma->obj->base.dev)->vmas, vma);
4657} 4657}
@@ -5201,7 +5201,7 @@ u64 i915_gem_obj_offset(struct drm_i915_gem_object *o,
5201 5201
5202 WARN_ON(vm == &dev_priv->mm.aliasing_ppgtt->base); 5202 WARN_ON(vm == &dev_priv->mm.aliasing_ppgtt->base);
5203 5203
5204 list_for_each_entry(vma, &o->vma_list, vma_link) { 5204 list_for_each_entry(vma, &o->vma_list, obj_link) {
5205 if (i915_is_ggtt(vma->vm) && 5205 if (i915_is_ggtt(vma->vm) &&
5206 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL) 5206 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
5207 continue; 5207 continue;
@@ -5220,7 +5220,7 @@ u64 i915_gem_obj_ggtt_offset_view(struct drm_i915_gem_object *o,
5220 struct i915_address_space *ggtt = i915_obj_to_ggtt(o); 5220 struct i915_address_space *ggtt = i915_obj_to_ggtt(o);
5221 struct i915_vma *vma; 5221 struct i915_vma *vma;
5222 5222
5223 list_for_each_entry(vma, &o->vma_list, vma_link) 5223 list_for_each_entry(vma, &o->vma_list, obj_link)
5224 if (vma->vm == ggtt && 5224 if (vma->vm == ggtt &&
5225 i915_ggtt_view_equal(&vma->ggtt_view, view)) 5225 i915_ggtt_view_equal(&vma->ggtt_view, view))
5226 return vma->node.start; 5226 return vma->node.start;
@@ -5234,7 +5234,7 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
5234{ 5234{
5235 struct i915_vma *vma; 5235 struct i915_vma *vma;
5236 5236
5237 list_for_each_entry(vma, &o->vma_list, vma_link) { 5237 list_for_each_entry(vma, &o->vma_list, obj_link) {
5238 if (i915_is_ggtt(vma->vm) && 5238 if (i915_is_ggtt(vma->vm) &&
5239 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL) 5239 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
5240 continue; 5240 continue;
@@ -5251,7 +5251,7 @@ bool i915_gem_obj_ggtt_bound_view(struct drm_i915_gem_object *o,
5251 struct i915_address_space *ggtt = i915_obj_to_ggtt(o); 5251 struct i915_address_space *ggtt = i915_obj_to_ggtt(o);
5252 struct i915_vma *vma; 5252 struct i915_vma *vma;
5253 5253
5254 list_for_each_entry(vma, &o->vma_list, vma_link) 5254 list_for_each_entry(vma, &o->vma_list, obj_link)
5255 if (vma->vm == ggtt && 5255 if (vma->vm == ggtt &&
5256 i915_ggtt_view_equal(&vma->ggtt_view, view) && 5256 i915_ggtt_view_equal(&vma->ggtt_view, view) &&
5257 drm_mm_node_allocated(&vma->node)) 5257 drm_mm_node_allocated(&vma->node))
@@ -5264,7 +5264,7 @@ bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o)
5264{ 5264{
5265 struct i915_vma *vma; 5265 struct i915_vma *vma;
5266 5266
5267 list_for_each_entry(vma, &o->vma_list, vma_link) 5267 list_for_each_entry(vma, &o->vma_list, obj_link)
5268 if (drm_mm_node_allocated(&vma->node)) 5268 if (drm_mm_node_allocated(&vma->node))
5269 return true; 5269 return true;
5270 5270
@@ -5281,7 +5281,7 @@ unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
5281 5281
5282 BUG_ON(list_empty(&o->vma_list)); 5282 BUG_ON(list_empty(&o->vma_list));
5283 5283
5284 list_for_each_entry(vma, &o->vma_list, vma_link) { 5284 list_for_each_entry(vma, &o->vma_list, obj_link) {
5285 if (i915_is_ggtt(vma->vm) && 5285 if (i915_is_ggtt(vma->vm) &&
5286 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL) 5286 vma->ggtt_view.type != I915_GGTT_VIEW_NORMAL)
5287 continue; 5287 continue;
@@ -5294,7 +5294,7 @@ unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
5294bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj) 5294bool i915_gem_obj_is_pinned(struct drm_i915_gem_object *obj)
5295{ 5295{
5296 struct i915_vma *vma; 5296 struct i915_vma *vma;
5297 list_for_each_entry(vma, &obj->vma_list, vma_link) 5297 list_for_each_entry(vma, &obj->vma_list, obj_link)
5298 if (vma->pin_count > 0) 5298 if (vma->pin_count > 0)
5299 return true; 5299 return true;
5300 5300
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 4be2ce917f54..5dd84e148bba 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -142,7 +142,7 @@ static void i915_gem_context_clean(struct intel_context *ctx)
142 return; 142 return;
143 143
144 list_for_each_entry_safe(vma, next, &ppgtt->base.inactive_list, 144 list_for_each_entry_safe(vma, next, &ppgtt->base.inactive_list,
145 mm_list) { 145 vm_link) {
146 if (WARN_ON(__i915_vma_unbind_no_wait(vma))) 146 if (WARN_ON(__i915_vma_unbind_no_wait(vma)))
147 break; 147 break;
148 } 148 }
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 07c6e4d320c9..ea1f8d1bd228 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -116,7 +116,7 @@ i915_gem_evict_something(struct drm_device *dev, struct i915_address_space *vm,
116 116
117search_again: 117search_again:
118 /* First see if there is a large enough contiguous idle region... */ 118 /* First see if there is a large enough contiguous idle region... */
119 list_for_each_entry(vma, &vm->inactive_list, mm_list) { 119 list_for_each_entry(vma, &vm->inactive_list, vm_link) {
120 if (mark_free(vma, &unwind_list)) 120 if (mark_free(vma, &unwind_list))
121 goto found; 121 goto found;
122 } 122 }
@@ -125,7 +125,7 @@ search_again:
125 goto none; 125 goto none;
126 126
127 /* Now merge in the soon-to-be-expired objects... */ 127 /* Now merge in the soon-to-be-expired objects... */
128 list_for_each_entry(vma, &vm->active_list, mm_list) { 128 list_for_each_entry(vma, &vm->active_list, vm_link) {
129 if (mark_free(vma, &unwind_list)) 129 if (mark_free(vma, &unwind_list))
130 goto found; 130 goto found;
131 } 131 }
@@ -270,7 +270,7 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle)
270 WARN_ON(!list_empty(&vm->active_list)); 270 WARN_ON(!list_empty(&vm->active_list));
271 } 271 }
272 272
273 list_for_each_entry_safe(vma, next, &vm->inactive_list, mm_list) 273 list_for_each_entry_safe(vma, next, &vm->inactive_list, vm_link)
274 if (vma->pin_count == 0) 274 if (vma->pin_count == 0)
275 WARN_ON(i915_vma_unbind(vma)); 275 WARN_ON(i915_vma_unbind(vma));
276 276
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 9127f8f3561c..68d3af6854d1 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2758,7 +2758,7 @@ static int i915_gem_setup_global_gtt(struct drm_device *dev,
2758 } 2758 }
2759 vma->bound |= GLOBAL_BIND; 2759 vma->bound |= GLOBAL_BIND;
2760 __i915_vma_set_map_and_fenceable(vma); 2760 __i915_vma_set_map_and_fenceable(vma);
2761 list_add_tail(&vma->mm_list, &ggtt_vm->inactive_list); 2761 list_add_tail(&vma->vm_link, &ggtt_vm->inactive_list);
2762 } 2762 }
2763 2763
2764 /* Clear any non-preallocated blocks */ 2764 /* Clear any non-preallocated blocks */
@@ -3258,7 +3258,7 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev)
3258 vm = &dev_priv->gtt.base; 3258 vm = &dev_priv->gtt.base;
3259 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { 3259 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
3260 flush = false; 3260 flush = false;
3261 list_for_each_entry(vma, &obj->vma_list, vma_link) { 3261 list_for_each_entry(vma, &obj->vma_list, obj_link) {
3262 if (vma->vm != vm) 3262 if (vma->vm != vm)
3263 continue; 3263 continue;
3264 3264
@@ -3314,8 +3314,8 @@ __i915_gem_vma_create(struct drm_i915_gem_object *obj,
3314 if (vma == NULL) 3314 if (vma == NULL)
3315 return ERR_PTR(-ENOMEM); 3315 return ERR_PTR(-ENOMEM);
3316 3316
3317 INIT_LIST_HEAD(&vma->vma_link); 3317 INIT_LIST_HEAD(&vma->vm_link);
3318 INIT_LIST_HEAD(&vma->mm_list); 3318 INIT_LIST_HEAD(&vma->obj_link);
3319 INIT_LIST_HEAD(&vma->exec_list); 3319 INIT_LIST_HEAD(&vma->exec_list);
3320 vma->vm = vm; 3320 vma->vm = vm;
3321 vma->obj = obj; 3321 vma->obj = obj;
@@ -3323,7 +3323,7 @@ __i915_gem_vma_create(struct drm_i915_gem_object *obj,
3323 if (i915_is_ggtt(vm)) 3323 if (i915_is_ggtt(vm))
3324 vma->ggtt_view = *ggtt_view; 3324 vma->ggtt_view = *ggtt_view;
3325 3325
3326 list_add_tail(&vma->vma_link, &obj->vma_list); 3326 list_add_tail(&vma->obj_link, &obj->vma_list);
3327 if (!i915_is_ggtt(vm)) 3327 if (!i915_is_ggtt(vm))
3328 i915_ppgtt_get(i915_vm_to_ppgtt(vm)); 3328 i915_ppgtt_get(i915_vm_to_ppgtt(vm));
3329 3329
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 368d111aa9c5..31eb0b261fbf 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -194,9 +194,9 @@ struct i915_vma {
194 struct i915_ggtt_view ggtt_view; 194 struct i915_ggtt_view ggtt_view;
195 195
196 /** This object's place on the active/inactive lists */ 196 /** This object's place on the active/inactive lists */
197 struct list_head mm_list; 197 struct list_head vm_link;
198 198
199 struct list_head vma_link; /* Link in the object's VMA list */ 199 struct list_head obj_link; /* Link in the object's VMA list */
200 200
201 /** This vma's place in the batchbuffer or on the eviction list */ 201 /** This vma's place in the batchbuffer or on the eviction list */
202 struct list_head exec_list; 202 struct list_head exec_list;
diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 58c1e592bbdb..d3c473ffb90a 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -52,7 +52,7 @@ static int num_vma_bound(struct drm_i915_gem_object *obj)
52 struct i915_vma *vma; 52 struct i915_vma *vma;
53 int count = 0; 53 int count = 0;
54 54
55 list_for_each_entry(vma, &obj->vma_list, vma_link) { 55 list_for_each_entry(vma, &obj->vma_list, obj_link) {
56 if (drm_mm_node_allocated(&vma->node)) 56 if (drm_mm_node_allocated(&vma->node))
57 count++; 57 count++;
58 if (vma->pin_count) 58 if (vma->pin_count)
@@ -176,7 +176,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
176 176
177 /* For the unbound phase, this should be a no-op! */ 177 /* For the unbound phase, this should be a no-op! */
178 list_for_each_entry_safe(vma, v, 178 list_for_each_entry_safe(vma, v,
179 &obj->vma_list, vma_link) 179 &obj->vma_list, obj_link)
180 if (i915_vma_unbind(vma)) 180 if (i915_vma_unbind(vma))
181 break; 181 break;
182 182
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index feec0f80d8ef..2e6e9fb6f80d 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -697,7 +697,7 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
697 697
698 vma->bound |= GLOBAL_BIND; 698 vma->bound |= GLOBAL_BIND;
699 __i915_vma_set_map_and_fenceable(vma); 699 __i915_vma_set_map_and_fenceable(vma);
700 list_add_tail(&vma->mm_list, &ggtt->inactive_list); 700 list_add_tail(&vma->vm_link, &ggtt->inactive_list);
701 } 701 }
702 702
703 list_add_tail(&obj->global_list, &dev_priv->mm.bound_list); 703 list_add_tail(&obj->global_list, &dev_priv->mm.bound_list);
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c
index 7107f2fd38f5..4b09c840d493 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -78,7 +78,7 @@ static void cancel_userptr(struct work_struct *work)
78 was_interruptible = dev_priv->mm.interruptible; 78 was_interruptible = dev_priv->mm.interruptible;
79 dev_priv->mm.interruptible = false; 79 dev_priv->mm.interruptible = false;
80 80
81 list_for_each_entry_safe(vma, tmp, &obj->vma_list, vma_link) { 81 list_for_each_entry_safe(vma, tmp, &obj->vma_list, obj_link) {
82 int ret = i915_vma_unbind(vma); 82 int ret = i915_vma_unbind(vma);
83 WARN_ON(ret && ret != -EIO); 83 WARN_ON(ret && ret != -EIO);
84 } 84 }
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 978c026963b8..831895b8cb75 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -736,7 +736,7 @@ static u32 capture_active_bo(struct drm_i915_error_buffer *err,
736 struct i915_vma *vma; 736 struct i915_vma *vma;
737 int i = 0; 737 int i = 0;
738 738
739 list_for_each_entry(vma, head, mm_list) { 739 list_for_each_entry(vma, head, vm_link) {
740 capture_bo(err++, vma); 740 capture_bo(err++, vma);
741 if (++i == count) 741 if (++i == count)
742 break; 742 break;
@@ -759,7 +759,7 @@ static u32 capture_pinned_bo(struct drm_i915_error_buffer *err,
759 if (err == last) 759 if (err == last)
760 break; 760 break;
761 761
762 list_for_each_entry(vma, &obj->vma_list, vma_link) 762 list_for_each_entry(vma, &obj->vma_list, obj_link)
763 if (vma->vm == vm && vma->pin_count > 0) 763 if (vma->vm == vm && vma->pin_count > 0)
764 capture_bo(err++, vma); 764 capture_bo(err++, vma);
765 } 765 }
@@ -1127,12 +1127,12 @@ static void i915_gem_capture_vm(struct drm_i915_private *dev_priv,
1127 int i; 1127 int i;
1128 1128
1129 i = 0; 1129 i = 0;
1130 list_for_each_entry(vma, &vm->active_list, mm_list) 1130 list_for_each_entry(vma, &vm->active_list, vm_link)
1131 i++; 1131 i++;
1132 error->active_bo_count[ndx] = i; 1132 error->active_bo_count[ndx] = i;
1133 1133
1134 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { 1134 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
1135 list_for_each_entry(vma, &obj->vma_list, vma_link) 1135 list_for_each_entry(vma, &obj->vma_list, obj_link)
1136 if (vma->vm == vm && vma->pin_count > 0) 1136 if (vma->vm == vm && vma->pin_count > 0)
1137 i++; 1137 i++;
1138 } 1138 }