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>
This commit is contained in:
parent
3a08f09187
commit
6490585f65
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue