summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-03-13 09:28:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-22 13:12:55 +1000
commit90e6dc6de1ac339212989fd8e54131b196ebb369 (patch)
treeff2181f158068f327aa2b13d07f60b7e0ea0ba57 /Xext
parent3ddae647c307005309daa2d5dfe4bc6acb8170ab (diff)
Xext: add a private field to SyncSystemCounters
Will be used to store counter-specific data. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: James Jones <jajones@nvidia.com>
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;