summaryrefslogtreecommitdiff
path: root/Xext/sync.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2015-12-08 15:08:34 -0500
committerAdam Jackson <ajax@redhat.com>2015-12-08 18:22:54 -0500
commit8c49c883dc196ea57e3f64425c2a5b0a8ce3ba75 (patch)
treeb88920edd3a7e378cbb7a6502dd23dc9990fbb24 /Xext/sync.c
parentb5f04a79df8b5aab8b558461261d14721f0b3e41 (diff)
sync: Don't allow creating a system counter before sync is initialized
It probably doesn't work very well since there's other extension setup we're not doing on this path, and in any event it's not a thing that happens currently. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'Xext/sync.c')
-rw-r--r--Xext/sync.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 41405619c..4c59fea08 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -984,20 +984,7 @@ SyncCreateSystemCounter(const char *name,
SyncSystemCounterBracketValues BracketValues
)
{
- SyncCounter *pCounter;
-
- /* this function may be called before SYNC has been initialized, so we
- * have to make sure RTCounter is created.
- */
- if (RTCounter == 0) {
- RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
- if (RTCounter == 0) {
- return NULL;
- }
- xorg_list_init(&SysCounterList);
- }
-
- pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
+ SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
if (pCounter) {
SysCounterInfo *psci;
@@ -2501,10 +2488,8 @@ SyncExtensionInit(void)
for (s = 0; s < screenInfo.numScreens; s++)
miSyncSetup(screenInfo.screens[s]);
- if (RTCounter == 0) {
- RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
- xorg_list_init(&SysCounterList);
- }
+ RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
+ xorg_list_init(&SysCounterList);
RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
RTFence = CreateNewResourceType(FreeFence, "SyncFence");