aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86DGA.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86DGA.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86DGA.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c
index 42b7c5805..804fd37c1 100644
--- a/xorg-server/hw/xfree86/common/xf86DGA.c
+++ b/xorg-server/hw/xfree86/common/xf86DGA.c
@@ -120,8 +120,22 @@ DGAInit(
DGAScreenKey = &DGAScreenKeyIndex;
- if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
- return FALSE;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if (!pScreenPriv)
+ {
+ if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
+ return FALSE;
+ dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = DGACloseScreen;
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
+ pScreen->DestroyColormap = DGADestroyColormap;
+ pScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreen->InstallColormap = DGAInstallColormap;
+ pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
+ pScreen->UninstallColormap = DGAUninstallColormap;
+ }
pScreenPriv->pScrn = pScrn;
pScreenPriv->numModes = num;
@@ -146,17 +160,6 @@ DGAInit(
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
- dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = DGACloseScreen;
- pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
- pScreen->DestroyColormap = DGADestroyColormap;
- pScreenPriv->InstallColormap = pScreen->InstallColormap;
- pScreen->InstallColormap = DGAInstallColormap;
- pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
- pScreen->UninstallColormap = DGAUninstallColormap;
-
-
return TRUE;
}