aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-07-31 20:00:04 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-05 13:04:13 -0400
commit3e12302705a961cfe86d52155b4a8cbb34214748 (patch)
tree7e0bce798c6a0f8c0badac9953cd74a73f61d8e2 /drivers/gpu/drm/i915/i915_gem.c
parent3089c6f239d7d2c4cb2dd5c353e8984cf79af1d7 (diff)
drm/i915: BUG_ON put_pages later
With multiple VMs, the eviction code benefits from being able to blindly put pages without needing to know if there are any entities still holding on to those pages. As such it's preferable to return the -EBUSY before the BUG. Eviction code is the only user for now, but overall it makes sense anyway, IMO. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 56c300f8f9b1..f02d9234bd91 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1668,11 +1668,11 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
1668 if (obj->pages == NULL) 1668 if (obj->pages == NULL)
1669 return 0; 1669 return 0;
1670 1670
1671 BUG_ON(i915_gem_obj_ggtt_bound(obj));
1672
1673 if (obj->pages_pin_count) 1671 if (obj->pages_pin_count)
1674 return -EBUSY; 1672 return -EBUSY;
1675 1673
1674 BUG_ON(i915_gem_obj_ggtt_bound(obj));
1675
1676 /* ->put_pages might need to allocate memory for the bit17 swizzle 1676 /* ->put_pages might need to allocate memory for the bit17 swizzle
1677 * array, hence protect them from being reaped by removing them from gtt 1677 * array, hence protect them from being reaped by removing them from gtt
1678 * lists early. */ 1678 * lists early. */