bf00e68
From 504c7267a1e84b157cbd7e9c1b805e1bc0c2c846 Mon Sep 17 00:00:00 2001
bf00e68
From: Chris Wilson <chris@chris-wilson.co.uk>
bf00e68
Date: Thu, 23 Aug 2012 13:12:52 +0100
bf00e68
Subject: [PATCH] drm/i915: Use cpu relocations if the object is in the GTT
bf00e68
 but not mappable
bf00e68
bf00e68
This prevents the case of unbinding the object in order to process the
bf00e68
relocations through the GTT and then rebinding it only to then proceed
bf00e68
to use cpu relocations as the object is now in the CPU write domain. By
bf00e68
choosing to use cpu relocations up front, we can therefore avoid the
bf00e68
rebind penalty.
bf00e68
bf00e68
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
bf00e68
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
bf00e68
---
bf00e68
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 1 +
bf00e68
 1 file changed, 1 insertion(+)
bf00e68
bf00e68
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
bf00e68
index f7346d8..dc87563 100644
bf00e68
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
bf00e68
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
bf00e68
@@ -95,6 +95,7 @@ eb_destroy(struct eb_objects *eb)
bf00e68
 static inline int use_cpu_reloc(struct drm_i915_gem_object *obj)
bf00e68
 {
bf00e68
 	return (obj->base.write_domain == I915_GEM_DOMAIN_CPU ||
bf00e68
+		!obj->map_and_fenceable ||
bf00e68
 		obj->cache_level != I915_CACHE_NONE);
bf00e68
 }
bf00e68
 
bf00e68
-- 
bf00e68
1.7.12.1
bf00e68