diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-23 13:12:52 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-24 02:29:16 +0200 |
commit | 504c7267a1e84b157cbd7e9c1b805e1bc0c2c846 (patch) | |
tree | 43191ede34f343627904c51dd4e0f8917b9561e1 /drivers/gpu/drm/i915/i915_gem_execbuffer.c | |
parent | 0327d6ba998ca181013a5a1709701a6532a41972 (diff) | |
download | lwn-504c7267a1e84b157cbd7e9c1b805e1bc0c2c846.tar.gz lwn-504c7267a1e84b157cbd7e9c1b805e1bc0c2c846.zip |
drm/i915: Use cpu relocations if the object is in the GTT but not mappable
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>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index f7346d876551..dc87563440f9 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -95,6 +95,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); } |