[PATCH xserver/dri2 1/3] Fix glitches in DRI2SwapComplete() and DRI2WakeupClient()

Jesse Barnes jbarnes at virtuousgeek.org
Mon Feb 22 09:56:50 PST 2010


On Sun, 21 Feb 2010 05:25:59 +0100
Mario Kleiner <mario.kleiner at tuebingen.mpg.de> wrote:

> DRI2SwapComplete(): Increment pPriv->swap_count++; before calling
> into callback for INTEL_swap_events extension, so the swap event
> contains the current SBC after swap completion instead of the
> previous one.
> 
> DRI2WakeupClient: Check for pPriv->target_sbc <= pPriv->swap_count,
> had wrong comparison pPriv->target_sbc >= pPriv->swap_count for
> unblocking of clients of DRI2WaitSBC().
> 
> Signed-off-by: Mario Kleiner <mario.kleiner at tuebingen.mpg.de>
> ---
>  hw/xfree86/dri2/dri2.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 3db826e..baf0df8 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -474,7 +474,7 @@ DRI2WakeClient(ClientPtr client, DrawablePtr pDraw, int frame,
>       * blocked due to GLX activity during a swap.
>       */
>      if (pPriv->target_sbc != -1 &&
> -	pPriv->target_sbc >= pPriv->swap_count) {
> +	pPriv->target_sbc <= pPriv->swap_count) {
>  	ProcDRI2WaitMSCReply(client, ((CARD64)tv_sec * 1000000) + tv_usec,
>  			     frame, pPriv->swap_count);
>  	pPriv->target_sbc = -1;
> @@ -511,13 +511,13 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame,
>  	return;
>      }
>  
> +    pPriv->swapsPending--;
> +    pPriv->swap_count++;
> +
>      ust = ((CARD64)tv_sec * 1000000) + tv_usec;
>      if (swap_complete)
>  	swap_complete(client, swap_data, type, ust, frame, pPriv->swap_count);
>  
> -    pPriv->swapsPending--;
> -    pPriv->swap_count++;
> -
>      DRI2WakeClient(client, pDraw, frame, tv_sec, tv_usec);
>  }

These look like good fixes to me (should probably be separate patches
but that's not a huge deal).

Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center


More information about the xorg-devel mailing list