xserver-multidpi/miext/sync
Alex Goins 7f962c70b6 xsync: Add resource inside of SyncCreate, export SyncCreate
As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may
want to create a fence, then initialize it in their own way. This currently
can't be done without adding a function directly to Xext/sync.c due to the fact
that the RTFence resource type is private and there is no external interface to
add to it.

To facilitate other X extensions creating fences and initializing them, this
change exports SyncCreate() and adds the resource directly within it. Callers no
longer need to call AddResource() after SyncCreate(), they only need to
initialize the SyncObject.

To prevent FreeFence() and FreeCounter() from segfaulting if the call to
AddResource() fails before the sync object is initialized, this adds a new
'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and
FreeCounter() to skip de-initialization and simply free the object.
Initialization after adding the resource shouldn't otherwise be a problem due to
the single-threaded nature of X.

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2019-04-17 14:01:17 -07:00
..
Makefile.am miext: Ensure xshmfence is only called when driver supports it 2013-11-23 22:06:19 -08:00
meson.build meson: Distribute more SDK headers 2018-04-02 13:42:08 -04:00
misync.c xsync: Add resource inside of SyncCreate, export SyncCreate 2019-04-17 14:01:17 -07:00
misync.h xsync: Add resource inside of SyncCreate, export SyncCreate 2019-04-17 14:01:17 -07:00
misyncfd.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
misyncfd.h miext: Ensure xshmfence is only called when driver supports it 2013-11-23 22:06:19 -08:00
misyncshm.c miext/sync: Handle libxshmfence API change 2013-12-02 12:57:11 -08:00
misyncshm.h miext: Ensure xshmfence is only called when driver supports it 2013-11-23 22:06:19 -08:00
misyncstr.h xsync: Add resource inside of SyncCreate, export SyncCreate 2019-04-17 14:01:17 -07:00