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ä <ville.syrjala@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
This commit is contained in:
Ville Syrjälä 2010-12-03 17:42:16 +02:00
parent efcb63d0ce
commit 0ce25fd790

View File

@ -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;
}