xf86-video-intel: src/sna/sna_dri2.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Jun 27 12:26:57 PDT 2015


 src/sna/sna_dri2.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 41f401ae27ee753d66aae341be60b27167bc5b62
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 27 20:24:45 2015 +0100

    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 at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index b2814da..1c3716a 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;


More information about the xorg-commit mailing list