Signed-off-by: Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index afdbbd9..b92e8ea 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3206,7 +3206,9 @@ i915_gem_object_set_cpu_read_domain_range(struct 
drm_i915_gem_object *obj,
        uint32_t old_read_domains;
        int i, ret;
 
-       if (offset == 0 && size == obj->base.size)
+       /* If we touch all pages, just move the bo entirely to the CPU. */
+       if ((offset & PAGE_MASK) == 0 &&
+           ALIGN(offset+size, PAGE_SIZE) == obj->base.size)
                return i915_gem_object_set_to_cpu_domain(obj, 0);
 
        ret = i915_gem_object_flush_gpu_write_domain(obj);
-- 
1.7.5.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to