sna: Use CPU mmappings for linear uploads

The other half of the commit that accidentally got included with

commit bb49222a51
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 2 08:25:52 2014 +0100

    sna: Add DBG hints for using inplace CPU mmappings

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-02 10:32:11 +01:00
parent 454367f594
commit d6a412812c
1 changed files with 18 additions and 8 deletions

View File

@ -659,7 +659,7 @@ write_boxes_inplace__tiled(struct kgem *kgem,
uint8_t *dst;
assert(kgem_bo_can_map__cpu(kgem, bo, true));
assert(bo->tiling == I915_TILING_X);
assert(bo->tiling != I915_TILING_Y);
dst = kgem_bo_map__cpu(kgem, bo);
if (dst == NULL)
@ -670,13 +670,23 @@ write_boxes_inplace__tiled(struct kgem *kgem,
if (sigtrap_get())
return false;
do {
memcpy_to_tiled_x(kgem, src, dst, bpp, stride, bo->pitch,
box->x1 + src_dx, box->y1 + src_dy,
box->x1 + dst_dx, box->y1 + dst_dy,
box->x2 - box->x1, box->y2 - box->y1);
box++;
} while (--n);
if (bo->tiling) {
do {
memcpy_to_tiled_x(kgem, src, dst, bpp, stride, bo->pitch,
box->x1 + src_dx, box->y1 + src_dy,
box->x1 + dst_dx, box->y1 + dst_dy,
box->x2 - box->x1, box->y2 - box->y1);
box++;
} while (--n);
} else {
do {
memcpy_blt(src, dst, bpp, stride, bo->pitch,
box->x1 + src_dx, box->y1 + src_dy,
box->x1 + dst_dx, box->y1 + dst_dy,
box->x2 - box->x1, box->y2 - box->y1);
box++;
} while (--n);
}
sigtrap_put();
return true;