aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-03 06:49:00 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-03 11:22:16 -0500
commita2165e312381f35b8abd7dcb8a8ab955bc60d867 (patch)
tree204f81ca8c75aeaadc6c425959ad96247a56958a /drivers/gpu/drm/i915
parent7b01e260a6cad9152eefb44ce64f3a2073af1e6b (diff)
drm/i915: Decouple the object from the unbound list before freeing pages
As we may actually allocate in order to save the physical swizzling bits during the free, we have to be careful not to trigger the shrinker on the same object. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: Added a small comment in the code to really drive the scariness of this patch home.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4ef8b5714337..c1f691958f89 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1696,10 +1696,14 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
1696 if (obj->pages_pin_count) 1696 if (obj->pages_pin_count)
1697 return -EBUSY; 1697 return -EBUSY;
1698 1698
1699 /* ->put_pages might need to allocate memory for the bit17 swizzle
1700 * array, hence protect them from being reaped by removing them from gtt
1701 * lists early. */
1702 list_del(&obj->gtt_list);
1703
1699 ops->put_pages(obj); 1704 ops->put_pages(obj);
1700 obj->pages = NULL; 1705 obj->pages = NULL;
1701 1706
1702 list_del(&obj->gtt_list);
1703 if (i915_gem_object_is_purgeable(obj)) 1707 if (i915_gem_object_is_purgeable(obj))
1704 i915_gem_object_truncate(obj); 1708 i915_gem_object_truncate(obj);
1705 1709