Show more info when dumping x11 video modes

Found in an old stash. Probably the start of xrandr support.
This commit is contained in:
Bill Currie 2020-02-12 11:04:28 +09:00
parent 31501ad641
commit de64be1d67

View file

@ -439,19 +439,23 @@ X11_SetVidMode (int width, int height)
&vidmodes);
XF86VidModeGetModeLine (x_disp, x_screen, &dotclock, &orig_data);
if (developer->int_val & SYS_VID) {
Sys_Printf ("VID: %d modes\n", nummodes);
for (i = 0; i < nummodes; i++) {
Sys_Printf ("VID: %xx%d\n", vidmodes[i]->hdisplay,
vidmodes[i]->vdisplay);
}
}
Sys_MaskPrintf (SYS_VID, "VID: %d modes\n", nummodes);
original_mode = -1;
for (i = 0; i < nummodes; i++) {
if ((vidmodes[i]->hdisplay == orig_data.hdisplay) &&
(vidmodes[i]->vdisplay == orig_data.vdisplay)) {
if (original_mode == -1
&& (vidmodes[i]->hdisplay == orig_data.hdisplay) &&
(vidmodes[i]->vdisplay == orig_data.vdisplay)) {
original_mode = i;
break;
}
if (developer->int_val & SYS_VID) {
Sys_Printf ("VID:%c%dx%d\n",
original_mode == i ? '*' : ' ',
vidmodes[i]->hdisplay, vidmodes[i]->vdisplay);
Sys_Printf ("\t%d %d %d %d:%d %d %d:%d\n",
vidmodes[i]->hsyncstart, vidmodes[i]->hsyncend,
vidmodes[i]->htotal, vidmodes[i]->hskew,
vidmodes[i]->vsyncstart, vidmodes[i]->vsyncend,
vidmodes[i]->vtotal, vidmodes[i]->flags);
}
}
@ -468,8 +472,10 @@ X11_SetVidMode (int width, int height)
Sys_MaskPrintf (SYS_VID, "VID: Chose video mode: %dx%d\n",
viddef.width, viddef.height);
if (0) {
XF86VidModeSwitchToMode (x_disp, x_screen,
vidmodes[best_mode]);
}
vidmode_active = true;
X11_SetScreenSaver ();
} else {
@ -594,7 +600,7 @@ X11_RestoreVidMode (void)
#ifdef HAVE_VIDMODE
if (vidmode_active) {
X11_RestoreScreenSaver ();
XF86VidModeSwitchToMode (x_disp, x_screen, vidmodes[original_mode]);
//XF86VidModeSwitchToMode (x_disp, x_screen, vidmodes[original_mode]);
XFree (vidmodes);
vidmode_active = false;
}