diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-15 23:26:30 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-16 10:02:43 +0000 |
commit | 6490585f65bde487da7bc41fa5cb1c5a028d0bf4 (patch) | |
tree | 27b306dabc31e1cab0f2d6ec12ffb91e2f4fb4b1 /src/sna/sna_accel.c | |
parent | 3a08f091875f2f0f49697ba9852077094b3a704b (diff) |
sna: Do not force use of the GPU for a copy from a SHM pixmap
As we will undoubtably flush and sync upon the SHM request very shortly
afterwards, we only want to use the GPU for the SHM upload iff it is
currently busy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r-- | src/sna/sna_accel.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index d2f132c0..23acf303 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4258,7 +4258,7 @@ sna_self_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, if (dst != src) get_drawable_deltas(dst, pixmap, &tx, &ty); - if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage)) + if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage) || priv->shm) goto fallback; if (priv->gpu_damage) { @@ -4563,6 +4563,13 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, assert(bo != dst_priv->cpu_bo); + if (src_priv->shm && + alu == GXcopy && + DAMAGE_IS_ALL(src_priv->cpu_damage) && + !__kgem_bo_is_busy(&sna->kgem, src_priv->cpu_bo) && + !__kgem_bo_is_busy(&sna->kgem, bo)) + goto fallback; + RegionTranslate(region, src_dx, src_dy); ret = sna_drawable_move_region_to_cpu(&src_pixmap->drawable, region, |