From 3475ee6ae2086e27f1c3996e0d7a647746c275a6 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 1 Mar 2013 21:56:30 +1100 Subject: move i915_gem_object_unbind closer to linux --- sys/dev/pci/drm/i915_gem.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/drm/i915_gem.c b/sys/dev/pci/drm/i915_gem.c index 89003c941dc..9f8b086c522 100644 --- a/sys/dev/pci/drm/i915_gem.c +++ b/sys/dev/pci/drm/i915_gem.c @@ -1292,17 +1292,16 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj) return (EINVAL); } + ret = i915_gem_object_finish_gpu(obj); + if (ret) + return ret; + KASSERT(obj->madv != __I915_MADV_PURGED); i915_gem_object_finish_gtt(obj); - /* Move the object to the CPU domain to ensure that - * any possible CPU writes while it's not in the GTT - * are flushed when we go to remap it. This will - * also ensure that all pending GPU writes are finished - * before we unbind. - */ - ret = i915_gem_object_set_to_cpu_domain(obj, 1); + /* release the fence reg _after_ flushing */ + ret = i915_gem_object_put_fence(obj); if (ret) return ret; -- cgit v1.2.3