[PATCH 4/9] Xext: add a private field to SyncSystemCounters
Peter Hutterer
peter.hutterer at who-t.net
Tue Mar 13 22:47:21 PDT 2012
Will be used to store counter-specific data.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Xext/sync.c | 2 ++
Xext/syncsrv.h | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Xext/sync.c b/Xext/sync.c
index f07f6dd..a219809 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1016,6 +1016,7 @@ SyncCreateSystemCounter(
psci->counterType = counterType;
psci->QueryValue = QueryValue;
psci->BracketValues = BracketValues;
+ psci->private = NULL;
XSyncMaxValue(&psci->bracket_greater);
XSyncMinValue(&psci->bracket_less);
SysCounterList[SyncNumSystemCounters++] = pCounter;
@@ -1175,6 +1176,7 @@ FreeCounter(void *env, XID id)
{
int i, found = 0;
+ free(pCounter->pSysCounterInfo->private);
free(pCounter->pSysCounterInfo);
/* find the counter in the list of system counters and remove it */
diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index d9ec88c..beb28b0 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -71,6 +71,8 @@ typedef void (*SyncSystemCounterBracketValues)(pointer counter,
CARD64 *pbracket_less,
CARD64 *pbracket_greater);
+#define SYSCOUNTERPRIV(counter) (((SyncCounter*)(counter))->pSysCounterInfo->private)
+
typedef struct _SysCounterInfo {
const char *name;
CARD64 resolution;
@@ -79,6 +81,7 @@ typedef struct _SysCounterInfo {
SyncCounterType counterType; /* how can this counter change */
SyncSystemCounterQueryValue QueryValue;
SyncSystemCounterBracketValues BracketValues;
+ void *private;
} SysCounterInfo;
--
1.7.7.6
More information about the xorg-devel
mailing list