From: Michal Wajdeczko Date: Fri, 19 Jul 2019 15:33:22 +0000 (+0000) Subject: drm/i915/gtt: Don't try to clear failed empty pd allocation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5cad0ddf4b78559221a123c627df291cbe4d3ccd;p=linux.git drm/i915/gtt: Don't try to clear failed empty pd allocation When __gen8_ppgtt_alloc fails without allocating anything we should not try to call __gen8_ppgtt_clear as there is nothing to clear and underlying code will complain with: [ 157.861645] gen8_pd_range:881 GEM_BUG_ON(start >= end) Signed-off-by: Michal Wajdeczko Cc: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20190719153322.10464-1-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 031bcd22f5e6e..0930455824b4c 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -1116,7 +1116,7 @@ static int gen8_ppgtt_alloc(struct i915_address_space *vm, err = __gen8_ppgtt_alloc(vm, i915_vm_to_ppgtt(vm)->pd, &start, start + length, vm->top); - if (unlikely(err)) + if (unlikely(err && from != start)) __gen8_ppgtt_clear(vm, i915_vm_to_ppgtt(vm)->pd, from, start, vm->top);