[PATCH 0/2] Don't use xshmfence unless supported by the driver

Fredrik Höglund fredrik at kde.org
Thu Nov 21 05:38:55 PST 2013


On Wednesday 20 November 2013, Keith Packard wrote:
> Fredrik Höglund <fredrik at kde.org> writes:
> 
> > I also decided to try passing a regular sync fence to DRI3FDFromFence.
> > I expected it to generate an error, but it didn't. Instead it returned
> > a valid file descriptor. I don't know if this is a bug or not.
> 
> Nice catch. miSyncFDFromFence is supposed to return a file descriptor,
> or -1 if there's an error. It was returning 'BadMatch' instead, which is
> defined as '8', so you were getting a copy of whatever fd 8 was in the X
> server (presumably some client connection).
> 
> This should fix it:
> 
> diff --git a/miext/sync/misyncfd.c b/miext/sync/misyncfd.c
> index 5421553..93ff85f 100644
> --- a/miext/sync/misyncfd.c
> +++ b/miext/sync/misyncfd.c
> @@ -61,7 +61,7 @@ miSyncFDFromFence(DrawablePtr pDraw, SyncFence *pFence)
>      SyncFdScreenPrivatePtr      priv = sync_fd_screen_priv(pDraw->pScreen);
>  
>      if (!priv)
> -        return BadMatch;
> +        return -1;
>  
>      return (*priv->funcs.GetFenceFd)(pDraw->pScreen, pFence);
>  }

Yeah, that fixes it. With this patch the request generates a BadMatch
error.

Fredrik



More information about the xorg-devel mailing list