Commit 45cc1430 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Check for htotal=vtotal=0 (for xfree 4 vesa driver).

parent 814654ef
...@@ -36,7 +36,10 @@ static void convert_modeinfo( const XF86VidModeModeInfo *mode, LPDDHALMODEINFO i ...@@ -36,7 +36,10 @@ static void convert_modeinfo( const XF86VidModeModeInfo *mode, LPDDHALMODEINFO i
{ {
info->dwWidth = mode->hdisplay; info->dwWidth = mode->hdisplay;
info->dwHeight = mode->vdisplay; info->dwHeight = mode->vdisplay;
info->wRefreshRate = mode->dotclock * 1000 / (mode->htotal * mode->vtotal); if (mode->htotal!=0 && mode->vtotal!=0)
info->wRefreshRate = mode->dotclock * 1000 / (mode->htotal * mode->vtotal);
else
info->wRefreshRate = 0;
TRACE(" width=%ld, height=%ld, refresh=%d\n", TRACE(" width=%ld, height=%ld, refresh=%d\n",
info->dwWidth, info->dwHeight, info->wRefreshRate); info->dwWidth, info->dwHeight, info->wRefreshRate);
/* XVidMode cannot change display depths... */ /* XVidMode cannot change display depths... */
...@@ -54,7 +57,10 @@ static void convert_modeline(int dotclock, const XF86VidModeModeLine *mode, LPDD ...@@ -54,7 +57,10 @@ static void convert_modeline(int dotclock, const XF86VidModeModeLine *mode, LPDD
{ {
info->dwWidth = mode->hdisplay; info->dwWidth = mode->hdisplay;
info->dwHeight = mode->vdisplay; info->dwHeight = mode->vdisplay;
info->wRefreshRate = dotclock * 1000 / (mode->htotal * mode->vtotal); if (mode->htotal!=0 && mode->vtotal!=0)
info->wRefreshRate = dotclock * 1000 / (mode->htotal * mode->vtotal);
else
info->wRefreshRate = 0;
TRACE(" width=%ld, height=%ld, refresh=%d\n", TRACE(" width=%ld, height=%ld, refresh=%d\n",
info->dwWidth, info->dwHeight, info->wRefreshRate); info->dwWidth, info->dwHeight, info->wRefreshRate);
/* XVidMode cannot change display depths... */ /* XVidMode cannot change display depths... */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment