diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 87c2df714f66..3dfc848ff755 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2782,10 +2782,8 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2782 | obj->gtt_space = NULL; | 2782 | obj->gtt_space = NULL; |
2783 | 2783 | ||
2784 | if (ret == -ENOMEM) { | 2784 | if (ret == -ENOMEM) { |
2785 | /* first try to clear up some space from the GTT */ | 2785 | /* first try to reclaim some memory by clearing the GTT */ |
2786 | ret = i915_gem_evict_something(dev, size, | 2786 | ret = i915_gem_evict_everything(dev, false); |
2787 | alignment, | ||
2788 | map_and_fenceable); | ||
2789 | if (ret) { | 2787 | if (ret) { |
2790 | /* now try to shrink everyone else */ | 2788 | /* now try to shrink everyone else */ |
2791 | if (gfpmask) { | 2789 | if (gfpmask) { |
@@ -2793,7 +2791,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2793 | goto search_free; | 2791 | goto search_free; |
2794 | } | 2792 | } |
2795 | 2793 | ||
2796 | return ret; | 2794 | return -ENOMEM; |
2797 | } | 2795 | } |
2798 | 2796 | ||
2799 | goto search_free; | 2797 | goto search_free; |
@@ -2808,9 +2806,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj, | |||
2808 | drm_mm_put_block(obj->gtt_space); | 2806 | drm_mm_put_block(obj->gtt_space); |
2809 | obj->gtt_space = NULL; | 2807 | obj->gtt_space = NULL; |
2810 | 2808 | ||
2811 | ret = i915_gem_evict_something(dev, size, | 2809 | if (i915_gem_evict_everything(dev, false)) |
2812 | alignment, map_and_fenceable); | ||
2813 | if (ret) | ||
2814 | return ret; | 2810 | return ret; |
2815 | 2811 | ||
2816 | goto search_free; | 2812 | goto search_free; |