From a02bbd8700690c98c6cf3ae98dd7ee3da9887b0a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 11 Dec 2011 10:34:37 +0000 Subject: [PATCH] sna: Only transfer the bo if the src/dst are of matching size If the src replaces the dst, it could just be a much larger pixmap! Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 0b726269..861cbe75 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2013,7 +2013,9 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, replaces)); if (replaces) { - if (dst_priv && !dst_priv->pinned && + if (src_pixmap->drawable.width == dst_pixmap->drawable.width && + src_pixmap->drawable.height == dst_pixmap->drawable.height && + dst_priv && !dst_priv->pinned && 0 && src_priv && !src_priv->pinned && src_priv->gpu_damage == NULL) { if (sna_pixmap_move_to_gpu(src_pixmap)) {