[PATCH xserver 9/9] Export SyncVerifyFence() in new SDK header
James Jones
jajones at nvidia.com
Tue Sep 21 16:32:19 PDT 2010
Add syncsdk.h, a new xorg SDK header. It
contains SyncVerifyFence() and the helper
functions that use it to look up fence sync
objects. Exporting this functionality in an
SDK header allows 3rd party extensions to
look up fence objects in their interop APIs.
Signed-off-by: James Jones <jajones at nvidia.com>
Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
Reviewed-by: Robert Morell <rmorell at nvidia.com>
---
Xext/Makefile.am | 3 +-
Xext/sync.c | 1 +
Xext/syncsdk.h | 47 ++++++++++++++++++++++++++++++++++++++++++
Xext/syncsrv.h | 17 ---------------
damageext/damageext.c | 4 +-
hw/xfree86/loader/sdksyms.sh | 1 +
6 files changed, 53 insertions(+), 20 deletions(-)
create mode 100644 Xext/syncsdk.h
diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index e444fd0..b6c95cb 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -15,7 +15,7 @@ INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
AM_CFLAGS = $(DIX_CFLAGS)
if XORG
-sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h
+sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h syncsdk.h
endif
# Sources always included in libXextbuiltin.la & libXext.la
@@ -26,6 +26,7 @@ BUILTIN_SRCS = \
sleepuntil.c \
sleepuntil.h \
sync.c \
+ syncsdk.h \
syncsrv.h \
xcmisc.c \
xtest.c
diff --git a/Xext/sync.c b/Xext/sync.c
index f9fe339..35b9be8 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -68,6 +68,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "opaque.h"
#include <X11/extensions/syncproto.h>
#include "syncsrv.h"
+#include "syncsdk.h"
#include <stdio.h>
#if !defined(WIN32)
diff --git a/Xext/syncsdk.h b/Xext/syncsdk.h
new file mode 100644
index 0000000..a72c585
--- /dev/null
+++ b/Xext/syncsdk.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2010 NVIDIA Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _SYNCSDK_H_
+#define _SYNCSDK_H_
+
+#include "misync.h"
+
+extern _X_EXPORT int
+SyncVerifyFence(SyncFence **ppFence, XID fid, ClientPtr client, Mask mode);
+
+#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
+ do { \
+ int rc; \
+ rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \
+ if (Success != rc) return rc; \
+ } while (0)
+
+#define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \
+ do { \
+ pFence = 0; \
+ if (None != fid) \
+ VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \
+ } while (0)
+
+#endif /* _SYNCSDK_H_ */
+
diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index 14d6019..7ca1fba 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -140,23 +140,6 @@ extern void SyncDestroySystemCounter(
pointer pCounter
);
-extern int SyncVerifyFence(SyncFence **ppFence, XID fid,
- ClientPtr client, Mask mode);
-
-#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
- do { \
- int rc; \
- rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \
- if (Success != rc) return rc; \
- } while (0)
-
-#define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \
- do { \
- pFence = 0; \
- if (None != fid) \
- VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \
- } while (0)
-
extern void InitServertime(void);
extern void SyncExtensionInit(void);
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 794afcb..a37bc0e 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -25,8 +25,8 @@
#endif
#include "damageextint.h"
-#include "syncsrv.h"
-#include "misync.h"
+#include "syncsdk.h"
+#include "misyncstr.h"
#include "protocol-versions.h"
static unsigned char DamageReqCode;
diff --git a/hw/xfree86/loader/sdksyms.sh b/hw/xfree86/loader/sdksyms.sh
index 060663c..8e04e33 100755
--- a/hw/xfree86/loader/sdksyms.sh
+++ b/hw/xfree86/loader/sdksyms.sh
@@ -54,6 +54,7 @@ cat > sdksyms.c << EOF
#include "geext.h"
#include "geint.h"
#include "shmint.h"
+#include "syncsdk.h"
#if XINERAMA
# include "panoramiXsrv.h"
# include "panoramiX.h"
--
1.7.1
More information about the xorg-devel
mailing list