diff options
authorVille Syrjälä <>2010-12-03 17:42:16 +0200
committerVille Syrjälä <>2010-12-27 20:03:51 +0200
commit0ce25fd7904c792924c3e0ee6fc21a5f1bec1a68 (patch)
parentefcb63d0ce43f96d0ac02b6f4a480dfd2374fc84 (diff)
dri2: Don't page flip when the window size doesn't match the pixmap size
If the drawable size doesn't match the pixmap size page flipping should not be allowed. If the window is larger than the pixmap, page flipping might need to reposition the CRTC somewhere in the middle of the pixmap. I didn't spot any code that would handle that at least in the intel driver. Also the root pixmap could then move to some negative screen coordinates. Not sure if all bits of code could handle that. Perhaps when composite is enabled screen_x/y would make it work, but without composite there's no way that it would work AFAICS. Signed-off-by: Ville Syrjälä <> Reviewed-by: Alex Deucher <>
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e4693d92e..39996f946 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -640,6 +640,17 @@ DRI2CanFlip(DrawablePtr pDraw)
if (!RegionEqual(&pWin->clipList, &pRoot->winSize))
return FALSE;
+ /* Does the window match the pixmap exactly? */
+ if (pDraw->x != 0 ||
+ pDraw->y != 0 ||
+ pDraw->x != pWinPixmap->screen_x ||
+ pDraw->y != pWinPixmap->screen_y ||
+ pDraw->width != pWinPixmap->drawable.width ||
+ pDraw->height != pWinPixmap->drawable.height)
+ return FALSE;
return TRUE;