diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-08 07:45:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-08 07:47:46 +0100 |
commit | eb8f3a9b345c75023b49512c2db57527d906db7f (patch) | |
tree | f77a37634cf659f8023450f572ea6378c79dfe26 | |
parent | fc64ba821749ed0a0197a69d9bae81957aceb55f (diff) |
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@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri2.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index e13e6268..f49bd19c 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__)); |