We need to pass the XF86VidModeModeInfo pointers to XF86VidModeSwitchToMode

so checking modes in VID_CheckVMode and converting them to our own format
isn't really useful.
This commit is contained in:
Marcus Sundberg 2000-01-15 03:31:05 +00:00
parent c0b5b95349
commit bc1a8fa188
2 changed files with 4 additions and 32 deletions

View file

@ -79,13 +79,12 @@ VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo)
Check for the presence of the XFree86-VidMode X server extension Check for the presence of the XFree86-VidMode X server extension
*/ */
int int
VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes, VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver)
struct qfvm_modes **modes)
{ {
#ifdef HAS_DGA #ifdef HAS_DGA
XF86VidModeModeInfo **vidmodes; XF86VidModeModeInfo **vidmodes;
int event_base, error_base; int event_base, error_base;
int ret, dummy, i; int dummy;
if (! XF86VidModeQueryExtension(dpy, &event_base, &error_base)) { if (! XF86VidModeQueryExtension(dpy, &event_base, &error_base)) {
return 0; return 0;
@ -98,27 +97,7 @@ VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes,
return 0; return 0;
} }
if (! XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), return 1;
num_modes, &vidmodes)) {
return 0;
}
if (*num_modes <= 0) return 0;
ret = 0;
*modes = malloc(sizeof(struct qfvm_modes) * *num_modes);
if (*modes) {
ret = 1;
for (i = 0; i < *num_modes; i++) {
(*modes)[i].x = vidmodes[i]->hdisplay;
(*modes)[i].y = vidmodes[i]->vdisplay;
}
}
for (i = 0; i < *num_modes; i++) {
if (vidmodes[i]->private) XFree(vidmodes[i]->private);
}
XFree(vidmodes);
return ret;
#else #else
return 0; return 0;
#endif // HAS_DGA #endif // HAS_DGA

View file

@ -44,13 +44,6 @@ int VID_CheckDGA(Display *dpy, int *maj_ver, int *min_ver, int *hasvideo);
Check for the presence of the XFree86-VMode X server extension Check for the presence of the XFree86-VMode X server extension
*/ */
int VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver);
struct qfvm_modes {
int x;
int y;
};
int VID_CheckVMode(Display *dpy, int *maj_ver, int *min_ver, int *num_modes,
struct qfvm_modes **modes);
#endif /* DGA_CHECK_H */ #endif /* DGA_CHECK_H */