This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_x11modes.c
689 lines (613 loc) · 21.3 KB
1
2
/*
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2009 Sam Lantinga
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_x11video.h"
26
27
28
29
//#define X11MODES_DEBUG
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_VIDMODE
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
static int
get_visualinfo(Display * display, int screen, XVisualInfo * vinfo)
{
const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID");
int depth;
/* Look for an exact visual, if requested */
if (visual_id) {
XVisualInfo *vi, template;
int nvis;
SDL_zero(template);
template.visualid = SDL_strtol(visual_id, NULL, 0);
vi = XGetVisualInfo(display, VisualIDMask, &template, &nvis);
if (vi) {
*vinfo = *vi;
XFree(vi);
return 0;
}
}
depth = DefaultDepth(display, screen);
53
if ((X11_UseDirectColorVisuals() &&
54
55
56
57
58
59
60
61
62
XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) ||
XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) ||
XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) ||
XMatchVisualInfo(display, screen, depth, StaticColor, vinfo)) {
return 0;
}
return -1;
}
63
static Uint32
64
X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo)
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
if (vinfo->class == DirectColor || vinfo->class == TrueColor) {
int bpp;
Uint32 Rmask, Gmask, Bmask, Amask;
Rmask = vinfo->visual->red_mask;
Gmask = vinfo->visual->green_mask;
Bmask = vinfo->visual->blue_mask;
if (vinfo->depth == 32) {
Amask = (0xFFFFFFFF & ~(Rmask | Gmask | Bmask));
} else {
Amask = 0;
}
bpp = vinfo->depth;
if (bpp == 24) {
int i, n;
XPixmapFormatValues *p = XListPixmapFormats(display, &n);
if (p) {
for (i = 0; i < n; ++i) {
if (p[i].depth == 24) {
bpp = p[i].bits_per_pixel;
break;
}
}
XFree(p);
}
}
return SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask);
}
if (vinfo->class == PseudoColor || vinfo->class == StaticColor) {
switch (vinfo->depth) {
case 8:
return SDL_PIXELTYPE_INDEX8;
case 4:
if (BitmapBitOrder(display) == LSBFirst) {
return SDL_PIXELFORMAT_INDEX4LSB;
} else {
return SDL_PIXELFORMAT_INDEX4MSB;
}
break;
case 1:
if (BitmapBitOrder(display) == LSBFirst) {
return SDL_PIXELFORMAT_INDEX1LSB;
} else {
return SDL_PIXELFORMAT_INDEX1MSB;
}
break;
}
}
return SDL_PIXELFORMAT_UNKNOWN;
}
121
122
123
124
125
126
127
128
129
130
131
void
X11_InitModes(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
int screen;
for (screen = 0; screen < ScreenCount(data->display); ++screen) {
XVisualInfo vinfo;
SDL_VideoDisplay display;
SDL_DisplayData *displaydata;
SDL_DisplayMode mode;
132
133
XPixmapFormatValues *pixmapFormats;
int i, n;
134
135
136
137
138
if (get_visualinfo(data->display, screen, &vinfo) < 0) {
continue;
}
139
mode.format = X11_GetPixelFormatFromVisualInfo(data->display, &vinfo);
140
141
142
143
144
145
146
147
148
149
150
mode.w = DisplayWidth(data->display, screen);
mode.h = DisplayHeight(data->display, screen);
mode.refresh_rate = 0;
mode.driverdata = NULL;
displaydata = (SDL_DisplayData *) SDL_malloc(sizeof(*displaydata));
if (!displaydata) {
continue;
}
displaydata->screen = screen;
displaydata->visual = vinfo.visual;
151
displaydata->depth = vinfo.depth;
152
153
displaydata->scanline_pad = SDL_BYTESPERPIXEL(mode.format) * 8;
154
155
156
157
158
159
160
161
162
163
164
pixmapFormats = XListPixmapFormats(data->display, &n);
if (pixmapFormats) {
for (i = 0; i < n; ++i) {
if (pixmapFormats[i].depth == displaydata->depth) {
displaydata->scanline_pad = pixmapFormats[i].scanline_pad;
break;
}
}
XFree(pixmapFormats);
}
165
166
167
168
169
170
171
172
SDL_zero(display);
display.desktop_mode = mode;
display.current_mode = mode;
display.driverdata = displaydata;
SDL_AddVideoDisplay(&display);
}
}
173
174
175
176
177
/* Global for the error handler */
int vm_event, vm_error = -1;
#if SDL_VIDEO_DRIVER_X11_XINERAMA
static SDL_bool
178
CheckXinerama(Display * display, int *major, int *minor)
179
180
181
182
183
184
185
186
187
188
189
190
191
{
const char *env;
/* Default the extension not available */
*major = *minor = 0;
/* Allow environment override */
env = getenv("SDL_VIDEO_X11_XINERAMA");
if (env && !SDL_atoi(env)) {
return SDL_FALSE;
}
/* Query the extension version */
192
193
if (!SDL_NAME(XineramaQueryExtension) (display, major, minor) ||
!SDL_NAME(XineramaIsActive) (display)) {
194
195
196
197
198
199
200
201
return SDL_FALSE;
}
return SDL_TRUE;
}
#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
#if SDL_VIDEO_DRIVER_X11_XRANDR
static SDL_bool
202
CheckXRandR(Display * display, int *major, int *minor)
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{
const char *env;
/* Default the extension not available */
*major = *minor = 0;
/* Allow environment override */
env = getenv("SDL_VIDEO_X11_XRANDR");
if (env && !SDL_atoi(env)) {
return SDL_FALSE;
}
if (!SDL_X11_HAVE_XRANDR) {
return SDL_FALSE;
}
/* Query the extension version */
if (!XRRQueryVersion(display, major, minor)) {
return SDL_FALSE;
}
return SDL_TRUE;
}
#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
#if SDL_VIDEO_DRIVER_X11_VIDMODE
static SDL_bool
229
CheckVidMode(Display * display, int *major, int *minor)
230
231
232
233
234
235
236
237
238
239
240
{
const char *env;
/* Default the extension not available */
*major = *minor = 0;
/* Allow environment override */
env = getenv("SDL_VIDEO_X11_VIDMODE");
if (env && !SDL_atoi(env)) {
return SDL_FALSE;
}
241
242
243
/* Query the extension version */
vm_error = -1;
244
245
if (!SDL_NAME(XF86VidModeQueryExtension) (display, &vm_event, &vm_error)
|| !SDL_NAME(XF86VidModeQueryVersion) (display, major, minor)) {
246
247
248
249
250
return SDL_FALSE;
}
return SDL_TRUE;
}
251
252
Bool SDL_NAME(XF86VidModeGetModeInfo) (Display * dpy, int scr,
SDL_NAME(XF86VidModeModeInfo) * info)
253
254
255
256
257
258
{
Bool retval;
int dotclock;
SDL_NAME(XF86VidModeModeLine) l;
SDL_zerop(info);
SDL_zero(l);
259
retval = SDL_NAME(XF86VidModeGetModeLine) (dpy, scr, &dotclock, &l);
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
info->dotclock = dotclock;
info->hdisplay = l.hdisplay;
info->hsyncstart = l.hsyncstart;
info->hsyncend = l.hsyncend;
info->htotal = l.htotal;
info->hskew = l.hskew;
info->vdisplay = l.vdisplay;
info->vsyncstart = l.vsyncstart;
info->vsyncend = l.vsyncend;
info->vtotal = l.vtotal;
info->flags = l.flags;
info->privsize = l.privsize;
info->private = l.private;
return retval;
}
static int
277
calculate_rate(SDL_NAME(XF86VidModeModeInfo) * info)
278
{
279
280
281
return (info->htotal
&& info->vtotal) ? (1000 * info->dotclock / (info->htotal *
info->vtotal)) : 0;
282
283
284
}
static void
285
save_mode(Display * display, SDL_DisplayData * data)
286
{
287
288
289
290
291
SDL_NAME(XF86VidModeGetModeInfo) (display, data->screen,
&data->saved_mode);
SDL_NAME(XF86VidModeGetViewPort) (display, data->screen,
&data->saved_view.x,
&data->saved_view.y);
292
293
294
}
static void
295
restore_mode(Display * display, SDL_DisplayData * data)
296
297
298
{
SDL_NAME(XF86VidModeModeInfo) mode;
299
if (SDL_NAME(XF86VidModeGetModeInfo) (display, data->screen, &mode)) {
300
if (SDL_memcmp(&mode, &data->saved_mode, sizeof(mode)) != 0) {
301
302
SDL_NAME(XF86VidModeSwitchToMode) (display, data->screen,
&data->saved_mode);
303
304
305
}
}
if ((data->saved_view.x != 0) || (data->saved_view.y != 0)) {
306
307
308
SDL_NAME(XF86VidModeSetViewPort) (display, data->screen,
data->saved_view.x,
data->saved_view.y);
309
310
311
312
}
}
#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
313
314
315
void
X11_GetDisplayModes(_THIS)
{
316
Display *display = ((SDL_VideoData *) _this->driverdata)->display;
317
SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
318
319
320
#if SDL_VIDEO_DRIVER_X11_XINERAMA
int xinerama_major, xinerama_minor;
int screens;
321
SDL_NAME(XineramaScreenInfo) * xinerama;
322
323
324
325
326
327
328
329
330
331
#endif
#if SDL_VIDEO_DRIVER_X11_XRANDR
int xrandr_major, xrandr_minor;
int nsizes, nrates;
XRRScreenSize *sizes;
short *rates;
#endif
#if SDL_VIDEO_DRIVER_X11_VIDMODE
int vm_major, vm_minor;
int nmodes;
332
SDL_NAME(XF86VidModeModeInfo) ** modes;
333
334
335
#endif
int screen_w;
int screen_h;
336
SDL_DisplayMode mode;
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
/* Unfortunately X11 requires the window to be created with the correct
* visual and depth ahead of time, but the SDL API allows you to create
* a window before setting the fullscreen display mode. This means that
* we have to use the same format for all windows and all display modes.
* (or support recreating the window with a new visual behind the scenes)
*/
mode.format = SDL_CurrentDisplay.current_mode.format;
mode.driverdata = NULL;
data->use_xinerama = 0;
data->use_xrandr = 0;
data->use_vidmode = 0;
screen_w = DisplayWidth(display, data->screen);
screen_h = DisplayHeight(display, data->screen);
#if SDL_VIDEO_DRIVER_X11_XINERAMA
/* Query Xinerama extention */
if (CheckXinerama(display, &xinerama_major, &xinerama_minor)) {
#ifdef X11MODES_DEBUG
printf("X11 detected Xinerama:\n");
#endif
359
xinerama = SDL_NAME(XineramaQueryScreens) (display, &screens);
360
361
362
363
364
if (xinerama) {
int i;
for (i = 0; i < screens; i++) {
#ifdef X11MODES_DEBUG
printf("xinerama %d: %dx%d+%d+%d\n",
365
366
367
xinerama[i].screen_number,
xinerama[i].width, xinerama[i].height,
xinerama[i].x_org, xinerama[i].y_org);
368
369
#endif
if (xinerama[i].screen_number == data->screen) {
370
371
data->use_xinerama =
xinerama_major * 100 + xinerama_minor;
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
data->xinerama_info = xinerama[i];
}
}
XFree(xinerama);
}
if (data->use_xinerama) {
/* Add the full xinerama mode */
if (screen_w > data->xinerama_info.width ||
screen_h > data->xinerama_info.height) {
mode.w = screen_w;
mode.h = screen_h;
mode.refresh_rate = 0;
SDL_AddDisplayMode(_this->current_display, &mode);
}
/* Add the head xinerama mode */
mode.w = data->xinerama_info.width;
mode.h = data->xinerama_info.height;
mode.refresh_rate = 0;
SDL_AddDisplayMode(_this->current_display, &mode);
}
}
#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
#if SDL_VIDEO_DRIVER_X11_XRANDR
/* XRandR */
/* require at least XRandR v1.0 (arbitrary) */
400
401
if (CheckXRandR(display, &xrandr_major, &xrandr_minor)
&& xrandr_major >= 1) {
402
403
404
405
406
407
408
#ifdef X11MODES_DEBUG
fprintf(stderr, "XRANDR: XRRQueryVersion: V%d.%d\n",
xrandr_major, xrandr_minor);
#endif
/* save the screen configuration since we must reference it
each time we toggle modes.
409
410
411
*/
data->screen_config =
XRRGetScreenInfo(display, RootWindow(display, data->screen));
412
413
414
415
416
/* retrieve the list of resolution */
sizes = XRRConfigSizes(data->screen_config, &nsizes);
if (nsizes > 0) {
int i, j;
417
for (i = 0; i < nsizes; i++) {
418
419
420
421
422
423
424
mode.w = sizes[i].width;
mode.h = sizes[i].height;
rates = XRRConfigRates(data->screen_config, i, &nrates);
for (j = 0; j < nrates; ++j) {
mode.refresh_rate = rates[j];
#ifdef X11MODES_DEBUG
425
426
fprintf(stderr,
"XRANDR: mode = %4d[%d], w = %4d, h = %4d, rate = %4d\n",
427
428
429
430
431
432
433
i, j, mode.w, mode.h, mode.refresh_rate);
#endif
SDL_AddDisplayMode(_this->current_display, &mode);
}
}
data->use_xrandr = xrandr_major * 100 + xrandr_minor;
434
435
436
data->saved_size =
XRRConfigCurrentConfiguration(data->screen_config,
&data->saved_rotation);
437
438
439
440
441
442
443
444
445
446
447
448
data->saved_rate = XRRConfigCurrentRate(data->screen_config);
}
}
#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
#if SDL_VIDEO_DRIVER_X11_VIDMODE
/* XVidMode */
if (!data->use_xrandr &&
#if SDL_VIDEO_DRIVER_X11_XINERAMA
(!data->use_xinerama || data->xinerama_info.screen_number == 0) &&
#endif
CheckVidMode(display, &vm_major, &vm_minor) &&
449
450
SDL_NAME(XF86VidModeGetAllModeLines) (display, data->screen, &nmodes,
&modes)) {
451
452
453
454
455
456
int i;
#ifdef X11MODES_DEBUG
printf("VidMode modes: (unsorted)\n");
for (i = 0; i < nmodes; ++i) {
printf("Mode %d: %d x %d @ %d\n", i,
457
458
modes[i]->hdisplay, modes[i]->vdisplay,
calculate_rate(modes[i]));
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
}
#endif
for (i = 0; i < nmodes; ++i) {
mode.w = modes[i]->hdisplay;
mode.h = modes[i]->vdisplay;
mode.refresh_rate = calculate_rate(modes[i]);
SDL_AddDisplayMode(_this->current_display, &mode);
}
XFree(modes);
data->use_vidmode = vm_major * 100 + vm_minor;
save_mode(display, data);
}
#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
if (!data->use_xrandr && !data->use_vidmode) {
mode.w = screen_w;
mode.h = screen_h;
mode.refresh_rate = 0;
SDL_AddDisplayMode(_this->current_display, &mode);
479
}
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
#ifdef X11MODES_DEBUG
if (data->use_xinerama) {
printf("Xinerama is enabled\n");
}
if (data->use_xrandr) {
printf("XRandR is enabled\n");
}
if (data->use_vidmode) {
printf("VidMode is enabled\n");
}
#endif /* X11MODES_DEBUG */
}
static void
496
497
get_real_resolution(Display * display, SDL_DisplayData * data, int *w, int *h,
int *rate)
498
499
500
501
502
{
#if SDL_VIDEO_DRIVER_X11_XRANDR
if (data->use_xrandr) {
int nsizes;
XRRScreenSize *sizes;
503
504
505
506
507
508
sizes = XRRConfigSizes(data->screen_config, &nsizes);
if (nsizes > 0) {
int cur_size;
Rotation cur_rotation;
509
510
511
cur_size =
XRRConfigCurrentConfiguration(data->screen_config,
&cur_rotation);
512
513
514
515
*w = sizes[cur_size].width;
*h = sizes[cur_size].height;
*rate = XRRConfigCurrentRate(data->screen_config);
#ifdef X11MODES_DEBUG
516
517
518
fprintf(stderr,
"XRANDR: get_real_resolution: w = %d, h = %d, rate = %d\n",
*w, *h, *rate);
519
520
521
522
523
524
525
526
527
528
#endif
return;
}
}
#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
#if SDL_VIDEO_DRIVER_X11_VIDMODE
if (data->use_vidmode) {
SDL_NAME(XF86VidModeModeInfo) mode;
529
if (SDL_NAME(XF86VidModeGetModeInfo) (display, data->screen, &mode)) {
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
*w = mode.hdisplay;
*h = mode.vdisplay;
*rate = calculate_rate(&mode);
return;
}
}
#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
#if SDL_VIDEO_DRIVER_X11_XINERAMA
if (data->use_xinerama) {
*w = data->xinerama_info.width;
*h = data->xinerama_info.height;
*rate = 0;
return;
}
#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
*w = DisplayWidth(display, data->screen);
*h = DisplayHeight(display, data->screen);
*rate = 0;
}
static void
553
554
set_best_resolution(Display * display, SDL_DisplayData * data, int w, int h,
int rate)
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
{
int real_w, real_h, real_rate;
/* check current mode so we can avoid uneccessary mode changes */
get_real_resolution(display, data, &real_w, &real_h, &real_rate);
if (w == real_w && h == real_h && (!rate || rate == real_rate)) {
return;
}
#if SDL_VIDEO_DRIVER_X11_XRANDR
if (data->use_xrandr) {
#ifdef X11MODES_DEBUG
fprintf(stderr, "XRANDR: set_best_resolution(): w = %d, h = %d\n",
w, h);
#endif
int i, nsizes, nrates;
int best;
int best_rate;
XRRScreenSize *sizes;
short *rates;
/* find the smallest resolution that is at least as big as the user requested */
best = -1;
sizes = XRRConfigSizes(data->screen_config, &nsizes);
for (i = 0; i < nsizes; ++i) {
if (sizes[i].width < w || sizes[i].height < h) {
continue;
}
if (sizes[i].width == w && sizes[i].height == h) {
best = i;
break;
}
if (best == -1 ||
(sizes[i].width < sizes[best].width) ||
588
589
(sizes[i].width == sizes[best].width
&& sizes[i].height < sizes[best].height)) {
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
best = i;
}
}
if (best >= 0) {
best_rate = 0;
rates = XRRConfigRates(data->screen_config, best, &nrates);
for (i = 0; i < nrates; ++i) {
if (rates[i] == rate) {
best_rate = rate;
break;
}
if (!rate) {
/* Higher is better, right? */
if (rates[i] > best_rate) {
best_rate = rates[i];
}
} else {
608
if (SDL_abs(rates[i] - rate) < SDL_abs(best_rate - rate)) {
609
610
611
612
best_rate = rates[i];
}
}
}
613
614
615
616
XRRSetScreenConfigAndRate(display, data->screen_config,
RootWindow(display, data->screen), best,
data->saved_rotation, best_rate,
CurrentTime);
617
618
619
620
621
622
623
}
return;
}
#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
#if SDL_VIDEO_DRIVER_X11_VIDMODE
if (data->use_vidmode) {
624
SDL_NAME(XF86VidModeModeInfo) ** modes;
625
626
627
int i, nmodes;
int best;
628
629
if (SDL_NAME(XF86VidModeGetAllModeLines)
(display, data->screen, &nmodes, &modes)) {
630
631
632
633
634
635
636
best = -1;
for (i = 0; i < nmodes; ++i) {
if (modes[i]->hdisplay < w || modes[i]->vdisplay < h) {
continue;
}
if (best == -1 ||
(modes[i]->hdisplay < modes[best]->hdisplay) ||
637
638
(modes[i]->hdisplay == modes[best]->hdisplay
&& modes[i]->vdisplay < modes[best]->vdisplay)) {
639
640
641
642
643
644
645
best = i;
continue;
}
if ((modes[i]->hdisplay == modes[best]->hdisplay) &&
(modes[i]->vdisplay == modes[best]->vdisplay)) {
if (!rate) {
/* Higher is better, right? */
646
647
if (calculate_rate(modes[i]) >
calculate_rate(modes[best])) {
648
649
650
best = i;
}
} else {
651
652
if (SDL_abs(calculate_rate(modes[i]) - rate) <
SDL_abs(calculate_rate(modes[best]) - rate)) {
653
654
655
656
657
658
659
660
best = i;
}
}
}
}
if (best >= 0) {
#ifdef X11MODES_DEBUG
printf("Best Mode %d: %d x %d @ %d\n", best,
661
662
modes[best]->hdisplay, modes[best]->vdisplay,
calculate_rate(modes[best]));
663
#endif
664
665
SDL_NAME(XF86VidModeSwitchToMode) (display, data->screen,
modes[best]);
666
667
668
669
670
671
}
XFree(modes);
}
return;
}
#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
672
673
674
675
676
}
int
X11_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
{
677
678
679
680
681
Display *display = ((SDL_VideoData *) _this->driverdata)->display;
SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
set_best_resolution(display, data, mode->w, mode->h, mode->refresh_rate);
return 0;
682
683
684
685
686
687
688
689
}
void
X11_QuitModes(_THIS)
{
}
/* vi: set ts=4 sw=4 expandtab: */