summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
Diffstat (limited to 'Xext')
-rw-r--r--Xext/sync.c10
-rw-r--r--Xext/syncsrv.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 0bc0fb872..a692b6e29 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -113,6 +113,14 @@ static void SyncInitServerTime(void);
static void SyncInitIdleTime(void);
+static inline void*
+SysCounterGetPrivate(SyncCounter *counter)
+{
+ BUG_WARN(!IsSystemCounter(counter));
+
+ return counter->pSysCounterInfo ? counter->pSysCounterInfo->private : NULL;
+}
+
static Bool
SyncCheckWarnIsCounter(const SyncObject * pSync, const char *warning)
{
@@ -958,6 +966,7 @@ SyncCreateSystemCounter(const char *name,
psci->counterType = counterType;
psci->QueryValue = QueryValue;
psci->BracketValues = BracketValues;
+ psci->private = NULL;
XSyncMaxValue(&psci->bracket_greater);
XSyncMinValue(&psci->bracket_less);
xorg_list_add(&psci->entry, &SysCounterList);
@@ -1106,6 +1115,7 @@ FreeCounter(void *env, XID id)
}
if (IsSystemCounter(pCounter)) {
xorg_list_del(&pCounter->pSysCounterInfo->entry);
+ free(pCounter->pSysCounterInfo->private);
free(pCounter->pSysCounterInfo);
}
free(pCounter);
diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index f2f7a0fb9..2fa868790 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -83,6 +83,7 @@ typedef struct _SysCounterInfo {
SyncCounterType counterType; /* how can this counter change */
SyncSystemCounterQueryValue QueryValue;
SyncSystemCounterBracketValues BracketValues;
+ void *private;
struct xorg_list entry;
} SysCounterInfo;