summaryrefslogtreecommitdiff
path: root/xserver/miext/sync
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/miext/sync')
-rw-r--r--xserver/miext/sync/Makefile.in14
-rw-r--r--xserver/miext/sync/misync.c81
-rw-r--r--xserver/miext/sync/misync.h52
-rw-r--r--xserver/miext/sync/misyncstr.h56
4 files changed, 98 insertions, 105 deletions
diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in
index e06240182..84e3915d6 100644
--- a/xserver/miext/sync/Makefile.in
+++ b/xserver/miext/sync/Makefile.in
@@ -95,7 +95,6 @@ AGP_FALSE = @AGP_FALSE@
AGP_TRUE = @AGP_TRUE@
AIGLX_DRI_LOADER_FALSE = @AIGLX_DRI_LOADER_FALSE@
AIGLX_DRI_LOADER_TRUE = @AIGLX_DRI_LOADER_TRUE@
-ALLOCA = @ALLOCA@
ALPHA_VIDEO_FALSE = @ALPHA_VIDEO_FALSE@
ALPHA_VIDEO_TRUE = @ALPHA_VIDEO_TRUE@
AMDEP_FALSE = @AMDEP_FALSE@
@@ -114,6 +113,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASE_CFLAGS = @BASE_CFLAGS@
BASE_FONT_PATH = @BASE_FONT_PATH@
BSD_APM_FALSE = @BSD_APM_FALSE@
BSD_APM_TRUE = @BSD_APM_TRUE@
@@ -321,8 +321,6 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@
LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@
-LINUX_IA64_FALSE = @LINUX_IA64_FALSE@
-LINUX_IA64_TRUE = @LINUX_IA64_TRUE@
LIPO = @LIPO@
LNXACPI_FALSE = @LNXACPI_FALSE@
LNXACPI_TRUE = @LNXACPI_TRUE@
@@ -341,10 +339,6 @@ MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MITSHM_FALSE = @MITSHM_FALSE@
MITSHM_TRUE = @MITSHM_TRUE@
-NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@
-NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@
-NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@
-NEED_VSNPRINTF_TRUE = @NEED_VSNPRINTF_TRUE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJC = @OBJC@
@@ -488,18 +482,18 @@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
XNEST_TRUE = @XNEST_TRUE@
XORG_BUS_BSDPCI_FALSE = @XORG_BUS_BSDPCI_FALSE@
XORG_BUS_BSDPCI_TRUE = @XORG_BUS_BSDPCI_TRUE@
-XORG_BUS_LINUXPCI_FALSE = @XORG_BUS_LINUXPCI_FALSE@
-XORG_BUS_LINUXPCI_TRUE = @XORG_BUS_LINUXPCI_TRUE@
+XORG_BUS_PCI_FALSE = @XORG_BUS_PCI_FALSE@
+XORG_BUS_PCI_TRUE = @XORG_BUS_PCI_TRUE@
XORG_BUS_SPARC_FALSE = @XORG_BUS_SPARC_FALSE@
XORG_BUS_SPARC_TRUE = @XORG_BUS_SPARC_TRUE@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_FALSE = @XORG_FALSE@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
+XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
-XORG_OS = @XORG_OS@
XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
XORG_SGML_PATH = @XORG_SGML_PATH@
XORG_SYS_LIBS = @XORG_SYS_LIBS@
diff --git a/xserver/miext/sync/misync.c b/xserver/miext/sync/misync.c
index 50226d9e3..b1e2a36f7 100644
--- a/xserver/miext/sync/misync.c
+++ b/xserver/miext/sync/misync.c
@@ -38,74 +38,76 @@ static DevPrivateKey syncScreenPrivateKey = &syncScreenPrivateKeyRec;
typedef struct _syncScreenPriv {
/* Wrappable sync-specific screen functions */
- SyncScreenFuncsRec funcs;
+ SyncScreenFuncsRec funcs;
/* Wrapped screen functions */
- CloseScreenProcPtr CloseScreen;
+ CloseScreenProcPtr CloseScreen;
} SyncScreenPrivRec, *SyncScreenPrivPtr;
/* Default implementations of the sync screen functions */
void
-miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence* pFence,
+miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
Bool initially_triggered)
{
- (void)pScreen;
+ (void) pScreen;
pFence->triggered = initially_triggered;
}
-void miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence* pFence)
+void
+miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence)
{
- (void)pScreen;
- (void)pFence;
+ (void) pScreen;
+ (void) pFence;
}
/* Default implementations of the per-object functions */
static void
-miSyncFenceSetTriggered(SyncFence* pFence)
+miSyncFenceSetTriggered(SyncFence * pFence)
{
pFence->triggered = TRUE;
}
static void
-miSyncFenceReset(SyncFence* pFence)
+miSyncFenceReset(SyncFence * pFence)
{
pFence->triggered = FALSE;
}
static Bool
-miSyncFenceCheckTriggered(SyncFence* pFence)
+miSyncFenceCheckTriggered(SyncFence * pFence)
{
return pFence->triggered;
}
static void
-miSyncFenceAddTrigger(SyncTrigger* pTrigger)
+miSyncFenceAddTrigger(SyncTrigger * pTrigger)
{
- (void)pTrigger;
+ (void) pTrigger;
return;
}
static void
-miSyncFenceDeleteTrigger(SyncTrigger* pTrigger)
+miSyncFenceDeleteTrigger(SyncTrigger * pTrigger)
{
- (void)pTrigger;
+ (void) pTrigger;
return;
}
/* Machine independent portion of the fence sync object implementation */
void
-miSyncInitFence(ScreenPtr pScreen, SyncFence* pFence, Bool initially_triggered)
+miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered)
{
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
+
static const SyncFenceFuncsRec miSyncFenceFuncs = {
- &miSyncFenceSetTriggered,
- &miSyncFenceReset,
- &miSyncFenceCheckTriggered,
- &miSyncFenceAddTrigger,
- &miSyncFenceDeleteTrigger
+ &miSyncFenceSetTriggered,
+ &miSyncFenceReset,
+ &miSyncFenceCheckTriggered,
+ &miSyncFenceAddTrigger,
+ &miSyncFenceDeleteTrigger
};
pFence->pScreen = pScreen;
@@ -115,7 +117,7 @@ miSyncInitFence(ScreenPtr pScreen, SyncFence* pFence, Bool initially_triggered)
}
void
-miSyncDestroyFence(SyncFence* pFence)
+miSyncDestroyFence(SyncFence * pFence)
{
ScreenPtr pScreen = pFence->pScreen;
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
@@ -123,11 +125,10 @@ miSyncDestroyFence(SyncFence* pFence)
pFence->sync.beingDestroyed = TRUE;
/* tell all the fence's triggers that the counter has been destroyed */
- for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext)
- {
- (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
- pNext = ptl->next;
- free(ptl); /* destroy the trigger list as we go */
+ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
+ (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
+ pNext = ptl->next;
+ free(ptl); /* destroy the trigger list as we go */
}
pScreenPriv->funcs.DestroyFence(pScreen, pFence);
@@ -136,7 +137,7 @@ miSyncDestroyFence(SyncFence* pFence)
}
void
-miSyncTriggerFence(SyncFence* pFence)
+miSyncTriggerFence(SyncFence * pFence)
{
SyncTriggerList *ptl, *pNext;
CARD64 unused;
@@ -146,15 +147,15 @@ miSyncTriggerFence(SyncFence* pFence)
XSyncIntToValue(&unused, 0L);
/* run through triggers to see if any fired */
- for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext)
- {
- pNext = ptl->next;
- if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, unused))
- (*ptl->pTrigger->TriggerFired)(ptl->pTrigger);
+ for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
+ pNext = ptl->next;
+ if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, unused))
+ (*ptl->pTrigger->TriggerFired) (ptl->pTrigger);
}
}
-SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen)
+SyncScreenFuncsPtr
+miSyncGetScreenFuncs(ScreenPtr pScreen)
{
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
@@ -162,7 +163,7 @@ SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen)
}
static Bool
-SyncCloseScreen (int i, ScreenPtr pScreen)
+SyncCloseScreen(int i, ScreenPtr pScreen)
{
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
@@ -174,19 +175,19 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
Bool
miSyncSetup(ScreenPtr pScreen)
{
- SyncScreenPrivPtr pScreenPriv;
+ SyncScreenPrivPtr pScreenPriv;
static const SyncScreenFuncsRec miSyncScreenFuncs = {
- &miSyncScreenCreateFence,
- &miSyncScreenDestroyFence
+ &miSyncScreenCreateFence,
+ &miSyncScreenDestroyFence
};
if (dixPrivateKeyRegistered(syncScreenPrivateKey))
- return TRUE;
+ return TRUE;
if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN,
- sizeof(SyncScreenPrivRec)))
- return FALSE;
+ sizeof(SyncScreenPrivRec)))
+ return FALSE;
pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
diff --git a/xserver/miext/sync/misync.h b/xserver/miext/sync/misync.h
index 1c82ea516..deebb82bc 100644
--- a/xserver/miext/sync/misync.h
+++ b/xserver/miext/sync/misync.h
@@ -32,46 +32,48 @@ typedef struct _SyncFence SyncFence;
typedef struct _SyncTrigger SyncTrigger;
typedef void (*SyncScreenCreateFenceFunc) (ScreenPtr pScreen,
- SyncFence* pFence,
- Bool initially_triggered);
+ SyncFence * pFence,
+ Bool initially_triggered);
typedef void (*SyncScreenDestroyFenceFunc) (ScreenPtr pScreen,
- SyncFence* pFence);
+ SyncFence * pFence);
typedef struct _syncScreenFuncs {
- SyncScreenCreateFenceFunc CreateFence;
- SyncScreenDestroyFenceFunc DestroyFence;
+ SyncScreenCreateFenceFunc CreateFence;
+ SyncScreenDestroyFenceFunc DestroyFence;
} SyncScreenFuncsRec, *SyncScreenFuncsPtr;
extern _X_EXPORT void
-miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence* pFence,
- Bool initially_triggered);
+
+miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
+ Bool initially_triggered);
extern _X_EXPORT void
-miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence* pFence);
+ miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence);
-typedef void (*SyncFenceSetTriggeredFunc) (SyncFence* pFence);
-typedef void (*SyncFenceResetFunc) (SyncFence* pFence);
-typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence* pFence);
-typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger* pTrigger);
-typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger* pTrigger);
+typedef void (*SyncFenceSetTriggeredFunc) (SyncFence * pFence);
+typedef void (*SyncFenceResetFunc) (SyncFence * pFence);
+typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence * pFence);
+typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger * pTrigger);
+typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger * pTrigger);
typedef struct _syncFenceFuncs {
- SyncFenceSetTriggeredFunc SetTriggered;
- SyncFenceResetFunc Reset;
- SyncFenceCheckTriggeredFunc CheckTriggered;
- SyncFenceAddTriggerFunc AddTrigger;
- SyncFenceDeleteTriggerFunc DeleteTrigger;
+ SyncFenceSetTriggeredFunc SetTriggered;
+ SyncFenceResetFunc Reset;
+ SyncFenceCheckTriggeredFunc CheckTriggered;
+ SyncFenceAddTriggerFunc AddTrigger;
+ SyncFenceDeleteTriggerFunc DeleteTrigger;
} SyncFenceFuncsRec, *SyncFenceFuncsPtr;
extern _X_EXPORT void
-miSyncInitFence(ScreenPtr pScreen, SyncFence* pFence, Bool initially_triggered);
+
+miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence,
+ Bool initially_triggered);
extern _X_EXPORT void
-miSyncDestroyFence(SyncFence* pFence);
+ miSyncDestroyFence(SyncFence * pFence);
extern _X_EXPORT void
-miSyncTriggerFence(SyncFence* pFence);
+ miSyncTriggerFence(SyncFence * pFence);
-extern _X_EXPORT SyncScreenFuncsPtr
-miSyncGetScreenFuncs(ScreenPtr pScreen);
+extern _X_EXPORT SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen);
extern _X_EXPORT Bool
-miSyncSetup(ScreenPtr pScreen);
+ miSyncSetup(ScreenPtr pScreen);
-#endif /* _MISYNC_H_ */
+#endif /* _MISYNC_H_ */
diff --git a/xserver/miext/sync/misyncstr.h b/xserver/miext/sync/misyncstr.h
index 40a865c9c..e19256fee 100644
--- a/xserver/miext/sync/misyncstr.h
+++ b/xserver/miext/sync/misyncstr.h
@@ -31,50 +31,47 @@
#include "dix.h"
#include <X11/extensions/syncconst.h>
-#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
+#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
/* Sync object types */
#define SYNC_COUNTER 0
#define SYNC_FENCE 1
typedef struct _SyncObject {
- ClientPtr client; /* Owning client. 0 for system counters */
- struct _SyncTriggerList *pTriglist; /* list of triggers */
- XID id; /* resource ID */
- unsigned char type; /* SYNC_* */
- Bool beingDestroyed; /* in process of going away */
+ ClientPtr client; /* Owning client. 0 for system counters */
+ struct _SyncTriggerList *pTriglist; /* list of triggers */
+ XID id; /* resource ID */
+ unsigned char type; /* SYNC_* */
+ Bool beingDestroyed; /* in process of going away */
} SyncObject;
typedef struct _SyncCounter {
- SyncObject sync; /* Common sync object data */
- CARD64 value; /* counter value */
- struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
+ SyncObject sync; /* Common sync object data */
+ CARD64 value; /* counter value */
+ struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
} SyncCounter;
struct _SyncFence {
- SyncObject sync; /* Common sync object data */
- ScreenPtr pScreen; /* Screen of this fence object */
- SyncFenceFuncsRec funcs; /* Funcs for performing ops on fence */
- Bool triggered; /* fence state */
- PrivateRec *devPrivates; /* driver-specific per-fence data */
+ SyncObject sync; /* Common sync object data */
+ ScreenPtr pScreen; /* Screen of this fence object */
+ SyncFenceFuncsRec funcs; /* Funcs for performing ops on fence */
+ Bool triggered; /* fence state */
+ PrivateRec *devPrivates; /* driver-specific per-fence data */
};
struct _SyncTrigger {
SyncObject *pSync;
- CARD64 wait_value; /* wait value */
- unsigned int value_type; /* Absolute or Relative */
- unsigned int test_type; /* transition or Comparision type */
- CARD64 test_value; /* trigger event threshold value */
- Bool (*CheckTrigger)(
- struct _SyncTrigger * /*pTrigger*/,
- CARD64 /*newval*/
- );
- void (*TriggerFired)(
- struct _SyncTrigger * /*pTrigger*/
- );
- void (*CounterDestroyed)(
- struct _SyncTrigger * /*pTrigger*/
- );
+ CARD64 wait_value; /* wait value */
+ unsigned int value_type; /* Absolute or Relative */
+ unsigned int test_type; /* transition or Comparision type */
+ CARD64 test_value; /* trigger event threshold value */
+ Bool (*CheckTrigger) (struct _SyncTrigger * /*pTrigger */ ,
+ CARD64 /*newval */
+ );
+ void (*TriggerFired) (struct _SyncTrigger * /*pTrigger */
+ );
+ void (*CounterDestroyed) (struct _SyncTrigger * /*pTrigger */
+ );
};
typedef struct _SyncTriggerList {
@@ -82,5 +79,4 @@ typedef struct _SyncTriggerList {
struct _SyncTriggerList *next;
} SyncTriggerList;
-#endif /* _MISYNCSTR_H_ */
-
+#endif /* _MISYNCSTR_H_ */