summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-28 14:19:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-29 06:57:04 +0100
commit80752fb2794faa581d891b24148eaf51c42afd25 (patch)
tree2d429ac78208cb443faa6c5b2071f7734b3abf45 /src/sna/sna_accel.c
parent2a0176379f0ff290d276adc72d44dfddafd96da5 (diff)
sna: Tidy calling memcpy_from_tiled
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.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a5599077..9f5c0b47 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1693,30 +1693,32 @@ static inline bool gpu_bo_download(struct sna *sna,
return false;
if (priv->gpu_bo->tiling) {
+ int bpp = priv->pixmap->drawable.bitsPerPixel;
+ void *dst = priv->pixmap->devPrivate.ptr;
+ int dst_pitch = priv->pixmap->devKind;
+
DBG(("%s: download through a tiled CPU map\n", __FUNCTION__));
do {
DBG(("%s: box (%d, %d), (%d, %d)\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2));
- memcpy_from_tiled_x(&sna->kgem, src,
- priv->pixmap->devPrivate.ptr,
- priv->pixmap->drawable.bitsPerPixel,
- priv->gpu_bo->pitch,
- priv->pixmap->devKind,
+ memcpy_from_tiled_x(&sna->kgem, src, dst, bpp,
+ priv->gpu_bo->pitch, dst_pitch,
box->x1, box->y1,
box->x1, box->y1,
box->x2 - box->x1, box->y2 - box->y1);
box++;
} while (--n);
} else {
+ int bpp = priv->pixmap->drawable.bitsPerPixel;
+ void *dst = priv->pixmap->devPrivate.ptr;
+ int dst_pitch = priv->pixmap->devKind;
+
DBG(("%s: download through a linear CPU map\n", __FUNCTION__));
do {
DBG(("%s: box (%d, %d), (%d, %d)\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2));
- memcpy_blt(src,
- priv->pixmap->devPrivate.ptr,
- priv->pixmap->drawable.bitsPerPixel,
- priv->gpu_bo->pitch,
- priv->pixmap->devKind,
+ memcpy_blt(src, dst, bpp,
+ priv->gpu_bo->pitch, dst_pitch,
box->x1, box->y1,
box->x1, box->y1,
box->x2 - box->x1, box->y2 - box->y1);
@@ -4934,6 +4936,10 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
get_drawable_deltas(drawable, pixmap, &dx, &dy);
x += dx + drawable->x;
y += dy + drawable->y;
+ assert(region->extents.x1 >= x);
+ assert(region->extents.y1 >= y);
+ assert(region->extents.x2 <= x + w);
+ assert(region->extents.y2 <= y + h);
if (try_upload__fast(pixmap, region, x, y, w, h, bits, stride))
return true;