1 Index: src/video/fbcon/SDL_fbvideo.c
2 ===================================================================
3 --- src/video/fbcon/SDL_fbvideo.c (revision 2761)
4 +++ src/video/fbcon/SDL_fbvideo.c (working copy)
5 @@ -412,7 +412,7 @@ FB_CheckMode(_THIS, struct fb_var_screen
8 FB_AddMode(_THIS, int index, unsigned int w, unsigned int h,
10 + int check_timings, int reversed)
14 @@ -435,10 +435,12 @@ FB_AddMode(_THIS, int index, unsigned in
17 for (i = 0; i < (sizeof(vesa_timings) / sizeof(vesa_timings[0])); ++i) {
18 - if ((w == vesa_timings[i].xres) &&
19 - (h == vesa_timings[i].yres) && vesa_timings[i].pixclock) {
22 + if (vesa_timings[i].pixclock) {
23 + if (!reversed && w == vesa_timings[i].xres && h == vesa_timings[i].yres ||
24 + reversed && h == vesa_timings[i].xres && w == vesa_timings[i].yres) {
31 @@ -653,24 +655,33 @@ FB_VideoInit(_THIS, SDL_PixelFormat * vf
32 SDL_modelist[i] = NULL;
34 if (SDL_getenv("SDL_FB_BROKEN_MODES") != NULL) {
35 - FB_AddMode(this, current_index, current_w, current_h, 0);
36 + FB_AddMode(this, current_index, current_w, current_h, 0, 0);
38 while (read_fbmodes_mode(modesdb, &vinfo)) {
39 for (i = 0; i < NUM_MODELISTS; ++i) {
43 /* See if we are querying for the current mode */
46 +try_reversed_dynamic:
47 if (i == current_index) {
48 if ((current_w > w) || (current_h > h)) {
50 - FB_AddMode(this, i, current_w, current_h, 0);
51 + FB_AddMode(this, i, current_w, current_h, 0, reversed);
55 if (FB_CheckMode(this, &vinfo, i, &w, &h)) {
56 - FB_AddMode(this, i, w, h, 0);
57 + FB_AddMode(this, i, w, h, 0, reversed);
60 + /* See if a reversed X/Y matches */
62 + unsigned tmp = w; w = h; h = tmp;
64 + goto try_reversed_dynamic;
68 @@ -680,19 +691,28 @@ FB_VideoInit(_THIS, SDL_PixelFormat * vf
69 for (i = 0; i < NUM_MODELISTS; ++i) {
70 for (j = 0; j < (sizeof(checkres) / sizeof(checkres[0])); ++j) {
74 /* See if we are querying for the current mode */
78 if (i == current_index) {
79 if ((current_w > w) || (current_h > h)) {
81 - FB_AddMode(this, i, current_w, current_h, 0);
82 + FB_AddMode(this, i, current_w, current_h, 0, reversed);
86 if (FB_CheckMode(this, &vinfo, i, &w, &h)) {
87 - FB_AddMode(this, i, w, h, 1);
88 + FB_AddMode(this, i, w, h, 1, reversed);
91 + /* See if a reversed X/Y matches */
93 + unsigned tmp = w; w = h; h = tmp;
95 + goto try_reversed_static;