Skip to contentSkip to conversation

drm/i915: drop duplicate ggtt vma list add in setup_global_gtt

PATCH Applied Jesse Barnes 3 participants 3 messages Nov 12, 2013 – Nov 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: drop duplicate ggtt vma list add in setup_global_gtt

Preallocated, stolen objects will already be added to this list when we first create them.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -1
index f69bdc7..efb5dab 100644
@@ -1124,7 +1124,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
 		if (ret)
 			DRM_DEBUG_KMS("Reservation failed\n");
 		obj->has_global_gtt_mapping = 1;
-		list_add(&vma->vma_link, &obj->vma_list);
 	}
 
 	dev_priv->gtt.base.start = start;
Signature · 1 line
1.8.4.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jesse Barnes

Preallocated, stolen objects will already be added to this list when we first create them.

That had me scratching my head a bit trying to work out where and why stolen objects were explicitly adding themselves to the obj->vma_list.

"Preallocated objects will already have been added to the vma_list when creating their ggtt vma entry, and coincidentally also marked as holding a ggtt mapping. Repeating the vma_list manipulation when setting up the ggtt after preallocation is a recipe for an unhappy kernel."

Quoted 2 lines

drivers/gpu/drm/i915/i915_gem_gtt.c void i915_gem_setup_global_gtt(struct drm_device *dev, · line 1126

Quoted 12 lines
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -0
index f69bdc7..efb5dab 100644
@@ -1124,7 +1124,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
 		if (ret)
 			DRM_DEBUG_KMS("Reservation failed\n");
 		obj->has_global_gtt_mapping = 1;

- obj->has_global_gtt_mapping = 1;

drivers/gpu/drm/i915/i915_gem_gtt.c void i915_gem_setup_global_gtt(struct drm_device *dev, · line 1127

Quoted 2 lines
drivers/gpu/drm/i915/i915_gem_gtt.c +0 -1
-		list_add(&vma->vma_link, &obj->vma_list);
 	}

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
Quoted 11 lines · Chris Wilson
Quoted 2 lines · Jesse Barnes

Preallocated, stolen objects will already be added to this list when we first create them.

That had me scratching my head a bit trying to work out where and why stolen objects were explicitly adding themselves to the obj->vma_list.

"Preallocated objects will already have been added to the vma_list when creating their ggtt vma entry, and coincidentally also marked as holding a ggtt mapping. Repeating the vma_list manipulation when setting up the ggtt after preallocation is a recipe for an unhappy kernel."

Agreed.

Quoted 4 lines
Quoted 3 lines

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch