]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: Use cpu relocations if the object is in the GTT but not mappable
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Aug 2012 12:12:52 +0000 (13:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Oct 2012 17:56:16 +0000 (10:56 -0700)
commit 504c7267a1e84b157cbd7e9c1b805e1bc0c2c846 upstream.

This prevents the case of unbinding the object in order to process the
relocations through the GTT and then rebinding it only to then proceed
to use cpu relocations as the object is now in the CPU write domain. By
choosing to use cpu relocations up front, we can therefore avoid the
rebind penalty.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/i915_gem_execbuffer.c

index ff2819ea08130fb98da5f67550a18d9ca3c5974d..cdf46b544d4541b76ee0a3ba4d5597b3db3a5c5d 100644 (file)
@@ -269,6 +269,7 @@ eb_destroy(struct eb_objects *eb)
 static inline int use_cpu_reloc(struct drm_i915_gem_object *obj)
 {
        return (obj->base.write_domain == I915_GEM_DOMAIN_CPU ||
+               !obj->map_and_fenceable ||
                obj->cache_level != I915_CACHE_NONE);
 }