From 0ce25fd7904c792924c3e0ee6fc21a5f1bec1a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 3 Dec 2010 17:42:16 +0200 Subject: [PATCH] dri2: Don't page flip when the window size doesn't match the pixmap size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hw/xfree86/dri2/dri2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 || +#ifdef COMPOSITE + pDraw->x != pWinPixmap->screen_x || + pDraw->y != pWinPixmap->screen_y || +#endif + pDraw->width != pWinPixmap->drawable.width || + pDraw->height != pWinPixmap->drawable.height) + return FALSE; + return TRUE; }