Module Name:    src
Committed By:   christos
Date:           Mon Nov  3 16:50:20 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.17 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.18
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.17	Sat Nov  1 17:44:51 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Mon Nov  3 11:50:20 2014
@@ -58,6 +58,7 @@
 #include <linux/time.h>
 #include <linux/err.h>
 #include <linux/bitops.h>
+#include <linux/printk.h>
 #include <asm/param.h>
 #include <asm/page.h>
 
@@ -2838,10 +2839,18 @@ void i915_vma_move_to_active(struct i915
 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 d
 	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++;

Reply via email to