summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-06-27 20:24:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-06-27 20:24:45 +0100
commit41f401ae27ee753d66aae341be60b27167bc5b62 (patch)
treef8aced1f945c5f4f53e722882e8c5abdd75de95a /src/sna/sna_dri2.c
parent6fc7b16b931946995ffab99c5216810417cfeb99 (diff)
sna/dri2: Early return for empty DRI2CopyRegion
It's possible if the Window is redirected whilst the client render for its backbuffer to no longer overlap with the visible Window. In this case, we attempt to copy an empty region, but it debugging is enabled this throws an assert. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91120 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r--src/sna/sna_dri2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index b2814dad..1c3716a3 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1188,11 +1188,12 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
scratch.height = src_priv->size >> 16;
src_draw = &scratch;
- DBG(("%s: source size %dx%d, region size %dx%d\n",
+ DBG(("%s: source size %dx%d, region size %dx%d, src offset %dx%d\n",
__FUNCTION__,
scratch.width, scratch.height,
clip.extents.x2 - clip.extents.x1,
- clip.extents.y2 - clip.extents.y1));
+ clip.extents.y2 - clip.extents.y1,
+ -sx, -sy));
source.extents.x1 = -sx;
source.extents.y1 = -sy;
@@ -1203,6 +1204,10 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
assert(region == NULL || region == &clip);
pixman_region_intersect(&clip, &clip, &source);
+ if (!pixman_region_not_empty(&clip)) {
+ DBG(("%s: region doesn't overlap pixmap\n", __FUNCTION__));
+ return NULL;
+ }
}
dst_bo = dst_priv->bo;