diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-24 09:32:18 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-24 09:47:37 +0000 |
commit | efc8d04fc114e9966e5ca00600f9663ecf03a5ca (patch) | |
tree | f46c020e6e947f94bdaf14098c540f564f2336f3 | |
parent | 8c0e7ff5ac996a5a5c0790966084d1c9e1b1f859 (diff) |
sna: Promote an unattached pixmap to the GPU for inplace copies
If we would prefer to perform the copy on the GPU and if the pixmap is
virgin, create a GPU bo for the operation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index ab83fe9c..c66ed66b 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2379,9 +2379,13 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, src_priv ? src_priv->cpu_bo : NULL, replaces)); + if (replaces) + sna_damage_destroy(&dst_priv->cpu_damage); + /* Try to maintain the data on the GPU */ if (dst_priv && dst_priv->gpu_bo == NULL && - src_priv && (src_priv->gpu_bo != NULL || (src_priv->cpu_bo && kgem_bo_is_busy(src_priv->cpu_bo)))) { + ((dst_priv->cpu_damage == NULL && copy_use_gpu_bo(sna, dst_priv, ®ion)) || + (src_priv && (src_priv->gpu_bo != NULL || (src_priv->cpu_bo && kgem_bo_is_busy(src_priv->cpu_bo)))))) { uint32_t tiling = sna_pixmap_choose_tiling(dst_pixmap); DBG(("%s: create dst GPU bo for upload\n", __FUNCTION__)); |