sna/io: Prefer CPU copies on LLC
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 28 Jun 2014 13:23:29 +0000 (14:23 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 29 Jun 2014 05:57:05 +0000 (06:57 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_io.c

index 9e175a7..eaa2052 100644 (file)
@@ -117,6 +117,8 @@ read_boxes_inplace__cpu(struct kgem *kgem,
        if (sigtrap_get())
                return false;
 
+       DBG(("%s x %d\n", __FUNCTION__, n));
+
        if (bo->tiling == I915_TILING_X) {
                do {
                        memcpy_from_tiled_x(kgem, src, dst, bpp, src_pitch, dst_pitch,
@@ -210,10 +212,13 @@ static bool download_inplace(struct kgem *kgem,
        if (FORCE_INPLACE)
                return FORCE_INPLACE > 0;
 
+       if (cpu)
+               return true;
+
        if (kgem->can_blt_cpu && kgem->max_cpu_size)
                return false;
 
-       return !__kgem_bo_is_busy(kgem, bo) || cpu;
+       return !__kgem_bo_is_busy(kgem, bo);
 }
 
 void sna_read_boxes(struct sna *sna, PixmapPtr dst, struct kgem_bo *src_bo,
@@ -253,7 +258,7 @@ void sna_read_boxes(struct sna *sna, PixmapPtr dst, struct kgem_bo *src_bo,
         * this path.
         */
 
-       if (download_inplace(kgem, dst, src_bo, box ,nbox)) {
+       if (download_inplace(kgem, dst, src_bo, boxnbox)) {
 fallback:
                read_boxes_inplace(kgem, dst, src_bo, box, nbox);
                return;