summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-04-24 14:58:27 -0700
committerAdam Jackson <ajax@redhat.com>2013-09-10 13:26:25 -0400
commitf37972f4a67b49ba9649310a6778bd1bf31e0130 (patch)
tree6cea8456368ff5806549f40586c4dd69e621abf9 /miext
parent1c8beedfe4343377fa3504f8ab71430cc137b22c (diff)
miext/sync: Fix multi-screen support in SyncFence initialization
miSyncSetup was checking to see if the screen private key had been registered, and if so, skipping the setup of the provided screen. Instead, it should register the private index only once, but then initialize the screen unless it has already been initialized. This latter step allows drivers to initialize the sync private structures before the Sync extension itself is initialized. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'miext')
-rw-r--r--miext/sync/misync.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index d24921a18..b6914d18d 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -182,20 +182,21 @@ miSyncSetup(ScreenPtr pScreen)
&miSyncScreenDestroyFence
};
- if (dixPrivateKeyRegistered(syncScreenPrivateKey))
- return TRUE;
-
- if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN,
- sizeof(SyncScreenPrivRec)))
- return FALSE;
+ if (!dixPrivateKeyRegistered(syncScreenPrivateKey)) {
+ if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN,
+ sizeof(SyncScreenPrivRec)))
+ return FALSE;
+ }
pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
- pScreenPriv->funcs = miSyncScreenFuncs;
+ if (pScreenPriv->funcs.CreateFence) {
+ pScreenPriv->funcs = miSyncScreenFuncs;
- /* Wrap CloseScreen to clean up */
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = SyncCloseScreen;
+ /* Wrap CloseScreen to clean up */
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = SyncCloseScreen;
+ }
return TRUE;
}