diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 05f4319..9d03c64 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -291,11 +291,26 @@ add(char **p, char *new) * Print out a modeline. */ void -xf86PrintModeline(int scrnIndex,DisplayModePtr mode) +xf86PrintModeline(int scrnIndex, DisplayModePtr mode) { char tmp[256]; + char tchar[] = "UeudPb"; + int tbit[] = { M_T_USERPREF, M_T_DRIVER, M_T_USERDEF, + M_T_DEFAULT, M_T_PREFERRED, M_T_BUILTIN }; + char type[sizeof(tchar)+2]; + int tlen = 0; char *flags = xnfcalloc(1, 1); + if (mode->type) { + int i; + + type[tlen++] = ' '; + for (i = 0; i < sizeof(tchar); i++) + if (mode->type & tbit[i]) + type[tlen++] = tchar[i]; + } + type[tlen++] = '\0'; + if (mode->HSkew) { snprintf(tmp, 256, "hskew %i", mode->HSkew); add(&flags, tmp); @@ -318,12 +333,12 @@ #if 0 if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2"); #endif xf86DrvMsg(scrnIndex, X_INFO, - "Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s " - "(%.01f kHz)\n", - mode->name, mode->VRefresh, mode->Clock/1000., mode->HDisplay, - mode->HSyncStart, mode->HSyncEnd, mode->HTotal, - mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, - mode->VTotal, flags, xf86ModeHSync(mode)); + "Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s" + " (%.01f kHz%s)\n", + mode->name, mode->VRefresh, mode->Clock/1000., + mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal, + mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal, + flags, xf86ModeHSync(mode), type); free(flags); } #endif /* XORG_VERSION_CURRENT <= 7.2.99.2 */