sna: Only preferentially upload through the GTT for large transfers
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 28 Jun 2014 20:07:08 +0000 (21:07 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 29 Jun 2014 06:13:48 +0000 (07:13 +0100)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index 3e5b036..7a9610c 100644 (file)
@@ -4708,6 +4708,11 @@ try_upload__inplace(PixmapPtr pixmap, RegionRec *region,
                break;
        }
 
+       if (priv->gpu_damage == NULL && !box_inplace(pixmap, &region->extents)) {
+               DBG(("%s: no, too small to bother with using the GTT\n", __FUNCTION__));
+               return false;
+       }
+
        if (!kgem_bo_can_map(&sna->kgem, priv->gpu_bo)) {
                DBG(("%s: no, cannot map through the CPU\n", __FUNCTION__));
                return false;