aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winshaddd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winshaddd.c')
-rw-r--r--xorg-server/hw/xwin/winshaddd.c53
1 files changed, 14 insertions, 39 deletions
diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c
index 5f3b658fb..59415515f 100644
--- a/xorg-server/hw/xwin/winshaddd.c
+++ b/xorg-server/hw/xwin/winshaddd.c
@@ -113,9 +113,7 @@ winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winCreatePrimarySurfaceShadowDD - Created primary surface\n");
-#endif
/*
* Attach a clipper to the primary surface that will clip our blits to our
@@ -129,10 +127,8 @@ winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winCreatePrimarySurfaceShadowDD - Attached clipper to "
"primary surface\n");
-#endif
/* Everything was correct */
return TRUE;
@@ -148,7 +144,7 @@ winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen)
{
winScreenPriv(pScreen);
- ErrorF("winReleasePrimarySurfaceShadowDD - Hello\n");
+ winDebug ("winReleasePrimarySurfaceShadowDD - Hello\n");
/* Release the primary surface and clipper, if they exist */
if (pScreenPriv->pddsPrimary) {
@@ -158,14 +154,14 @@ winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen)
*/
IDirectDrawSurface2_SetClipper(pScreenPriv->pddsPrimary, NULL);
- ErrorF("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
+ winDebug ("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
/* Release the primary surface */
IDirectDrawSurface2_Release(pScreenPriv->pddsPrimary);
pScreenPriv->pddsPrimary = NULL;
}
- ErrorF("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
+ winDebug ("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
return TRUE;
}
@@ -187,9 +183,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
DDSURFACEDESC ddsd;
DDSURFACEDESC *pddsdShadow = NULL;
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD\n");
-#endif
/* Create a clipper */
ddrval = (*g_fpDirectDrawCreateClipper) (0,
@@ -200,9 +194,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Created a clipper\n");
-#endif
/* Attach the clipper to our display window */
ddrval = IDirectDrawClipper_SetHWnd(pScreenPriv->pddcPrimary,
@@ -213,9 +205,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Attached clipper to window\n");
-#endif
/* Create a DirectDraw object, store the address at lpdd */
ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
@@ -225,9 +215,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD () - Created and initialized DD\n");
-#endif
/* Get a DirectDraw2 interface pointer */
ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd,
@@ -300,7 +288,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
|| pScreenInfo->dwHeight != GetSystemMetrics(SM_CYSCREEN)
|| pScreenInfo->dwBPP != GetDeviceCaps(hdc, BITSPIXEL)
|| pScreenInfo->dwRefreshRate != 0)) {
- ErrorF("winAllocateFBShadowDD - Changing video mode\n");
+ winDebug ("winAllocateFBShadowDD - Changing video mode\n");
/* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
ddrval = IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2,
@@ -329,7 +317,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
}
}
else {
- ErrorF("winAllocateFBShadowDD - Not changing video mode\n");
+ winDebug ("winAllocateFBShadowDD - Not changing video mode\n");
}
/* Release our DC */
@@ -379,9 +367,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Created shadow\n");
-#endif
/* Allocate a DD surface description for our screen privates */
pddsdShadow = pScreenPriv->pddsdShadow = malloc(sizeof(DDSURFACEDESC));
@@ -393,9 +379,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
ZeroMemory(pddsdShadow, sizeof(*pddsdShadow));
pddsdShadow->dwSize = sizeof(*pddsdShadow);
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Locking shadow\n");
-#endif
/* Lock the shadow surface */
ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow,
@@ -406,9 +390,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Locked shadow\n");
-#endif
/* We don't know how to deal with anything other than RGB */
if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB)) {
@@ -428,9 +410,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen)
pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask;
pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask;
-#if CYGDEBUG
winDebug("winAllocateFBShadowDD - Returning\n");
-#endif
return TRUE;
}
@@ -594,6 +574,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf)
/* Has our memory pointer changed? */
if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) {
+ extern const char *g_pszLogFile;
ErrorF("winShadowUpdateDD - Memory location of the shadow "
"surface has changed, trying to update the root window "
"pixmap header to point to the new address. If you get "
@@ -630,9 +611,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen)
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
Bool fReturn;
-#if CYGDEBUG
winDebug("winCloseScreenShadowDD - Freeing screen resources\n");
-#endif
/* Flag that the screen is closed */
pScreenPriv->fClosed = TRUE;
@@ -669,7 +648,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen)
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
/* Destroy the thread startup mutex */
- pthread_mutex_destroy(&pScreenPriv->pmServerStarted);
+ if (pScreenPriv->pmServerStarted) pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
#endif
/* Kill our screeninfo's pointer to the screen */
@@ -711,13 +690,13 @@ winInitVisualsShadowDD(ScreenPtr pScreen)
else
pScreenPriv->dwBitsPerRGB = dwBlueBits;
- ErrorF("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
- "bpp %d\n",
- (unsigned int) pScreenPriv->dwRedMask,
- (unsigned int) pScreenPriv->dwGreenMask,
- (unsigned int) pScreenPriv->dwBlueMask,
- (int) pScreenPriv->dwBitsPerRGB,
- (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP);
+ winDebug ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ (unsigned int) pScreenPriv->dwRedMask,
+ (unsigned int) pScreenPriv->dwGreenMask,
+ (unsigned int) pScreenPriv->dwBlueMask,
+ (int) pScreenPriv->dwBitsPerRGB,
+ (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP);
/* Create a single visual according to the Windows screen depth */
switch (pScreenInfo->dwDepth) {
@@ -771,9 +750,7 @@ winInitVisualsShadowDD(ScreenPtr pScreen)
return FALSE;
}
-#if CYGDEBUG
winDebug("winInitVisualsShadowDD - Returning\n");
-#endif
return TRUE;
}
@@ -1144,10 +1121,8 @@ winDestroyColormapShadowDD(ColormapPtr pColormap)
* we need to handle the default colormap in a special way.
*/
if (pColormap->flags & IsDefault) {
-#if CYGDEBUG
winDebug("winDestroyColormapShadowDD - Destroying default "
"colormap\n");
-#endif
/*
* FIXME: Walk the list of all screens, popping the default