sna: Tweak ordering of userptr temporary mappings for uploads
There are a few more circumstances where the temporary mapping is beneficial, such as pixmaps that are only shadow copies or operations that require reads on the destination. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
c6ad9861f0
commit
36993618b4
|
|
@ -5089,11 +5089,27 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
|
|||
return;
|
||||
}
|
||||
|
||||
if (src_priv) {
|
||||
bool ret;
|
||||
|
||||
RegionTranslate(region, src_dx, src_dy);
|
||||
ret = sna_drawable_move_region_to_cpu(&src_pixmap->drawable,
|
||||
region, MOVE_READ);
|
||||
RegionTranslate(region, -src_dx, -src_dy);
|
||||
if (!ret)
|
||||
goto fallback;
|
||||
|
||||
assert(!src_priv->mapped);
|
||||
if (src_pixmap->devPrivate.ptr == NULL)
|
||||
/* uninitialised!*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (USE_USERPTR_UPLOADS &&
|
||||
src_priv == NULL &&
|
||||
sna->kgem.has_userptr &&
|
||||
box_inplace(src_pixmap, ®ion->extents) &&
|
||||
__kgem_bo_is_busy(&sna->kgem, bo)) {
|
||||
(alu != GXcopy ||
|
||||
(box_inplace(src_pixmap, ®ion->extents)) &&
|
||||
__kgem_bo_is_busy(&sna->kgem, bo))) {
|
||||
struct kgem_bo *src_bo;
|
||||
bool ok = false;
|
||||
|
||||
|
|
@ -5126,22 +5142,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
|
|||
}
|
||||
}
|
||||
|
||||
if (src_priv) {
|
||||
bool ret;
|
||||
|
||||
RegionTranslate(region, src_dx, src_dy);
|
||||
ret = sna_drawable_move_region_to_cpu(&src_pixmap->drawable,
|
||||
region, MOVE_READ);
|
||||
RegionTranslate(region, -src_dx, -src_dy);
|
||||
if (!ret)
|
||||
goto fallback;
|
||||
|
||||
assert(!src_priv->mapped);
|
||||
if (src_pixmap->devPrivate.ptr == NULL)
|
||||
/* uninitialised!*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (alu != GXcopy) {
|
||||
PixmapPtr tmp;
|
||||
struct kgem_bo *src_bo;
|
||||
|
|
|
|||
Loading…
Reference in New Issue