On Tuesday 21 February 2012 09:55:43 Chris Wilson wrote:
> Currently, the midlayer dri2 code intercepts swap_interval=0 (ala
> vblank_mode=0) SwapBuffers and converts it to a CopyRegion request.
> This prevents the backend from doing anything meaningful in this case
> and typically ends up being vsync'ed since the drivers cannot distinguish
> it from a regular CopyRegion request.
>
> v2: Only invalidate the drawable on the behest of the backend, so that
> existing behaviour of not invalidating for async blit copies is
> preserved, suggested by Simon Farnsworh. And rebase for the intervening
> 12 months since v1.
>
> Signed-off-by: Chris Wilson <[email protected]>
> Cc: Jesse Barnes <[email protected]>
> Cc: Kristian Høgsberg <[email protected]>
> Cc: Ville Syrjälä <[email protected]>
> Cc: Dave Airlie <[email protected]>
> Cc: Michel Dänzer <[email protected]>
> Cc: Simon Farnsworth <[email protected]>

One tiny nit-pick:

> ---
>  hw/xfree86/dri2/dri2.c |   46
+++++++++++++++++++++++++++++++++-------------
>  hw/xfree86/dri2/dri2.h |   22 +++++++++++++++++++++-
>  2 files changed, 54 insertions(+), 14 deletions(-)
>
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 5cc9068..05b7cb3 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c

<snip>

> @@ -876,20 +900,11 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw,
> CARD64 target_msc,
>
>      /* Old DDX or no swap interval, just blit */

This comment is now misleading - the driver might not blit, but could do
(for example) a asynchronous buffer swap.

>     if (!ds->ScheduleSwap || !pPriv->swap_interval) {
> -       BoxRec box;
> -       RegionRec region;
> -
> -       box.x1 = 0;
> -       box.y1 = 0;
> -       box.x2 = pDraw->width;
> -       box.y2 = pDraw->height;
> -       RegionInit(&region, &box, 0);
> -
>         pPriv->swapsPending++;
> -
> -       (*ds->CopyRegion)(pDraw, &region, pDestBuffer, pSrcBuffer);
> -       DRI2SwapComplete(client, pDraw, target_msc, 0, 0,
DRI2_BLIT_COMPLETE,
> -                        func, data);
> +       if ((*ds->AsyncSwap)(client, pDraw,
> +                            pDestBuffer, pSrcBuffer,
> +                            func, data))
> +           DRI2InvalidateDrawable(pDraw);
>         return Success;
>      }

<snip>

Everything else looks good to me, so:

Reviewed-by: Simon Farnsworth <[email protected]>
--
Simon Farnsworth
Software Engineer
ONELAN Ltd
http://www.onelan.com

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to