diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-17 00:28:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-17 00:28:57 +0100 |
commit | a5b5b4ebb14cab19258dd1cbc12721aaa9df226d (patch) | |
tree | b6d68b7d2dce630922a2d01f312b5cba8aca6ab9 | |
parent | daeb9291e22d94cd2f81b3b56418f0f879531da5 (diff) |
sna: Apply the screen offset for direct upload of a composited pixmap
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38733
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 44a40db4..767453de 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1272,7 +1272,9 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, if (!dst_priv->pinned && replaces) { stride = src_pixmap->devKind; bits = src_pixmap->devPrivate.ptr; - bits += src_dy * stride + src_dx * bpp / 8; + bits += (src_dy + box->y1) * stride + (src_dx + box->x1) * bpp / 8; + assert(src_dy + dst_pixmap->drawable.height <= src_pixmap->drawable.height); + assert(src_dx + dst_pixmap->drawable.width <= src_pixmap->drawable.width); dst_priv->gpu_bo = sna_replace(sna, |