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

Chris Wilson ickle at kemper.freedesktop.org
Sat Jun 7 23:48:05 PDT 2014


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

New commits:
commit eb8f3a9b345c75023b49512c2db57527d906db7f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jun 8 07:45:52 2014 +0100

    sna/dri2: Check the xchg against the Pixmap size
    
    As the Window may be resized between the client sending the swap request
    and the xchg being processed, we need to validate the swap against the
    final target not the buffers supplied originally by the client.
    
    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 e13e626..f49bd19 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1467,13 +1467,17 @@ can_xchg(struct sna * sna,
 		return false;
 	}
 
-	DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n",
+	pixmap = get_window_pixmap(win);
+
+	DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d, pixmap size=%dx%d\n",
 	     __FUNCTION__,
 	     win->drawable.width, win->drawable.height,
 	     win->clipList.extents.x1, win->clipList.extents.y1,
 	     win->clipList.extents.x2, win->clipList.extents.y2,
-	     RegionNumRects(&win->clipList)));
-	if (is_clipped(&win->clipList, draw)) {
+	     RegionNumRects(&win->clipList),
+	     pixmap->drawable.width,
+	     pixmap->drawable.height));
+	if (is_clipped(&win->clipList, &pixmap->drawable)) {
 		DBG(("%s: no, %dx%d window is clipped: clip region=(%d, %d), (%d, %d)\n",
 		     __FUNCTION__,
 		     draw->width, draw->height,
@@ -1492,7 +1496,6 @@ can_xchg(struct sna * sna,
 		return false;
 	}
 
-	pixmap = get_window_pixmap(win);
 	if (pixmap == sna->front && !(sna->flags & SNA_TEAR_FREE)) {
 		DBG(("%s: no, front buffer, requires flipping\n",
 		     __FUNCTION__));


More information about the xorg-commit mailing list