sna: Move the source region to the CPU for a self-copy fallback CopyArea

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-10-20 17:59:45 +01:00
parent 7ff8b1ba54
commit 60e4e009f9
2 changed files with 10 additions and 8 deletions

View File

@ -270,7 +270,7 @@ fbBlt(FbBits *srcLine, FbStride srcStride, int srcX,
int alu, FbBits pm, int bpp,
Bool reverse, Bool upsidedown)
{
DBG(("%s %dx%d, alu=%d, pm=%d, bpp=%d (reverse=%d, upsidedown=%d)\n",
DBG(("%s %dx%d, alu=%d, pm=%x, bpp=%d (reverse=%d, upsidedown=%d)\n",
__FUNCTION__, width, height, alu, pm, bpp, reverse, upsidedown));
if (alu == GXcopy && pm == FB_ALLONES && ((srcX|dstX|width) & 7) == 0) {

View File

@ -5016,16 +5016,17 @@ sna_fallback_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (!sna_gc_move_to_cpu(gc, dst, region))
return;
RegionTranslate(region, dx, dy);
if (!sna_drawable_move_region_to_cpu(src, region, MOVE_READ))
goto out_gc;
RegionTranslate(region, -dx, -dy);
if (src == dst ||
get_drawable_pixmap(src) == get_drawable_pixmap(dst)) {
DBG(("%s: self-copy\n", __FUNCTION__));
if (!sna_drawable_move_to_cpu(dst, MOVE_WRITE | MOVE_READ))
goto out_gc;
} else {
RegionTranslate(region, dx, dy);
if (!sna_drawable_move_region_to_cpu(src, region, MOVE_READ))
goto out_gc;
RegionTranslate(region, -dx, -dy);
if (!sna_drawable_move_region_to_cpu(dst, region,
drawable_gc_flags(dst, gc, false)))
goto out_gc;
@ -5051,10 +5052,11 @@ sna_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (gc->planemask == 0)
return NULL;
DBG(("%s: src=(%d, %d)x(%d, %d)+(%d, %d) -> dst=(%d, %d)+(%d, %d)\n",
DBG(("%s: src=(%d, %d)x(%d, %d)+(%d, %d) -> dst=(%d, %d)+(%d, %d); alu=%d, pm=%lx\n",
__FUNCTION__,
src_x, src_y, width, height, src->x, src->y,
dst_x, dst_y, dst->x, dst->y));
dst_x, dst_y, dst->x, dst->y,
gc->alu, gc->planemask));
if (FORCE_FALLBACK || !ACCEL_COPY_AREA || wedged(sna) ||
!PM_IS_SOLID(dst, gc->planemask))