summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Harrison <colin.harrison@virgin.net>2008-11-02 20:46:44 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2008-12-18 12:37:15 +0000
commit21a2df9f359584e634dc12d8602401d54defd7db (patch)
treec250cdbccde4b0b1702c7c1da1483b9500b1e2df
parentb0ed1567c1782041cf3d14ec6dd4d622915c7d0c (diff)
Xming,Cygwin/X: Fix crashes when using the DirectDraw '-refresh rate-in-Hz' option in -fullscreen (#11128)
fd.o bugzilla #11128 Fix crashes when using the '-refresh rate-in-Hz' option in -fullscreen mode and using a DirectDraw engine. On failure (typically 0x80004001 DDERR_UNSUPPORTED), use the default refresh rate for the driver, instead of the entered value. Also fix some nearby error reporting Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--hw/xwin/winshaddd.c28
-rw-r--r--hw/xwin/winshadddnl.c19
2 files changed, 37 insertions, 10 deletions
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 5f5daeb18..6e1f973a8 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -361,7 +361,7 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
{
ErrorF ("winAllocateFBShadowDD - Changing video mode\n");
- /* Change the video mode to the mode requested */
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
pScreenInfo->dwWidth,
pScreenInfo->dwHeight,
@@ -373,7 +373,20 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDD - Could not set "\
"full screen display mode: %08x\n",
(unsigned int) ddrval);
- return FALSE;
+ ErrorF ("winAllocateFBShadowDD - Using default driver refresh rate\n");
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
}
}
else
@@ -534,7 +547,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
if (FAILED (ddrval))
{
- ErrorF ("winShadowUpdateProcDD - Unlock failed\n");
+ ErrorF ("winShadowUpdateDD - Unlock failed\n");
return;
}
@@ -626,19 +639,20 @@ winShadowUpdateDD (ScreenPtr pScreen,
NULL);
if (FAILED (ddrval))
{
- ErrorF ("winShadowUpdateProcDD - Lock failed\n");
+ ErrorF ("winShadowUpdateDD - Lock failed\n");
return;
}
/* Has our memory pointer changed? */
if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
{
- ErrorF ("winShadowUpdateProcDD - Memory location of the shadow "
+ extern 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 "
"this message and "PROJECT_NAME" freezes or crashes "
"after this message then send a problem report and your "
- "/tmp/XWin.log file to cygwin-xfree@cygwin.com\n");
+ "%s file to " BUILDERADDR, g_pszLogFile);
/* Location of shadow framebuffer has changed */
pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
@@ -653,7 +667,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
pScreenInfo->dwBPP),
pScreenInfo->pfb))
{
- ErrorF ("winShadowUpdateProcDD - Bits changed, could not "
+ ErrorF ("winShadowUpdateDD - Bits changed, could not "
"notify fb.\n");
return;
}
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 630c720ec..ef5c21469 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -391,7 +391,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
{
winDebug ("winAllocateFBShadowDDNL - Changing video mode\n");
- /* Change the video mode to the mode requested */
+ /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
pScreenInfo->dwWidth,
pScreenInfo->dwHeight,
@@ -403,7 +403,20 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
ErrorF ("winAllocateFBShadowDDNL - Could not set "
"full screen display mode: %08x\n",
(unsigned int) ddrval);
- return FALSE;
+ ErrorF ("winAllocateFBShadowDDNL - Using default driver refresh rate\n");
+ ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ 0,
+ 0);
+ if (FAILED(ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set default refresh rate "
+ "full screen display mode: %08x\n",
+ (unsigned int) ddrval);
+ return FALSE;
+ }
}
}
else
@@ -1310,7 +1323,7 @@ winStoreColorsShadowDDNL (ColormapPtr pColormap,
+ pdefs[0].pixel);
if (FAILED (ddrval))
{
- ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", ddrval);
+ ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (unsigned int) ddrval);
return FALSE;
}