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

Keith Packard keithp at keithp.com
Wed Nov 20 11:59:48 PST 2013


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);
 }

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131120/d9ef4b3a/attachment-0001.pgp>


More information about the xorg-devel mailing list