[PATCH] dri2: Don't page flip when the window size doesn't match the pixmap size

Alex Deucher alexdeucher at gmail.com
Mon Dec 13 07:04:10 PST 2010


On Mon, Dec 13, 2010 at 8:15 AM, Ville Syrjälä <ville.syrjala at nokia.com> wrote:
> 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?

Looks reasonable to me.

Reviewed-by: Alex Deucher <alexdeucher at gmail.com>

>
>>
>> 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ä
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>


More information about the xorg-devel mailing list