summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-07 13:57:21 +1000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-07 09:37:51 +0000
commitb8c9598294eaa16e0d1578ad98896f6ec5ba37cf (patch)
treed73a6383c524843251d3eccd863b4fd533d0d0d3
parentc789d06cf8a0debc67058d7be1483f5b542e2baa (diff)
sna: fixup damage posting to be done correctly around slave pixmap
Copied from commit c789d06cf8a0debc67058d7be1483f5b542e2baa Author: Dave Airlie <airlied@redhat.com> Date: Mon Jan 7 13:57:21 2013 +1000 This fixes the damage posting to happen in the correct ordering, not sure if this fixes anything, but it should make things more consistent.
-rw-r--r--src/sna/sna_accel.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 227db7be..c8268150 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -13948,6 +13948,8 @@ static void sna_accel_post_damage(struct sna *sna)
region.extents.x2, region.extents.y2));
RegionIntersect(&region, &region, damage);
+ RegionTranslate(&region, -dirty->x, -dirty->y);
+ DamageRegionAppend(&dirty->slave_dst->drawable, &region);
box = REGION_RECTS(&region);
n = REGION_NUM_RECTS(&region);
@@ -13963,30 +13965,31 @@ fallback:
do {
DBG(("%s: copy box (%d, %d)->(%d, %d)x(%d, %d)\n",
__FUNCTION__,
+ box->x1 + dirty->x, box->y1 + dirty->y,
box->x1, box->y1,
- box->x1 - dirty->x, box->y1 - dirty->y,
box->x2 - box->x1, box->y2 - box->y1));
assert(box->x2 > box->x1);
assert(box->y2 > box->y1);
+ assert(box->x1 + dirty->x >= 0);
+ assert(box->y1 + dirty->y >= 0);
+ assert(box->x2 + dirty->x <= src->drawable.width);
+ assert(box->y2 + dirty->y <= src->drawable.height);
+
assert(box->x1 >= 0);
assert(box->y1 >= 0);
assert(box->x2 <= src->drawable.width);
assert(box->y2 <= src->drawable.height);
- assert(box->x1 - dirty->x >= 0);
- assert(box->y1 - dirty->y >= 0);
- assert(box->x2 - dirty->x <= src->drawable.width);
- assert(box->y2 - dirty->y <= src->drawable.height);
-
memcpy_blt(src->devPrivate.ptr,
dst->devPrivate.ptr,
src->drawable.bitsPerPixel,
src->devKind, dst->devKind,
- box->x1, box->y1,
- box->x1 - dirty->x,
- box->y1 - dirty->y,
+ box->x1 + dirty->x,
+ box->y1 + dirty->y,
+ box->x1,
+ box->y1,
box->x2 - box->x1,
box->y2 - box->y1);
box++;
@@ -13999,17 +14002,15 @@ fallback:
goto fallback;
if (!sna->render.copy_boxes(sna, GXcopy,
- src, sna_pixmap_get_bo(src), 0, 0,
- dst, sna_pixmap_get_bo(dst), -dirty->x, -dirty->y,
+ src, sna_pixmap_get_bo(src), dirty->x, dirty->y,
+ dst, sna_pixmap_get_bo(dst),0, 0,
box, n, COPY_LAST))
goto fallback;
flush = true;
}
- RegionTranslate(&region, -dirty->x, -dirty->y);
- DamageRegionAppend(&dirty->slave_dst->drawable, &region);
-
+ DamageRegionProcessPending(&dirty->slave_dst->drawable);
skip:
RegionUninit(&region);
DamageEmpty(dirty->damage);