提交 504c7267 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

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: NChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 0327d6ba
...@@ -95,6 +95,7 @@ eb_destroy(struct eb_objects *eb) ...@@ -95,6 +95,7 @@ eb_destroy(struct eb_objects *eb)
static inline int use_cpu_reloc(struct drm_i915_gem_object *obj) static inline int use_cpu_reloc(struct drm_i915_gem_object *obj)
{ {
return (obj->base.write_domain == I915_GEM_DOMAIN_CPU || return (obj->base.write_domain == I915_GEM_DOMAIN_CPU ||
!obj->map_and_fenceable ||
obj->cache_level != I915_CACHE_NONE); obj->cache_level != I915_CACHE_NONE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册