From 413e3950954b44c55c496bdf01dda44d51b38f52 Mon Sep 17 00:00:00 2001 From: christos Date: Mon, 3 Nov 2014 16:50:20 +0000 Subject: [PATCH] When moving an object to inactive, make sure that we first flush it from the GTT domain in case it belonged there. Also, fix some compilation issues when turning on WATCH_GTT and WATCH_LISTS, although this is a lost cause; most of the code has rotted beyond repair. --- sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c index 2cd6f8e48c39..dbef8c6d3cb5 100644 --- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c +++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -2838,10 +2839,18 @@ void i915_vma_move_to_active(struct i915_vma *vma, static void i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj) { - struct drm_i915_private *dev_priv = obj->base.dev->dev_private; + struct drm_device *dev = obj->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; struct i915_address_space *vm; struct i915_vma *vma; + if ((obj->base.write_domain & I915_GEM_DOMAIN_GTT) != 0) { +#if 0 + printk(KERN_ERR "%s: %p 0x%x flushing gtt\n", __func__, obj, + obj->base.write_domain); +#endif + i915_gem_object_flush_gtt_write_domain(obj); + } BUG_ON(obj->base.write_domain & ~I915_GEM_GPU_DOMAINS); BUG_ON(!obj->active); @@ -3948,7 +3957,7 @@ static void i915_gem_verify_gtt(struct drm_device *dev) struct drm_i915_gem_object *obj; int err = 0; - list_for_each_entry(obj, &dev_priv->mm.gtt_list, global_list) { + list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { if (obj->gtt_space == NULL) { printk(KERN_ERR "object found on GTT list with no space reserved\n"); err++;