[PATCH] dri2: Don't page flip when the window size doesn't match the pixmap size
Ville Syrjälä
ville.syrjala at nokia.com
Mon Dec 13 05:15:21 PST 2010
On Fri, Dec 03, 2010 at 08:23:16PM +0200, ville.syrjala at nokia.com wrote:
> From: Ville Syrjälä <ville.syrjala at nokia.com>
>
> 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.
Ping. Any comments on this?
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
> ---
> hw/xfree86/dri2/dri2.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 7bcd788..1622f69 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -699,6 +699,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;
> }
>
> --
> 1.7.2.2
>
--
Ville Syrjälä
More information about the xorg-devel
mailing list