diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 328f8c9ee9660a2eddf45e500712a78975ba8a8a..4a0d85c78d47ae55a8b21deaa8906f914753a11e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2430,12 +2430,16 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj) int ret; ret = i915_gem_object_flush_gpu_write_domain(obj, false); - if (ret != 0) + if (ret) + return ret; + + ret = i915_gem_object_wait_rendering(obj); + if (ret) return ret; } i915_gem_object_flush_gtt_write_domain(obj); - i915_gem_clear_fence_reg (obj); + i915_gem_clear_fence_reg(obj); return 0; }